Esempio n. 1
0
  @Nullable
  public FileSelection getSelection() {
    FileDto selectedFile = getSelectedFile();
    if (selectedFile == null) return null;

    if (fileSelectionType == FileSelectionType.FILE_OR_FOLDER) {
      return new FileSelection(selectedFile.getPath(), fileSelectionType);
    }

    if (FileDtos.isFile(selectedFile) && fileSelectionType == FileSelectionType.FILE) {
      return new FileSelection(selectedFile.getPath(), fileSelectionType);
    }

    if (FileDtos.isFolder(selectedFile) && fileSelectionType == FileSelectionType.FOLDER) {
      return new FileSelection(selectedFile.getPath(), fileSelectionType);
    }

    return null;
  }
Esempio n. 2
0
  @Override
  public void onReveal() {
    // Clear previous state.
    clearSelection(); // clear previous selection (highlighted row)
    getView().clearNewFolderName(); // clear previous new folder name

    // Adjust display based on file selection type.
    setDisplaysFiles(displaysFiles());

    folderDetailsPresenter.setCurrentFolder(FileDtos.user(credentials.getUsername()));
  }
Esempio n. 3
0
 @Override
 public void onReportsSelection() {
   fireEvent(new FolderRequestEvent(FileDtos.reports()));
 }
Esempio n. 4
0
 @Override
 public void onProjectsSelection() {
   fireEvent(new FolderRequestEvent(FileDtos.projects()));
 }
Esempio n. 5
0
 @Override
 public void onUsersSelection() {
   fireEvent(new FolderRequestEvent(FileDtos.users()));
 }
Esempio n. 6
0
 @Override
 public void onFileSystemSelection() {
   fireEvent(new FolderRequestEvent(FileDtos.create()));
 }
Esempio n. 7
0
 @Override
 public void onProjectHomeSelection() {
   if (project != null) {
     fireEvent(new FolderRequestEvent(FileDtos.project(project)));
   }
 }
Esempio n. 8
0
 @Override
 public void onUserHomeSelection() {
   fireEvent(new FolderRequestEvent(FileDtos.user(credentials.getUsername())));
 }