Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.MessageDialog


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


     *            the dialog message
     * @return true if the user answered with YES
     */
    public static boolean openQuestionMessageDialog(Shell shell,
        String dialogTitle, String dialogMessage) {
        MessageDialog md = new MessageDialog(shell, dialogTitle, null,
            dialogMessage, MessageDialog.QUESTION, new String[] {
                IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0);
        return openWindow(md) == 0;
    }
View Full Code Here

  }
 
  @Override
  public boolean performOk(){
    if(!this.applied){
      MessageDialog confirm = new MessageDialog(this.getShell(),
          "Discard changes?",
          null,
          "There are un-applied changes. Do you want to apply them?",
          MessageDialog.CONFIRM,
          new String[]{"Apply", "Cancel"},
          1);
      int res = confirm.open();
      if(res == 0)
        this.applyChanges();
    }
    return true;
  }
View Full Code Here

  }
 
  @Override
  public boolean performOk(){
    if(!this.applied){
      MessageDialog confirm = new MessageDialog(this.getShell(),
          "Discard changes?",
          null,
          "There are un-applied changes. Do you want to apply them?",
          MessageDialog.CONFIRM,
          new String[]{"Apply", "Cancel"},
          1);
      int res = confirm.open();
      if(res == 0)
        this.applyChanges();
    }
    return true;
  }
View Full Code Here

  }
 
  @Override
  public boolean performOk() {
    if(this.rtcc.changed()){
      MessageDialog confirm = new MessageDialog(this.getShell(),
          "Discard changes?",
          null,
          "There are un-applied changes. Do you want to apply them?",
          MessageDialog.CONFIRM,
          new String[]{"Apply", "Cancel"},
          1);
      int res = confirm.open();
      if(res == 0)
        this.applyChanges();
    }
    return true;
  }
View Full Code Here

  }


  private void promptForRedetectIfNecessary() {
    if (detectionRequested > 0) {
      MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SSEUIMessages.TaskTagPreferenceTab_22, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getImage(), SSEUIMessages.TaskTagPreferenceTab_23, MessageDialog.QUESTION, new String[]{SSEUIMessages.TaskTagPreferenceTab_24, SSEUIMessages.TaskTagPreferenceTab_25, SSEUIMessages.TaskTagPreferenceTab_26}, 2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
      int button = dialog.open();
      if (button == 0) {
        Job redetectJob = new Job(SSEUIMessages.TaskTagPreferenceTab_27) { //$NON-NLS-1$
          public Object getAdapter(Class adapter) {
            return null;
          }
View Full Code Here

   */
  public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex, String checkboxText) {
    if (!isDialogEnabled(id))
      return OptionalMessageDialog.NOT_SHOWN;

    MessageDialog dialog= new OptionalMessageDialog(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex, checkboxText);
    return dialog.open();
  }
View Full Code Here

      getShell().getDisplay().syncExec(new Runnable() {
        public void run() {
          String title = XMLWizardsMessages.ExampleProjectCreationWizard_overwritequery_title;
          String msg = NLS.bind(XMLWizardsMessages.ExampleProjectCreationWizard_overwritequery_message, file);
          String[] options = {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.CANCEL_LABEL};
          MessageDialog dialog = new MessageDialog(getShell(), title, null, msg, MessageDialog.QUESTION, options, 0);
          result[0] = dialog.open();
        }
      });
      return result[0];
    }
View Full Code Here

        String testPassword = this.testPasswordText.getText();
        if ( this.currentPassword != null )
        {
            if ( this.currentPassword.verify( testPassword ) )
            {
                MessageDialog dialog = new MessageDialog( getShell(), "Password Verification", getShell().getImage(),
                    "Password verified sucessfully", MessageDialog.INFORMATION, new String[]
                        { IDialogConstants.OK_LABEL }, 0 );
                dialog.open();
            }
            else
            {
                MessageDialog dialog = new MessageDialog( getShell(), "Password Verification", getShell().getImage(),
                    "Password verification failed", MessageDialog.ERROR, new String[]
                        { IDialogConstants.OK_LABEL }, 0 );
                dialog.open();
            }
        }
    }
View Full Code Here

            // Check whether file exists and if so, confirm overwrite
            final File externalFile = new File( path );
            if ( externalFile.exists() )
            {
                MessageDialog overwriteDialog = new MessageDialog( shell, "Overwrite", null, "Overwrite?",
                    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

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.