コード例 #1
0
 public LibraryNavItem(LocalFileList localFileList) {
   this.localFileList = localFileList;
   if (localFileList instanceof SharedFileList) {
     this.sharedFileList = (SharedFileList) localFileList;
     this.navType = sharedFileList.isPublic() ? NavType.PUBLIC_SHARED : NavType.LIST;
   } else {
     this.sharedFileList = null;
     this.navType = NavType.LIBRARY;
   }
 }
コード例 #2
0
  public boolean isShared() {
    if (getType() == NavType.PUBLIC_SHARED) {
      return true;
    }

    if (sharedFileList != null) {
      return sharedFileList.getFriendIds().size() > 0;
    }

    return false;
  }
コード例 #3
0
 public String getDisplayText() {
   switch (navType) {
     case LIST:
       return sharedFileList.getCollectionName();
     case LIBRARY:
       return I18n.tr("Library");
     case PUBLIC_SHARED:
       return I18n.tr("Public Shared");
     default:
       throw new IllegalStateException("unknown type: " + navType);
   }
 }
コード例 #4
0
 public int getId() {
   return sharedFileList != null ? sharedFileList.getId() : -1;
 }