Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.MessageDialog


                        categoriesComposite.getShell();

                // Create the confirmation dialog for the policy deletion.
                // The Yes button is at index 0 and has focus. There is no
                // image.
                final MessageDialog dialog = new MessageDialog(
                        shell,
                        POLICY_DELETION_DIALOG_TITLE,
                        null,
                        dialogMessage,
                        MessageDialog.INFORMATION, new String[]{
                            POLICY_DELETION_DIALOG_YES_TEXT,
                            POLICY_DELETION_DIALOG_NO_TEXT},
                        0);
                // Open the dialog.
                dialog.open();

                // Only delete the policy if the user has confirmed the action
                // by pressing the Yes button at index 0.
                if (dialog.getReturnCode() == 0) {
                    // Delete takes a while so use a BusyIndicator.
                    BusyIndicator.showWhile(shell.getDisplay(),
                            new Runnable() {
                                public void run() {
                                    // BusyIndicator should display a busy
View Full Code Here


      if(element!=null)
        element.attribute("password").setText(password.getText());
      else{
        Node n = rootElement.selectSingleNode("//user[@username='"+uname.getText()+"']");
        if(n!=null){
          MessageDialog dlg = new MessageDialog(window,"Duplicate user",
                              null,
                              "You're trying to create a user who already exists!",
                              SWT.ICON_ERROR,
                              new String[]{"OK"},
                              0);
          dlg.open();
          return;
        }
        rootElement.addElement("user").addAttribute("username", uname.getText()).addAttribute("password", password.getText());
      }
      result = true;
View Full Code Here

     *      the message
     */
    public static void reportError( String message )
    {

        MessageDialog dialog = new MessageDialog( ApacheDsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow()
            .getShell(), "Error!", null, message, MessageDialog.ERROR, new String[]
            { IDialogConstants.OK_LABEL }, MessageDialog.OK );
        dialog.open();
    }
View Full Code Here

  private boolean revertToLastValid(String msg, String msgDetails) {
    String[] buttonLabels = new String[2];
    buttonLabels[0] = Messages.getString("MultiPageEditor.revertToLastValid"); //$NON-NLS-1$
    buttonLabels[1] = Messages.getString("MultiPageEditor.EditExisting"); //$NON-NLS-1$
    MessageDialog dialog = new MessageDialog(getEditorSite().getShell(), msg, null, msgDetails,
            MessageDialog.WARNING, buttonLabels, 0);
    dialog.open();
    // next line depends on return code for button 1 (which is 1)
    // and CANCEL code both being == 1
    return dialog.getReturnCode() == 0;
  }
View Full Code Here

  private boolean revertToLastValid(String msg, String msgDetails) {
    String[] buttonLabels = new String[2];
    buttonLabels[0] = Messages.getString("MultiPageEditor.revertToLastValid"); //$NON-NLS-1$
    buttonLabels[1] = Messages.getString("MultiPageEditor.EditExisting"); //$NON-NLS-1$
    MessageDialog dialog = new MessageDialog(getEditorSite().getShell(), msg, null, msgDetails,
            MessageDialog.WARNING, buttonLabels, 0);
    dialog.open();
    // next line depends on return code for button 1 (which is 1)
    // and CANCEL code both being == 1
    return dialog.getReturnCode() == 0;
  }
View Full Code Here

      }

      // Check whether file exists and if so, confirm overwrite
      final File localFile = new File(path);
      if(localFile.exists()) {
        MessageDialog overwriteDialog = new MessageDialog(shell, "Save As", null, path +
            " already exists.\nDo you want to replace it?", MessageDialog.WARNING, new String[] {
            IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 1); // 'No' is the default
        if(overwriteDialog.open() != Window.OK) {
          if(progressMonitor != null) {
            progressMonitor.setCanceled(true);
            return;
          }
        }
View Full Code Here

    }
    Runnable runnable = new Runnable() {

      public void run() {
        Shell activeShell = Display.getCurrent().getActiveShell();
        MessageDialog dialog = new MessageDialog(
            activeShell,
            "Sorry, your trial expired",
            null,
            "Your trial is expired, please visit <a>http://appwrench.onpositive.com/buy</a> and purchase license to AppWrench",
            MessageDialog.ERROR,
            new String[] { IDialogConstants.OK_LABEL }, 0) {

          protected Control createMessageArea(Composite composite) {
            Image image = getImage();
            if (image != null) {
              imageLabel = new Label(composite, SWT.NULL);
              image.setBackground(imageLabel.getBackground());
              imageLabel.setImage(image);
              GridDataFactory.fillDefaults().align(SWT.CENTER,
                  SWT.BEGINNING).applyTo(imageLabel);
            }
            // create message
            if (message != null) {
              Link link = new Link(composite,
                  getMessageLabelStyle());
              link.setText(message);
              GridDataFactory
                  .fillDefaults()
                  .align(SWT.FILL, SWT.BEGINNING)
                  .grab(true, false)
                  .hint(
                      convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
                      SWT.DEFAULT).applyTo(link);
              link.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(
                    org.eclipse.swt.events.SelectionEvent e) {
                  try {
                    PlatformUI
                        .getWorkbench()
                        .getBrowserSupport()
                        .getExternalBrowser()
                        .openURL(
                            new URL(
                                "http://appwrench.onpositive.com/buy/"));
                  } catch (PartInitException e1) {
                    Activator.log(e1);
                  } catch (MalformedURLException e1) {
                    Activator.log(e1);
                  }

                };
              });
            }
            return composite;
          }

        };
        dialog.open();
      }
    };
    if (Display.getCurrent() != null) {
      runnable.run();
    } else {
View Full Code Here

  private static void showError() {
    Runnable runnable = new Runnable() {

      public void run() {
        Shell activeShell = Display.getCurrent().getActiveShell();
        MessageDialog dialog = new MessageDialog(
            activeShell,
            "Beta expired",
            null,
            "Beta is expired,please visit <a>http://appwrench.onpositive.com</a> and install production version of the AppWrench",
            MessageDialog.ERROR,
            new String[] { IDialogConstants.OK_LABEL }, 0) {

          protected Control createMessageArea(Composite composite) {
            Image image = getImage();
            if (image != null) {
              imageLabel = new Label(composite, SWT.NULL);
              image.setBackground(imageLabel.getBackground());
              imageLabel.setImage(image);
              GridDataFactory.fillDefaults().align(SWT.CENTER,
                  SWT.BEGINNING).applyTo(imageLabel);
            }
            // create message
            if (message != null) {
              Link link = new Link(composite,
                  getMessageLabelStyle());
              link.setText(message);
              GridDataFactory
                  .fillDefaults()
                  .align(SWT.FILL, SWT.BEGINNING)
                  .grab(true, false)
                  .hint(
                      convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
                      SWT.DEFAULT).applyTo(link);
              link.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(
                    org.eclipse.swt.events.SelectionEvent e) {
                  try {
                    PlatformUI
                        .getWorkbench()
                        .getBrowserSupport()
                        .getExternalBrowser()
                        .openURL(
                            new URL(
                                "http://appwrench.onpositive.com"));
                  } catch (PartInitException e1) {
                    Activator.log(e1);
                  } catch (MalformedURLException e1) {
                    Activator.log(e1);
                  }

                };
              });
            }
            return composite;
          }

        };
        dialog.open();
      }
    };
    if (Display.getCurrent() != null) {
      runnable.run();
    } else {
View Full Code Here

     *            the dialog message
     * @return
     */
    public static int openErrorMessageDialog(Shell shell, String dialogTitle,
        String dialogMessage) {
        MessageDialog md = new MessageDialog(shell, dialogTitle, null,
            dialogMessage, MessageDialog.ERROR,
            new String[] { IDialogConstants.OK_LABEL }, 0);
        return openWindow(md);
    }
View Full Code Here

     *            the dialog message
     * @return
     */
    public static int openInformationMessageDialog(Shell shell,
        String dialogTitle, String dialogMessage) {
        MessageDialog md = new MessageDialog(shell, dialogTitle, null,
            dialogMessage, MessageDialog.INFORMATION,
            new String[] { IDialogConstants.OK_LABEL }, 0);
        return openWindow(md);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.MessageDialog

Copyright © 2018 www.massapicom. 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.