private void addStock() {
    final String symbol = newSymbolTextBox.getText().toUpperCase().trim();
    newSymbolTextBox.setFocus(true);

    // Stock code must be between 1 and 10 chars that are numbers, letters, or dots.
    if (!symbol.matches("^[0-9A-Z\\.]{1,10}$")) {
      Window.alert("'" + symbol + "' is not a valit symbol.");
      newSymbolTextBox.selectAll();
      return;
    }

    newSymbolTextBox.setText("");
  }
Exemple #2
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);
     }
   }
 }
 private String getParameterValue(HorizontalPanel entry) {
   TextBox key = (TextBox) entry.getWidget(2);
   return key.getText();
 }
Exemple #4
0
 /** @return Contents of the Title field, trimmed. */
 private String getTitleText() {
   return title.getText() == null ? null : title.getText().trim();
 }