Examples of MessageBox


Examples of org.eclipse.swt.widgets.MessageBox

  private class ConfirmDialog {
   
    MessageBox msgBox ;

    public ConfirmDialog(Shell shell, String name, String msg) {
      msgBox = new MessageBox(shell, SWT.ICON_QUESTION | SWT.OK| SWT.CANCEL);
      msgBox.setText(name);
      msgBox.setMessage(msg);
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

    public void handleEvent(Event event) {
      SearchDialog dialog = new SearchDialog(getShell());
      dialog.open();
      if(dialog.getEntity() != null) {
        MessageBox msgBox = new MessageBox(getShell(), SWT.OK);
        msgBox.setText("Search Result:");
        msgBox.setMessage("\n" + dialog.getEntity());
        msgBox.open();
      } else {
        MessageBox msgBox = new MessageBox(getShell(), SWT.OK);
        msgBox.setText("Search Result:");
        msgBox.setMessage("\n" + "CacheEntry does not exist");
        msgBox.open();
      }
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

  }
 
  private class HelpListener implements Listener {

    public void handleEvent(Event event) {
      MessageBox msgBox = new MessageBox(getShell(), SWT.OK);
      msgBox.setText("Help");
      msgBox.setMessage("https://github.com/kylinsoong \n" +
                "https://github.com/kylinsoong/cluster \n" +
                "https://github.com/kylinsoong/CustomizedTools");
      msgBox.open();
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

    wScriptsFolder.addCTabFolder2Listener(new CTabFolder2Adapter() {
      public void close(CTabFolderEvent event) {
        CTabItem cItem = (CTabItem) event.item;
        event.doit = false;
        if (cItem != null && wScriptsFolder.getItemCount() > 1) {
          MessageBox messageBox = new MessageBox(shell, SWT.ICON_QUESTION | SWT.NO | SWT.YES);
          messageBox.setText(BaseMessages.getString(PKG, "RubyStepDialog.DeleteItem.Label"));
          messageBox.setMessage(BaseMessages.getString(PKG, "RubyStepDialog.ConfirmDeleteItem.Label", cItem.getText()));
          switch (messageBox.open()) {
          case SWT.YES:
              event.doit = true;
              input.setChanged();
              changedInDialog = true;
              break;
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

  private boolean cancel() {

    if (changedInDialog) {

      MessageBox box = new MessageBox(shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL);
      box.setText(BaseMessages.getString(PKG, "RubyStepDialog.WarningDialogChanged.Title"));
      box.setMessage(BaseMessages.getString(PKG, "RubyStepDialog.WarningDialogChanged.Message", Const.CR));
      int answer = box.open();

      if (answer == SWT.NO) {
        return false;
      }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

  private void ok() {

    // if there's syntax error, warn the user
    if (!hasRowScript()) {

      MessageBox box = new MessageBox(shell, SWT.YES | SWT.NO | SWT.APPLICATION_MODAL);
      box.setText(BaseMessages.getString(PKG, "RubyStepDialog.WarningDialogNoRowScript.Title"));
      box.setMessage(BaseMessages.getString(PKG, "RubyStepDialog.WarningDialogNoRowScript.Message", Const.CR));
      int answer = box.open();

      if (answer == SWT.NO) {
        return;
      }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

        // make it a prestine transformation
        newOne.setFilename(null);
        newOne.setChanged();

        if (changedInDialog) {
          MessageBox messageBox = new MessageBox(shell, SWT.ICON_QUESTION | SWT.NO | SWT.YES);
          messageBox.setText(BaseMessages.getString(PKG, "RubyStepDialog.OpenedSample.Title"));
          messageBox.setMessage(BaseMessages.getString(PKG, "RubyStepDialog.OpenedSample.Message"));
          if (messageBox.open() == SWT.YES) {
            ok();
          }
        } else {
          cancel();
        }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

        return gd;
    }

    public static MessageBox newMessageBox(final Shell shell, final int style,
            final Procedure1<MessageBox> init) {
        final MessageBox box = new MessageBox(shell);
        init.apply(box);
        return box;
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

        deleteConfigButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (patternsConfigName != null) {
                    final MessageBox messageBox = new MessageBox(parent.getShell(),
                            SWT.ICON_QUESTION | SWT.YES | SWT.NO);
                    messageBox.setMessage("Delete \"" + patternsConfigName + "\"?");
                    messageBox.setText("Delete configuration");
                    if (messageBox.open() == SWT.YES) {
                        ConfigurationManager.removeTPConfig(patternsConfigName);
                        patternsConfigName = null;
                        configNameLabel.setText("");
                    }
                }
            }
        });

        // "Save patterns" button
        saveConfigButton.setToolTipText("Save current pattern set");
        saveConfigButton.setImage(PlatformUI.getWorkbench().getSharedImages()
                .getImage(ISharedImages.IMG_ETOOL_SAVE_EDIT));
        saveConfigButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (patternsConfigName != null) {
                    if (!ConfigurationManager.saveTPConfig(patternsConfigName)) {
                        final MessageBox messageBox = new MessageBox(parent.getShell(),
                                SWT.ICON_ERROR | SWT.OK);
                        messageBox.setMessage("Unable to save configuration: "
                                + patternsConfigName);
                        messageBox.setText("Error");
                        messageBox.open();
                    }
                }
            }
        });

        // "Save patterns as..." button
        saveAsConfigButton.setToolTipText("Save current pattern set as...");
        saveAsConfigButton.setImage(PlatformUI.getWorkbench().getSharedImages()
                .getImage(ISharedImages.IMG_ETOOL_SAVEAS_EDIT));
        saveAsConfigButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final String[] configurations = ConfigurationManager.getTPConfigs();
                final Set<String> existingNames = new HashSet<String>(Arrays
                        .asList(configurations));
                final InputDialog dialog = new ConfigurationSaveAsDialog(parent
                        .getShell(), "Save trace pattern configuration",
                        "Enter name for configuration:", patternsConfigName,
                        existingNames);

                if (dialog.open() == Window.OK) {
                    if (ConfigurationManager.saveTPConfig(dialog.getValue())) {
                        patternsConfigName = dialog.getValue();
                        configNameLabel.setText(patternsConfigName);
                    } else {
                        final MessageBox messageBox = new MessageBox(parent.getShell(),
                                SWT.ICON_ERROR | SWT.OK);
                        messageBox.setMessage("Unable to save configuration: "
                                + dialog.getValue());
                        messageBox.setText("Error");
                        messageBox.open();
                    }
                }
            }
        });
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.MessageBox

        deleteConfigButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (nodesConfigName != null) {
                    final MessageBox messageBox = new MessageBox(parent.getShell(),
                            SWT.ICON_QUESTION | SWT.YES | SWT.NO);
                    messageBox.setMessage("Delete \"" + nodesConfigName + "\"?");
                    messageBox.setText("Delete configuration");
                    if (messageBox.open() == SWT.YES) {
                        ConfigurationManager.removeNodesConfig(nodesConfigName);
                        nodesConfigName = null;
                        configNameLabel.setText("");
                    }
                }
            }
        });

        // "Save nodes configuration" button
        saveConfigButton.setToolTipText("Save current nodes configuration");
        saveConfigButton.setImage(PlatformUI.getWorkbench().getSharedImages()
                .getImage(ISharedImages.IMG_ETOOL_SAVE_EDIT));
        saveConfigButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (nodesConfigName != null) {
                    if (!ConfigurationManager.saveNodesConfig(nodesConfigName)) {
                        final MessageBox messageBox = new MessageBox(parent.getShell(),
                                SWT.ICON_ERROR | SWT.OK);
                        messageBox.setMessage("Unable to save configuration: "
                                + nodesConfigName);
                        messageBox.setText("Error");
                        messageBox.open();
                    }
                }
            }
        });

        // "Save nodes configuration as..." button
        saveAsConfigButton.setToolTipText("Save current nodes configuration as...");
        saveAsConfigButton.setImage(PlatformUI.getWorkbench().getSharedImages()
                .getImage(ISharedImages.IMG_ETOOL_SAVEAS_EDIT));
        saveAsConfigButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(final SelectionEvent e) {
                final String[] configurations = ConfigurationManager.getNodesConfig();
                final Set<String> existingNames = new HashSet<String>(Arrays
                        .asList(configurations));
                final InputDialog dialog = new ConfigurationSaveAsDialog(parent
                        .getShell(), "Save nodes configuration",
                        "Enter name for configuration:", nodesConfigName, existingNames);

                if (dialog.open() == Window.OK) {
                    if (ConfigurationManager.saveNodesConfig(dialog.getValue())) {
                        nodesConfigName = dialog.getValue();
                        configNameLabel.setText(nodesConfigName);
                    } else {
                        final MessageBox messageBox = new MessageBox(parent.getShell(),
                                SWT.ICON_ERROR | SWT.OK);
                        messageBox.setMessage("Unable to save configuration: "
                                + dialog.getValue());
                        messageBox.setText("Error");
                        messageBox.open();
                    }
                }
            }
        });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.