Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.MessageDialog.open()


            {
                MessageDialog overwriteDialog = new MessageDialog( shell,
                    Messages.getString( "LdifEditor.Overwrite" ), null, Messages.getString( "OverwriteQuestion" ), //$NON-NLS-1$ //$NON-NLS-2$
                    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


    Workbench.getInstance().getDisplay().syncExec(new Runnable() {
      public void run() {
        MessageDialog dialog = new MessageDialog(part.getSite().getShell(), part.getEditorInput().getName(),
            null, message, MessageDialog.QUESTION, new String[] { IDialogConstants.OK_LABEL,
                            discardButton, IDialogConstants.CANCEL_LABEL }, 0); // yes is the default
            answer[0] = dialog.open();
    }});
    switch (answer[0]) {
    case 0:
      return Status.OK_STATUS;
    case 1:
View Full Code Here

                IDialogConstants.CANCEL_LABEL };
        MessageDialog d = new MessageDialog(page.getWorkbenchWindow().getShell(),
                WorkbenchMessages.SavePerspective_overwriteTitle,
                null, WorkbenchMessages.SavePerspective_singletonQuestion,
                MessageDialog.QUESTION, buttons, 0);
        if (d.open() == 0) {
            page.savePerspective();
        }
    }

    /**
 
View Full Code Here

        PreferencesMessages.Question, (Image) null, message,
        MessageDialog.NONE, new String[] { IDialogConstants.YES_LABEL,
            IDialogConstants.NO_LABEL }, 0);
    // ensure yes is the default

    return dialog.open() == 0;
  }

  /**
   * If the target for export does not exist then attempt to create it. Answer
   * a boolean indicating whether the target exists (ie.- if it either
View Full Code Here

    String[] response = new String[] { YES, ALL, NO, NO_ALL, CANCEL };
    // run in syncExec because callback is from an operation,
    // which is probably not running in the UI thread.
    getControl().getDisplay().syncExec(new Runnable() {
      public void run() {
        dialog.open();
      }
    });
    return dialog.getReturnCode() < 0 ? CANCEL : response[dialog
        .getReturnCode()];
  }
View Full Code Here

      String message = NLS.bind(warning, new Object[] { status.getMessage(), operation.getLabel() });
      String[] buttons = new String[] { IDialogConstants.YES_LABEL,
          IDialogConstants.NO_LABEL };
      MessageDialog dialog = new MessageDialog(shell, title, null,
          message, MessageDialog.WARNING, buttons, 0);
      int dialogAnswer = dialog.open();
      // The user has been given the specific status and has chosen
      // to proceed or to cancel. The user choice determines what
      // the status should be at this point, OK or CANCEL.
      if (dialogAnswer == Window.OK) {
        reportedStatus = Status.OK_STATUS;
View Full Code Here

          .getLabel());

      MessageDialog dialog = new MessageDialog(shell, title, null,
          message, MessageDialog.WARNING,
          new String[] { IDialogConstants.OK_LABEL }, 0); // ok
      dialog.open();
    }

    if (createdShell) {
      shell.dispose();
    }
View Full Code Here

          // Show a dialog.
          String[] buttons = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL };
            MessageDialog d = new MessageDialog(
              window.getShell(), WorkbenchMessages.Save_Resource,
              null, message, MessageDialog.QUESTION, buttons, 0);
          choice = d.open();
        }
      }

      // Branch on the user choice.
      // The choice id is based on the order of button labels above.
View Full Code Here

    {
        MessageDialog dialog = new MessageDialog( partRef.getPart( false ).getSite().getShell(), Messages
            .getString( "EntryEditorManager.EntryChanged" ), null, Messages //$NON-NLS-1$
            .getString( "EntryEditorManager.EntryChangedDescription" ), MessageDialog.QUESTION, new String[] //$NON-NLS-1$
            { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0 );
        int result = dialog.open();
        if ( result == 0 )
        {
            // update reference copy and working copy
            updateOscSharedReferenceCopy( originalEntry );
            updateOscSharedWorkingCopy( originalEntry );
View Full Code Here

                MessageDialog dialog = new MessageDialog(
                    getShell(),
                    Messages.getString( "PasswordDialog.PasswordVerification" ), getShell().getImage(), //$NON-NLS-1$
                    Messages.getString( "PasswordDialog.PasswordVerifiedSuccessfully" ), MessageDialog.INFORMATION, new String[] //$NON-NLS-1$
                        { IDialogConstants.OK_LABEL }, 0 );
                dialog.open();
            }
            else
            {
                MessageDialog dialog = new MessageDialog(
                    getShell(),
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.