Example #1
0
  private void ok() {
    if (Const.isEmpty(wStepname.getText())) return;
    input.setCommitSize(Const.toInt(wCommit.getText(), 0));
    stepname = wStepname.getText(); // return value
    input.setSqlFieldName(wSQLFieldName.getText());
    // copy info to TextFileInputMeta class (input)
    input.setDatabaseMeta(transMeta.findDatabase(wConnection.getText()));

    input.setInsertField(wInsertField.getText());
    input.setUpdateField(wUpdateField.getText());
    input.setDeleteField(wDeleteField.getText());
    input.setReadField(wReadField.getText());
    input.setSqlFromfile(wSQLFromFile.getSelection());
    input.SetSendOneStatement(wSendOneStatement.getSelection());
    if (input.getDatabaseMeta() == null) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setMessage(
          BaseMessages.getString(
              PKG, "ExecSQLRowDialog.InvalidConnection.DialogMessage")); // $NON-NLS-1$
      mb.setText(
          BaseMessages.getString(
              PKG, "ExecSQLRowDialog.InvalidConnection.DialogTitle")); // $NON-NLS-1$
      mb.open();
      return;
    }

    dispose();
  }
 private int ask(String message, String title) {
   Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
   MessageBox messageBox = new MessageBox(shell, SWT.ICON_QUESTION | SWT.YES | SWT.NO);
   messageBox.setMessage(message);
   messageBox.setText(title);
   return messageBox.open();
 }
Example #3
0
  private void prepare() {
    try {
      this.container = new FrequencyContainer(this.chiffre, this.plength);

      boolean a = container.isBlocked();
      String b = container.cutText(chiffre);
      String c = container.formatPreview(a, plength, b);

      this.tsample.setText(c);

      container.initGraph(cgraph);
      container.activateComparator(
          container.getReferenceText(),
          DataProvider.getInstance().getAlphabet(container.getAlphabetIdent()));
      container.enableButtons(cphrase);
      container.show();
    } catch (NoContentException ncEx) {
      // not my fault. just in case.
      String message = Messages.FrequencyGui_mbox_missing;
      MessageBox box = new MessageBox(null, SWT.ICON_WARNING);
      box.setText(Messages.VigenereGlobal_mbox_info);
      box.setMessage(message);
      box.open();
    }
  }
  protected void guardar() {

    try {
      validar();

      Concepto c;
      if (concepto == null) c = new Concepto();
      else c = concepto;
      c.setConcepto(txConcepto.getText());
      c.setCosto(rubros.get(cbRubro.getSelectionIndex()));

      // Guardar el concepto

      contable.guardarConcepto(c);

      result = c;
      shlEditarConcepto.close();

    } catch (Exception e) {
      // TODO Capturar la excepción de duplicado y enviarlo en un mensaje
      // adecuado
      MessageBox mb = new MessageBox(shlEditarConcepto, SWT.ICON_WARNING);
      mb.setMessage(e.getMessage());
      mb.open();
    }
  }
Example #5
0
  private StackFileInfo postSTackFile(
      StackFileInfo stackFileInfo, ParserConfig config, String filter, boolean isRecent) {
    if (stackFileInfo.getTotalWorkingCount() <= 0) {
      MessageBox messageBox =
          new MessageBox(
              m_parentComposite.getShell(), SWT.ICON_ERROR | SWT.YES | SWT.APPLICATION_MODAL);
      messageBox.setText("File open error");
      messageBox.setMessage(
          new StringBuilder(200)
              .append("A working thread is not exists in ")
              .append(stackFileInfo.getFilename())
              .append(". configure a ")
              .append(config.getConfigFilename())
              .append(". ")
              .toString());
      messageBox.open();
      return null;
    }

    if (!isRecent) {
      PreferenceManager prefManager = PreferenceManager.get();
      if (filter == null) {
        prefManager.addToStackFiles(stackFileInfo.getFilename());
      }
      prefManager.addToAnalyzedStackFiles(stackFileInfo.getFilename());
    }
    return stackFileInfo;
  }
Example #6
0
  private ParserConfig selectAdoptiveParserConfig() {
    PreferenceManager prefManager = PreferenceManager.get();
    String configFile = prefManager.getCurrentParserConfig();
    if (m_isDefaultConfiguration) {
      configFile = XMLReader.DEFAULT_XMLCONFIG;
    }

    if (configFile == null) {
      MessageBox messageBox =
          new MessageBox(
              m_parentComposite.getShell(),
              SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.APPLICATION_MODAL);
      messageBox.setText("Check Setting selection");
      messageBox.setMessage(
          "The configuration file is not selected.\r\nDo you want to use the default configuration?");
      int result = messageBox.open();
      if (result == SWT.YES) {
        configFile = XMLReader.DEFAULT_XMLCONFIG;
      } else {
        configFile = selectCurrentParserConfig();
        if (configFile == null) {
          throw new RuntimeException("Parser config file is not selected!");
        }
      }
    }

    ParserConfigReader reader = new ParserConfigReader(configFile);
    return reader.read();
  }
  private void ok() {
    if (Const.isEmpty(wName.getText())) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setText(BaseMessages.getString(PKG, "System.StepJobEntryNameMissing.Title"));
      mb.setMessage(BaseMessages.getString(PKG, "System.JobEntryNameMissing.Msg"));
      mb.open();
      return;
    }
    jobEntry.setName(wName.getText());
    jobEntry.setDatabase(jobMeta.findDatabase(wConnection.getText()));
    jobEntry.setSchemaname(wSchemaname.getText());
    jobEntry.setTablename(wTablename.getText());
    jobEntry.setFilename(wFilename.getText());
    jobEntry.setSeparator(wSeparator.getText());
    jobEntry.setEnclosed(wEnclosed.getText());
    jobEntry.setEscaped(wEscaped.getText());
    jobEntry.setLineterminated(wLineterminated.getText());
    jobEntry.setLinestarted(wLinestarted.getText());
    jobEntry.setReplacedata(wReplacedata.getSelection());
    jobEntry.setIgnorelines(wIgnorelines.getText());
    jobEntry.setListattribut(wListattribut.getText());
    jobEntry.prorityvalue = wProrityValue.getSelectionIndex();
    jobEntry.setLocalInfile(wLocalInfile.getSelection());

    jobEntry.setAddFileToResult(wAddFileToResult.getSelection());

    dispose();
  }
Example #8
0
 private int showMultipleOutputTablesWarning(boolean includeCancel) {
   MessageBox mb =
       new MessageBox(shell, SWT.OK | (includeCancel ? SWT.CANCEL : SWT.NONE) | SWT.ICON_ERROR);
   mb.setMessage(BaseMessages.getString(PKG, "SapInputDialog.MultipleOutputTables.DialogMessage"));
   mb.setText(BaseMessages.getString(PKG, "SapInputDialog.MultipleOutputTables.DialogTitle"));
   return mb.open();
 }
Example #9
0
  private boolean saveAs() {

    FileDialog saveDialog = new FileDialog(shell, SWT.SAVE);
    saveDialog.setFilterExtensions(new String[] {"*.adr;", "*.*"});
    saveDialog.setFilterNames(new String[] {"Address Books (*.adr)", "All Files "});

    saveDialog.open();
    String name = saveDialog.getFileName();

    if (name.equals("")) return false;

    if (name.indexOf(".adr") != name.length() - 4) {
      name += ".adr";
    }

    File file = new File(saveDialog.getFilterPath(), name);
    if (file.exists()) {
      MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO);
      box.setText(resAddressBook.getString("Save_as_title"));
      box.setMessage(
          resAddressBook.getString("File")
              + file.getName()
              + " "
              + resAddressBook.getString("Query_overwrite"));
      if (box.open() != SWT.YES) {
        return false;
      }
    }
    this.file = file;
    return save();
  }
  private void ok() {
    if (Const.isEmpty(wStepname.getText())) return;

    input.setDatabase(transMeta.findDatabase(wConnection.getText()));
    input.setSchemaname(wSchemaname.getText());
    input.setTablename(wTablenameText.getText());
    input.setTablenameInField(wTablenameInField.getSelection());
    input.setDynamicTablenameField(wTableName.getText());
    input.setDynamicColumnnameField(wColumnName.getText());
    input.setResultFieldName(wResult.getText());

    stepname = wStepname.getText(); // return value

    if (input.getDatabase() == null) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setMessage(
          BaseMessages.getString(
              PKG, "ColumnExistsDialog.InvalidConnection.DialogMessage")); // $NON-NLS-1$
      mb.setText(
          BaseMessages.getString(
              PKG, "ColumnExistsDialog.InvalidConnection.DialogTitle")); // $NON-NLS-1$
      mb.open();
    }

    dispose();
  }
 private void displayMessageBox(int widgetArguments, String title, String message) {
   MessageBox errorDialog =
       new MessageBox(vfsBrowser.getDisplay().getActiveShell(), widgetArguments);
   errorDialog.setText(title); // $NON-NLS-1$
   errorDialog.setMessage(message);
   errorDialog.open();
 }
 public void promptForNewFolder() {
   boolean done = false;
   String defaultText = "New Folder";
   String text = defaultText;
   while (!done) {
     if (text == null) {
       text = defaultText;
     }
     TextInputDialog textDialog =
         new TextInputDialog(
             Messages.getString("VfsBrowser.enterNewFolderName"), text, 500, 160); // $NON-NLS-1$
     text = textDialog.open();
     if (text != null && !"".equals(text)) { // $NON-NLS-1$
       try {
         vfsBrowser.createFolder(text); // $NON-NLS-1$
         done = true;
       } catch (FileSystemException e) {
         MessageBox errorDialog = new MessageBox(newFolderButton.getShell(), SWT.OK);
         errorDialog.setText(Messages.getString("VfsBrowser.error")); // $NON-NLS-1$
         if (e.getCause() != null) {
           errorDialog.setMessage(e.getCause().getMessage());
         } else {
           errorDialog.setMessage(e.getMessage());
         }
         errorDialog.open();
       }
     } else {
       done = true;
     }
   }
 }
Example #13
0
  private void ok() {
    if (Const.isEmpty(wStepname.getText())) return;

    stepname = wStepname.getText(); // return value
    // copy info to TextFileInputMeta class (input)
    input.setSql(wSQL.getText());
    input.setDatabaseMeta(transMeta.findDatabase(wConnection.getText()));
    input.setExecutedEachInputRow(wEachRow.getSelection());
    input.setSingleStatement(wSingleStatement.getSelection());
    input.setVariableReplacementActive(wVariables.getSelection());
    input.setQuoteString(wQuoteString.getSelection());
    input.setParams(wSetParams.getSelection());
    input.setInsertField(wInsertField.getText());
    input.setUpdateField(wUpdateField.getText());
    input.setDeleteField(wDeleteField.getText());
    input.setReadField(wReadField.getText());

    int nrargs = wFields.nrNonEmpty();
    input.allocate(nrargs);
    if (log.isDebug())
      logDebug(BaseMessages.getString(PKG, "ExecSQLDialog.Log.FoundArguments", +nrargs + ""));
    for (int i = 0; i < nrargs; i++) {
      TableItem item = wFields.getNonEmpty(i);
      input.getArguments()[i] = item.getText(1);
    }

    if (input.getDatabaseMeta() == null) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setMessage(BaseMessages.getString(PKG, "ExecSQLDialog.InvalidConnection.DialogMessage"));
      mb.setText(BaseMessages.getString(PKG, "ExecSQLDialog.InvalidConnection.DialogTitle"));
      mb.open();
    }

    dispose();
  }
Example #14
0
  /**
   * Starts the report thread and shows a progress bar dialog. Only to be used by reports with SQL
   * and HQL data sources at the moment
   */
  public void viewBatchReport() {
    JasperPrint jp_0 = reportList.get(0);
    List<Integer> reportSizes = new ArrayList();
    for (int i = 0; i < reportList.size(); i++) {
      reportSizes.add(Integer.valueOf(reportList.get(i).getPages().size()));
    }

    for (int i = 1; i < reportList.size(); i++) {
      List<JRPrintPage> pageList = reportList.get(i).getPages();
      for (int j = 0; j < reportSizes.get(i).intValue(); j++) {
        jp_0.addPage(pageList.get(j));
      }
    }

    if (jp_0 != null) {
      if (jp_0.getPages().size() > 0) {
        ViewerApp viewer = new ViewerApp();
        viewer.getReportViewer().setDocument(jp_0);
        viewer.open();
      } else if (!reportGenerationCancelled) {
        MessageBox mNoPages = new MessageBox(parent, SWT.ICON_ERROR | SWT.OK);
        mNoPages.setText("Report Has No Pages");
        mNoPages.setMessage(
            "The report you are trying to generate does not contain any data. \n\nPlease check the input values you have entered (such as dates) for this report, and try again.");
        mNoPages.open();
      }
    }
  }
  protected void createNewMessageBox() {
    Shell shell = getParentObject();

    dialog = new MessageBox(shell, acceptBtn | cancelBtn);
    dialog.setText(getTitle());
    dialog.setMessage(this.getMessage());
  }
  private void ok() {
    if (Const.isEmpty(wName.getText())) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setText(BaseMessages.getString(PKG, "System.StepJobEntryNameMissing.Title"));
      mb.setMessage(BaseMessages.getString(PKG, "System.JobEntryNameMissing.Msg"));
      mb.open();
      return;
    }
    jobEntry.setName(wName.getText());

    int nritems = wFields.nrNonEmpty();

    jobEntry.connections = new DatabaseMeta[nritems];
    jobEntry.waitfors = new String[nritems];
    jobEntry.waittimes = new int[nritems];

    for (int i = 0; i < nritems; i++) {
      String arg = wFields.getNonEmpty(i).getText(1);
      DatabaseMeta dbMeta = jobMeta.findDatabase(arg);
      if (dbMeta != null) {
        jobEntry.connections[i] = dbMeta;
        jobEntry.waitfors[i] = "" + Const.toInt(wFields.getNonEmpty(i).getText(2), 0);
        jobEntry.waittimes[i] =
            JobEntryCheckDbConnections.getWaitTimeByDesc(wFields.getNonEmpty(i).getText(3));
      }
    }
    dispose();
  }
 public boolean performOk() {
   if (super.performOk() && shouldRevalidateOnSettingsChange()) {
     MessageBox mb =
         new MessageBox(
             this.getShell(),
             SWT.APPLICATION_MODAL
                 | SWT.YES
                 | SWT.NO
                 | SWT.CANCEL
                 | SWT.ICON_INFORMATION
                 | SWT.RIGHT);
     mb.setText(SSEUIMessages.Validation_Title);
     /* Choose which message to use based on if its project or workspace settings */
     String msg =
         (getProject() == null)
             ? SSEUIMessages.Validation_Workspace
             : SSEUIMessages.Validation_Project;
     mb.setMessage(msg);
     switch (mb.open()) {
       case SWT.CANCEL:
         return false;
       case SWT.YES:
         storeValues();
         ValidateJob job = new ValidateJob(SSEUIMessages.Validation_jobName);
         job.schedule();
       case SWT.NO:
         storeValues();
       default:
         return true;
     }
   }
   return true;
 }
Example #18
0
 private int showDatabaseWarning(boolean includeCancel) {
   MessageBox mb =
       new MessageBox(shell, SWT.OK | (includeCancel ? SWT.CANCEL : SWT.NONE) | SWT.ICON_ERROR);
   mb.setMessage(BaseMessages.getString(PKG, "SapInputDialog.InvalidConnection.DialogMessage"));
   mb.setText(BaseMessages.getString(PKG, "SapInputDialog.InvalidConnection.DialogTitle"));
   return mb.open();
 }
Example #19
0
  /**
   * The action has been activated. The argument of the method represents the 'real' action sitting
   * in the workbench UI.
   *
   * @see IWorkbenchWindowActionDelegate#run
   */
  public void run(IAction action) {
    AlisaEditor editor;
    Requirement requirement;

    requirement = null;
    editor = null;
    IEditorPart editorPart = window.getActivePage().getActiveEditor();

    if (editorPart instanceof AlisaEditor) {
      editor = (AlisaEditor) editorPart;
    }

    if (editor != null) {
      Object o =
          ((IStructuredSelection)
                  (editor.getTableViewer(AlisaEditor.INDEX_TABLE_REQUIREMENTS).getSelection()))
              .getFirstElement();
      if (o instanceof Requirement) {
        requirement = (Requirement) o;
      }
    }

    if (requirement == null) {
      MessageBox dialog = new MessageBox(window.getShell(), SWT.OK);
      dialog.setText("Alisa CAE Generator");
      dialog.setMessage("You must select a requirement");
      dialog.open();
    } else {
      //			GeneratorCAE.init();
      //			GeneratorCAE.generate (null, requirement);
      //			GeneratorCAE.save(edu.cmu.sei.alisa.analysis.utils.Utils.getSelectedProject());
      //			AlisaDebug.debug("[GenerateCAE] selected requirement=" + requirement);
    }
  }
Example #20
0
  /**
   * Perform any cleanup necessary to exit the program (save configuration, etc).
   *
   * @see org.eclipse.jface.window.Window#close()
   */
  public boolean close() {
    try {
      int modified = modifiedCount();
      if (modified > 0) {
        MessageBox message = new MessageBox(getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
        message.setMessage(modified + " document(s) not saved, still exit?");
        int confirm = message.open();
        if (confirm == SWT.NO) {
          return false;
        }
      }

      Point currentSize = this.getShell().getSize();
      config.setInitialSize(currentSize.x, currentSize.y);
      config.save();

      CTabItem[] items = tabFolder.getItems();
      for (int i = items.length - 1; i >= 0; --i) {
        Control control = items[i].getControl();
        if (control instanceof WikiViewer) {
          ((WikiViewer) control).dispose();
        } else {
          LOG.debug("Control is not of type WikiViewer : " + control.getClass().getName());
        }
      }
    } catch (ConfigurationException e) {
      logError("Cannot save configuration", e);
    }

    return super.close();
  }
Example #21
0
  private void getTableName() {
    DatabaseMeta inf = null;
    // New class: SelectTableDialog
    int connr = wConnection.getSelectionIndex();
    if (connr >= 0) inf = transMeta.getDatabase(connr);

    if (inf != null) {
      log.logDebug(
          toString(),
          Messages.getString("UpdateDialog.Log.LookingAtConnection")
              + inf.toString()); // $NON-NLS-1$

      DatabaseExplorerDialog std =
          new DatabaseExplorerDialog(shell, SWT.NONE, inf, transMeta.getDatabases());
      std.setSelectedSchema(wSchema.getText());
      std.setSelectedTable(wTable.getText());
      std.setSplitSchemaAndTable(true);
      if (std.open() != null) {
        wSchema.setText(Const.NVL(std.getSchemaName(), ""));
        wTable.setText(Const.NVL(std.getTableName(), ""));
      }
    } else {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setMessage(
          Messages.getString("UpdateDialog.InvalidConnection.DialogMessage")); // $NON-NLS-1$
      mb.setText(Messages.getString("UpdateDialog.InvalidConnection.DialogTitle")); // $NON-NLS-1$
      mb.open();
    }
  }
  // Preview the data
  private void preview() {
    GetTableNamesMeta oneMeta = new GetTableNamesMeta();

    getInfo(oneMeta);
    if (oneMeta.getDatabase() == null) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setMessage(
          BaseMessages.getString(PKG, "GetTableNamesDialog.InvalidConnection.DialogMessage"));
      mb.setText(BaseMessages.getString(PKG, "GetTableNamesDialog.InvalidConnection.DialogTitle"));
      mb.open();
      return;
    }
    if (!checkUserInput(oneMeta)) return;

    TransMeta previewMeta =
        TransPreviewFactory.generatePreviewTransformation(transMeta, oneMeta, wStepname.getText());

    EnterNumberDialog numberDialog =
        new EnterNumberDialog(
            shell,
            props.getDefaultPreviewSize(),
            BaseMessages.getString(PKG, "GetTableNamesDialog.PreviewSize.DialogTitle"),
            BaseMessages.getString(PKG, "GetTableNamesDialog.PreviewSize.DialogMessage"));
    int previewSize = numberDialog.open();
    if (previewSize > 0) {
      TransPreviewProgressDialog progressDialog =
          new TransPreviewProgressDialog(
              shell, previewMeta, new String[] {wStepname.getText()}, new int[] {previewSize});
      progressDialog.open();

      if (!progressDialog.isCancelled()) {
        Trans trans = progressDialog.getTrans();
        String loggingText = progressDialog.getLoggingText();

        if (trans.getResult() != null && trans.getResult().getNrErrors() > 0) {
          EnterTextDialog etd =
              new EnterTextDialog(
                  shell,
                  BaseMessages.getString(PKG, "System.Dialog.Error.Title"),
                  BaseMessages.getString(PKG, "GetTableNamesDialog.ErrorInPreview.DialogMessage"),
                  loggingText,
                  true);
          etd.setReadOnly();
          etd.open();
        }

        PreviewRowsDialog prd =
            new PreviewRowsDialog(
                shell,
                transMeta,
                SWT.NONE,
                wStepname.getText(),
                progressDialog.getPreviewRowsMeta(wStepname.getText()),
                progressDialog.getPreviewRows(wStepname.getText()),
                loggingText);
        prd.open();
      }
    }
  }
 @Subscribe
 public void showError(ApplicationError error) {
   error.getThrowable().printStackTrace();
   MessageBox box = new MessageBox(Display.getDefault().getActiveShell(), SWT.ICON_ERROR);
   box.setMessage(error.getMessage());
   box.setText(resourceBundle.getString("mainForm.error"));
   box.open();
 }
Example #24
0
 private static int messageBox(Shell shell, String title, int uiProps, String message) {
   MessageBox mb = new MessageBox(shell, uiProps);
   if (title != null && title.length() > 0) {
     mb.setText(title);
   }
   mb.setMessage(String.valueOf(message));
   return mb.open();
 }
Example #25
0
  public static void main(String[] args) {
    Display display = Display.getDefault();
    final Shell shell = new Shell(display, SWT.TITLE | SWT.CLOSE);
    shell.setText(TITLE);

    final String C10T_PATH = System.getenv("C10T_PATH");

    final C10tGraphicalInterface gui = new C10tGraphicalInterface(display, shell);
    final DetachedProcess detachedProcess = new C10tDetachedProcess(gui);
    final CommandExecutioner executioner =
        new CommandExecutioner("c10t", detachedProcess, C10T_PATH);

    gui.addRenderButtonListener(new RenderSelection(shell, gui, executioner));

    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 3;
    gridLayout.marginBottom = 8;
    gridLayout.marginTop = 8;
    gridLayout.marginLeft = 8;
    gridLayout.marginRight = 8;

    shell.setLayout(gridLayout);
    shell.pack();
    shell.open();

    shell.setSize(500, shell.getSize().y);

    try {
      executioner.findCommand();
    } catch (CommandNotFoundException e) {
      MessageBox messageBox = new MessageBox(shell, SWT.ERROR);
      messageBox.setText("c10t - Command could not be found");
      messageBox.setMessage(
          "The program `"
              + executioner.getName()
              + "' could not be located anywhere in your PATH or in the current working directory\n\n"
              + "You must be fixed this by doing one of the following:\n\n"
              + " 1) Install the command `"
              + executioner.getName()
              + "' to somewhere in your PATH or the working directory of this program `"
              + System.getProperty("user.dir")
              + "'\n"
              + " 2) Specify where the command is with the environment variable `C10T_PATH'\n\n"
              + "Your PATH is: "
              + System.getenv("PATH"));
      messageBox.open();
    }

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }

    if (!display.isDisposed()) {
      display.dispose();
    }
  }
Example #26
0
  /* (non-Javadoc)
   * @see view.ServerView#stopRunning()
   */
  public void stopRunning() {
    MessageBox popMsg = new MessageBox(shell, SWT.ICON_INFORMATION);
    popMsg.setText("info!");
    popMsg.setMessage("A successful exit");
    popMsg.open();

    shell.close();
    display.close();
  }
Example #27
0
 private void deleteSelectedKey() {
   MessageBox mb = new MessageBox(getShell(), SWT.YES | SWT.NO);
   mb.setText("Удаление ключа");
   mb.setMessage("Вы уверены?");
   if (SWT.YES == mb.open()) {
     selectedSetData.deleteKey(selectedKeyData);
     tableKey.deleteCurrent();
   }
 }
 // package-local visibility for testing purposes
 void showAlreadyExistsMessage() {
   MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
   mb.setMessage(
       BaseMessages.getString(
           PKG, "RepositoryExplorerDialog.Connection.Create.AlreadyExists.Message"));
   mb.setText(
       BaseMessages.getString(
           PKG, "RepositoryExplorerDialog.Connection.Create.AlreadyExists.Title"));
   mb.open();
 }
Example #29
0
 private void displayError(String text) {
   MessageBox messageDialog =
       new MessageBox(parentComposite.getShell(), SWT.ICON_WARNING | SWT.OK);
   messageDialog.setText("Error");
   if (text == null) {
     text = "Unexpected error occurred";
   }
   messageDialog.setMessage(text);
   messageDialog.open();
 }
  private void ok() {
    if (Utils.isEmpty(wStepname.getText())) {
      return;
    }

    input.setMainStreamField(wMainStreamField.getText());
    input.setLookupField(wLookupField.getText());

    input.setAlgorithmType(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText()));
    input.setCaseSensitive(wcaseSensitive.getSelection());
    input.setGetCloserValue(wgetCloserValue.getSelection());
    input.setMaximalValue(wmaxValue.getText());
    input.setMinimalValue(wminValue.getText());

    input.setOutputMatchField(wmatchField.getText());
    input.setOutputValueField(wvalueField.getText());
    input.setSeparator(wseparator.getText());

    int nrvalues = wReturn.nrNonEmpty();
    input.allocate(nrvalues);
    if (isDebug()) {
      logDebug(BaseMessages.getString(PKG, "FuzzyMatchDialog.Log.FoundFields", nrvalues + ""));
    }
    // CHECKSTYLE:Indentation:OFF
    for (int i = 0; i < nrvalues; i++) {
      TableItem item = wReturn.getNonEmpty(i);
      input.getValue()[i] = item.getText(1);
      input.getValueName()[i] = item.getText(2);
      if (input.getValueName()[i] == null || input.getValueName()[i].length() == 0) {
        input.getValueName()[i] = input.getValue()[i];
      }
    }

    StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get(0);
    infoStream.setStepMeta(transMeta.findStep(wStep.getText()));
    if (infoStream.getStepMeta() == null) {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      if (Utils.isEmpty(wStep.getText())) {
        mb.setMessage(
            BaseMessages.getString(
                PKG, "FuzzyMatchDialog.NotStepSpecified.DialogMessage", wStep.getText()));
      } else {
        mb.setMessage(
            BaseMessages.getString(
                PKG, "FuzzyMatchDialog.StepCanNotFound.DialogMessage", wStep.getText()));
      }

      mb.setText(BaseMessages.getString(PKG, "FuzzyMatchDialog.StepCanNotFound.DialogTitle"));
      mb.open();
    }

    stepname = wStepname.getText(); // return value

    dispose();
  }