Ejemplo n.º 1
0
 // Returns null if expression is OK, a message if it is not.
 private String checkExceptionsSyntax() {
   try {
     String tmp = edExceptions.getText();
     if (Util.isEmpty(tmp)) return null;
     Pattern.compile(tmp);
     params.setExceptions(tmp);
   } catch (PatternSyntaxException e) {
     return e.getMessage();
   }
   return null;
 }
Ejemplo n.º 2
0
  private boolean saveData() {
    if (chkUseCodeFinder.getSelection()) {
      if (pnlCodeFinder.getRules() == null) {
        return false;
      } else {
        params.setCodeFinderData(pnlCodeFinder.getRules());
      }
    }
    String tmp = checkExceptionsSyntax();
    if (tmp != null) {
      edExceptions.selectAll();
      edExceptions.setFocus();
      Dialogs.showError(shell, tmp, null);
      return false;
    }

    params.setUseCodeFinder(chkUseCodeFinder.getSelection());
    params.setExceptions(edExceptions.getText());
    params.setExtractStandalone(chkExtractStandalone.getSelection());
    params.setExtractAllPairs(rdExtractAllPairs.getSelection());
    return true;
  }
Ejemplo n.º 3
0
  private void setData() {
    chkExtractStandalone.setSelection(params.getExtractStandalone());
    rdExtractAllPairs.setSelection(params.getExtractAllPairs());
    rdDontExtractPairs.setSelection(!params.getExtractAllPairs());
    edExceptions.setText(params.getExceptions() == null ? "" : params.getExceptions());
    chkUseCodeFinder.setSelection(params.getUseCodeFinder());
    pnlCodeFinder.setRules(params.getCodeFinderData());

    updateInlineCodes();
    pnlCodeFinder.updateDisplay();
  }