Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.MessageDialog


     * @param message
     *      the message
     */
    public static void openInformationDialog( String title, String message )
    {
        MessageDialog dialog = new MessageDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
            title, null, message, MessageDialog.INFORMATION, new String[]
                { IDialogConstants.OK_LABEL }, MessageDialog.OK );
        dialog.open();
    }
View Full Code Here


     * @param message
     *      the message
     */
    public static void openWarningDialog( String title, String message )
    {
        MessageDialog dialog = new MessageDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
            title, null, message, MessageDialog.WARNING, new String[]
                { IDialogConstants.OK_LABEL }, MessageDialog.OK );
        dialog.open();
    }
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

    final Shell parent = EclEmmaUIPlugin.getInstance().getShell();
    String title = UIMessages.NoInstrumentedClassesError_title;
    String message = UIMessages.NoInstrumentedClassesError_message;

    MessageDialog d = new MessageDialog(parent, title, null, message, MessageDialog.ERROR,
        new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0);
    if (d.open() == 0) {
      parent.getDisplay().asyncExec(new Runnable() {
        public void run() {
          DebugUITools.openLaunchConfigurationDialogOnGroup(parent,
              new StructuredSelection(source), EclEmmaUIPlugin.ID_COVERAGE_LAUNCH_GROUP);
        }
View Full Code Here

     */
    protected void run(IWorkbenchPage page, IPerspectiveDescriptor persp) {
        String message = NLS.bind(WorkbenchMessages.ResetPerspective_message, persp.getLabel() );
        String[] buttons = new String[] { IDialogConstants.OK_LABEL,
                IDialogConstants.CANCEL_LABEL };
        MessageDialog d = new MessageDialog(getWindow().getShell(),
                WorkbenchMessages.ResetPerspective_title,
                null, message, MessageDialog.QUESTION, buttons, 0);
        if (d.open() == 0) {
      page.resetPerspective();
    }
    }
View Full Code Here

        if (persp != null) {
            // Confirm ok to overwrite
            String message = NLS.bind(WorkbenchMessages.SavePerspective_overwriteQuestion,perspName );
            String[] buttons = new String[] { IDialogConstants.YES_LABEL,
                    IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL };
            MessageDialog d = new MessageDialog(this.getShell(),
                    WorkbenchMessages.SavePerspective_overwriteTitle,
                    null, message, MessageDialog.QUESTION, buttons, 0);

            switch (d.open()) {
            case 0: //yes
                break;
            case 1: //no
                return;
            case 2: //cancel
View Full Code Here

      if (getContainer() instanceof IWorkbenchPreferenceContainer) {
        IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
        UIJob job = new UIJob(WorkbenchMessages.ViewsPreference_restartRequestJobName) {
          public IStatus runInUIThread(IProgressMonitor monitor) {
            // make sure they really want to do this
            int really = new MessageDialog(
                null,
                WorkbenchMessages.ViewsPreference_presentationConfirm_title,
                null,
                WorkbenchMessages.ViewsPreference_presentationConfirm_message,
                MessageDialog.QUESTION,
View Full Code Here

        }

        // don't save if we don't prompt
        int choice = ISaveablePart2.NO;
       
        MessageDialog dialog;
        if (stillOpenElsewhere) {
          String message = NLS
              .bind(
                  WorkbenchMessages.EditorManager_saveChangesOptionallyQuestion,
                  model.getName());
          MessageDialogWithToggle dialogWithToggle = new MessageDialogWithToggle(shellProvider.getShell(),
              WorkbenchMessages.Save_Resource, null, message,
              MessageDialog.QUESTION, buttons, 0, WorkbenchMessages.EditorManager_closeWithoutPromptingOption, false) {
            protected int getShellStyle() {
              return (canCancel ? SWT.CLOSE : SWT.NONE)
                  | SWT.TITLE | SWT.BORDER
                  | SWT.APPLICATION_MODAL
                  | getDefaultOrientation();
            }
          };
          dialog = dialogWithToggle;
        } else {
          String message = NLS
              .bind(
                  WorkbenchMessages.EditorManager_saveChangesQuestion,
                  model.getName());
          dialog = new MessageDialog(shellProvider.getShell(),
              WorkbenchMessages.Save_Resource, null, message,
              MessageDialog.QUESTION, buttons, 0) {
            protected int getShellStyle() {
              return (canCancel ? SWT.CLOSE : SWT.NONE)
                  | SWT.TITLE | SWT.BORDER
                  | SWT.APPLICATION_MODAL
                  | getDefaultOrientation();
            }
          };
        }

        choice = SaveableHelper.testGetAutomatedResponse();
        if (SaveableHelper.testGetAutomatedResponse() == SaveableHelper.USER_RESPONSE) {
          choice = dialog.open();
         
          if(stillOpenElsewhere) {
            // map value of choice back to ISaveablePart2 values
            switch (choice) {
            case IDialogConstants.YES_ID:
View Full Code Here

            if (modelsToSave.size() == 1) {
              Saveable model = (Saveable) modelsToSave.get(0);
        String message = NLS.bind(WorkbenchMessages.EditorManager_saveChangesQuestion, model.getName());
        // Show a dialog.
        String[] buttons = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL };
        MessageDialog d = new MessageDialog(
          shellProvider.getShell(), WorkbenchMessages.Save_Resource,
          null, message, MessageDialog.QUESTION, buttons, 0);
       
        int choice = SaveableHelper.testGetAutomatedResponse();
        if (SaveableHelper.testGetAutomatedResponse() == SaveableHelper.USER_RESPONSE) {
          choice = d.open();
        }

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

        // Validate compatible version format
        // We no longer support the release 1.0 format
        if (VERSION_STRING[0].equals(version)) {
          reader.close();
          String msg = WorkbenchMessages.Workbench_incompatibleSavedStateVersion;
          boolean ignoreSavedState = new MessageDialog(null,
              WorkbenchMessages.Workbench_incompatibleUIState,
              null, msg, MessageDialog.WARNING, new String[] {
                  IDialogConstants.OK_LABEL,
                  IDialogConstants.CANCEL_LABEL }, 0).open() == 0;
          // OK is the default
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.