Exemple #1
0
  private void initOutputLocation() {
    // currently, the save location is populated deterministically by the combination of
    // the users's input

    final RootPanel outputPanel = RootPanel.get("output");
    output = new TextBox();
    output.setVisibleLength(150);
    output.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(final ChangeEvent event) {
            outputPathUserSpecified = true;
            updateOutputLocation();
          }
        });
    outputPanel.add(output);

    final RootPanel outputWarning = RootPanel.get("outputWarning");
    outputValidationPanel = new ValidationPanel(2);

    outputWarning.add(outputValidationPanel);

    connectOutputLocationAndFileTable();
    // Fire userChanged to get the output location updated
    userChanged();
    updateOutputLocation();
  }
Exemple #2
0
 private void initTitleEditor() {
   final RootPanel titlePanel = RootPanel.get("title");
   title.setVisibleLength(60);
   titlePanel.add(title);
   title.addKeyUpHandler(
       new KeyUpHandler() {
         @Override
         public void onKeyUp(final KeyUpEvent event) {
           userEditedTitle = true;
           updateOutputLocation();
         }
       });
   titleChangeListener = new TitleChangeListener();
   title.addChangeHandler(titleChangeListener);
 }
Exemple #3
0
 private void setOutputPathChangeEnabled(final boolean enabled) {
   if (output != null && enabled != outputPathChangeEnabled) {
     outputPathChangeEnabled = enabled;
     if (!outputPathChangeEnabled) {
       outputPathUserSpecified = false;
     }
     output.setReadOnly(!enabled);
     // Update the output location, when changes are disabled, the field gets filled automatically
     updateOutputLocation();
   }
 }
Exemple #4
0
 /** Update the output location as appropriate. */
 public void updateOutputLocation() {
   if (outputPathChangeEnabled && outputPathUserSpecified) {
     // The user can and did influence output path. Keep whatever was the previous setting, unless
     // it is a special value like "<No Files Selected>" or "<No Title>" - wipe that one.
     if (outputPathSpecial) {
       outputPathSpecial = false;
     }
     validateOutputPath(output.getText());
   } else {
     // Automatically populate the file path
     final List<ClientFileSearch> fileSearches = getFileSearches();
     if (files == null || (fileSearches == null) || (fileSearches.isEmpty())) {
       if (!outputPathChangeEnabled) {
         output.setText("<No Files Selected>");
         outputPathSpecial = true;
       } else {
         output.setText("");
       }
       outputValidationPanel.removeValidationsFor(output);
       outputPath = null;
     } else if ((getTitleText() == null) || getTitleText().equals("")) {
       if (!outputPathChangeEnabled) {
         output.setText("<No Title>");
         outputPathSpecial = true;
       } else {
         output.setText("");
       }
       outputValidationPanel.removeValidationsFor(output);
       outputPath = null;
     } else {
       outputPathSpecial = false;
       outputPath = getOutputPathFromFileTable(fileSearches);
       output.setText(outputPath);
       validateOutputPath(outputPath);
     }
   }
 }
Exemple #5
0
 /** @return Contents of the Title field, trimmed. */
 private String getTitleText() {
   return title.getText() == null ? null : title.getText().trim();
 }
Exemple #6
0
  /** Check query string to see if the user wants to load previous search data into the forms. */
  private void loadPreviousSearch(final ClientLoadedSearch result) {
    if (result == null) {
      return;
    }
    final ClientSwiftSearchDefinition definition = result.getDefinition();
    displayMessage("Loaded previous search " + definition.getSearchTitle());

    if (result.getClientParamSetList() != null) {
      // We transfered a new parameter set list together with search definition
      // Update the parameter editor.
      paramsEditor.setParamSetList(result.getClientParamSetList());
    }

    paramsEditor.setSelectedParamSet(result.getDefinition().getParamSet());

    // Determine search type
    SearchType searchType = null;
    for (final ClientFileSearch clientFileSearch : definition.getInputFiles()) {
      final String fileNamefileNameWithoutExtension =
          FilePathWidget.getFileNameWithoutExtension(clientFileSearch.getPath());
      final SearchType newSearchType =
          SearchTypeList.getSearchTypeFromSetup(
              definition.getSearchTitle(),
              fileNamefileNameWithoutExtension,
              clientFileSearch.getExperiment(),
              clientFileSearch.getBiologicalSample());
      if (searchType == null) {
        searchType = newSearchType;
      } else {
        if (!searchType.equals(newSearchType)) {
          searchType = SearchType.Custom;
          break;
        }
      }
    }

    final String title = definition.getSearchTitle();
    setTitleText(title);
    if (spectrumQaSetupPanel != null) {
      spectrumQaSetupPanel.setParameters(definition.getSpectrumQa());
    }
    if (reportSetupPanel != null) {
      reportSetupPanel.setParameters(definition.getPeptideReport());
    }
    final List<ClientFileSearch> inputFiles = definition.getInputFiles();

    files.setFiles(inputFiles, searchType);

    selectUser(definition.getUser().getEmail());

    final String filePath = getOutputPathFromFileTable(inputFiles);
    // If the loaded path differs from what the file table would produce, it is user-specified
    // .. set the proper flags
    if (definition.getOutputFolder() == null || !definition.getOutputFolder().equals(filePath)) {
      outputPathUserSpecified = true;
    }
    outputPath = definition.getOutputFolder();
    output.setText(outputPath);
    updateOutputLocation();

    additionalSettingsPanel.setDefinition(definition);

    showPageContentsAfterLoad();
  }