Example usage for org.eclipse.jface.dialogs MessageDialog INFORMATION

List of usage examples for org.eclipse.jface.dialogs MessageDialog INFORMATION

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs MessageDialog INFORMATION.

Prototype

int INFORMATION

To view the source code for org.eclipse.jface.dialogs MessageDialog INFORMATION.

Click Source Link

Document

Constant for the info image, or a simple dialog with the info image and a single OK button (value 2).

Usage

From source file:org.eclipse.e4.xwt.tools.ui.designer.editor.actions.OpenExternalizeStringsAction.java

License:Open Source License

@Override
public void run() {
    TextValueModel textValueEntrys = getTextValue();
    if (textValueEntrys.elements().length == 0) {
        String dialogMessage = "No Strings to externalize found in file.";
        String[] dialogButtonLabels = { "Ok" };
        MessageDialog messageDialog = new MessageDialog(
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Externalize Strings", null,
                dialogMessage, MessageDialog.INFORMATION, dialogButtonLabels, 0);
        messageDialog.open();/*from ww w .  j av  a 2 s.  co m*/
    } else {
        ExternalizeStringsWizard wizard = new ExternalizeStringsWizard(textValueEntrys, designer);
        wizard.init(PlatformUI.getWorkbench(), null);
        WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                wizard);
        dialog.open();
    }
}

From source file:org.eclipse.e4.xwt.tools.ui.designer.properties.tabbed.sections.TextSection.java

License:Open Source License

private void externalizeText() {
    if (getValue() != null) {
        XWTDesigner designer = (XWTDesigner) getPart();
        TextValueModel textValueEntrys = new TextValueModel();
        textValueEntrys.add(new TextValueEntry(textWidget.getText(), "" + 0));
        ExternalizeStringsWizard wizard = new ExternalizeStringsWizard(textValueEntrys, designer);
        wizard.init(PlatformUI.getWorkbench(), null);
        WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                wizard);/*from www.j a  v  a 2  s  . co m*/
        dialog.open();
    } else {
        String dialogMessage = "No Strings to externalize found.";
        String[] dialogButtonLabels = { "Ok" };
        MessageDialog messageDialog = new MessageDialog(
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Externalize Strings", null,
                dialogMessage, MessageDialog.INFORMATION, dialogButtonLabels, 0);
        messageDialog.open();
    }

}

From source file:org.eclipse.ease.discovery.ui.internal.common.DiscoveryUiUtil.java

License:Open Source License

public static void displayStatus(Shell shell, final String title, final IStatus status,
        boolean showLinkToErrorLog) {

    String message = status.getMessage();

    if (showLinkToErrorLog) {
        message += "  \n see error log";
    }//from  w  w  w .j ava2 s .  co m
    switch (status.getSeverity()) {
    case IStatus.CANCEL:
    case IStatus.INFO:
        createDialog(shell, title, message, MessageDialog.INFORMATION).open();
        break;
    case IStatus.WARNING:
        createDialog(shell, title, message, MessageDialog.WARNING).open();
        break;
    case IStatus.ERROR:
    default:
        createDialog(shell, title, message, MessageDialog.ERROR).open();
        break;
    }

}

From source file:org.eclipse.egit.ui.internal.branch.BranchResultDialog.java

License:Open Source License

/**
 * @param shell//from  w ww  . j a v a  2s  .  c om
 * @param repository
 * @param result
 * @param target
 */
private BranchResultDialog(Shell shell, Repository repository, CheckoutResult result, String target) {
    super(shell, UIText.BranchResultDialog_CheckoutConflictsTitle, INFO,
            NLS.bind(UIText.BranchResultDialog_CheckoutConflictsMessage, Repository.shortenRefName(target)),
            MessageDialog.INFORMATION, new String[] {}, -1);
    setShellStyle(getShellStyle() | SWT.SHELL_TRIM);
    this.repository = repository;
    this.result = result;
}

From source file:org.eclipse.egit.ui.internal.dialogs.CheckoutConflictDialog.java

License:Open Source License

/**
 * @param shell//from w w w.j ava 2  s.c om
 * @param repository
 * @param conflicts
 */
public CheckoutConflictDialog(Shell shell, Repository repository, List<String> conflicts) {
    super(shell, UIText.BranchResultDialog_CheckoutConflictsTitle, INFO,
            UIText.CheckoutConflictDialog_conflictMessage, MessageDialog.INFORMATION,
            new String[] { IDialogConstants.OK_LABEL }, 0);
    setShellStyle(getShellStyle() | SWT.SHELL_TRIM);
    this.repository = repository;
    this.conflicts = conflicts;
}

From source file:org.eclipse.egit.ui.internal.dialogs.NonDeletedFilesDialog.java

License:Open Source License

/**
 * @param shell//from   w  w  w . j  a v  a 2s . c om
 * @param repository
 * @param filePaths
 */
public NonDeletedFilesDialog(Shell shell, Repository repository, List<String> filePaths) {
    super(shell, UIText.NonDeletedFilesDialog_NonDeletedFilesTitle, INFO,
            UIText.NonDeletedFilesDialog_NonDeletedFilesMessage, MessageDialog.INFORMATION,
            new String[] { IDialogConstants.OK_LABEL }, 0);
    setShellStyle(getShellStyle() | SWT.SHELL_TRIM);
    this.repository = repository;
    this.filePaths = filePaths;
}

From source file:org.eclipse.egit.ui.internal.rebase.RebaseResultDialog.java

License:Open Source License

/**
 * @param shell//from  www  .j av  a  2  s  . c o m
 * @param repository
 * @param result
 */
private RebaseResultDialog(Shell shell, Repository repository, RebaseResult result) {
    super(shell, UIText.RebaseResultDialog_DialogTitle, INFO,
            NLS.bind(UIText.RebaseResultDialog_StatusLabel, result.getStatus().name()),
            MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0);
    setShellStyle(getShellStyle() | SWT.SHELL_TRIM);
    this.repo = repository;
    this.result = result;
}

From source file:org.eclipse.egit.ui.internal.repository.tree.command.RemoveCommand.java

License:Open Source License

@SuppressWarnings("boxing")
private boolean confirmProjectDeletion(List<IProject> projectsToDelete, ExecutionEvent event)
        throws OperationCanceledException {

    String message = NLS.bind(UIText.RepositoriesView_ConfirmProjectDeletion_Question, projectsToDelete.size());
    MessageDialog dlg = new MessageDialog(getShell(event),
            UIText.RepositoriesView_ConfirmProjectDeletion_WindowTitle, null, message,
            MessageDialog.INFORMATION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL,
                    IDialogConstants.CANCEL_LABEL },
            0);/*from w ww . j ava2s.c  o  m*/
    int index = dlg.open();
    if (index == 2)
        throw new OperationCanceledException();

    return index == 0;
}

From source file:org.eclipse.emf.compare.mpatch.extension.MPatchApplicationResult.java

License:Open Source License

/**
 * Show a dialog with some user friendly version of the application results.
 * // w w w  .  j  a  v a 2  s.c  o  m
 * @param shell
 *            The shell.
 * @param adapterFactory
 *            An adapter factory for some formatting ;-)
 */
public void showDialog(Shell shell, AdapterFactory adapterFactory) {
    final String msg = getMessage(adapterFactory);
    final int messageDialogType;

    // overall result
    if (ApplicationStatus.SUCCESSFUL.equals(status)) {
        messageDialogType = MessageDialog.INFORMATION;
    } else if (ApplicationStatus.REFERENCES.equals(status)) {
        messageDialogType = MessageDialog.WARNING;
    } else if (ApplicationStatus.FAILURE.equals(status)) {
        messageDialogType = MessageDialog.ERROR;
    } else {
        throw new IllegalStateException("Unknown result status!");
    }

    // show the actual dialog
    MessageDialog.open(messageDialogType, shell, MPatchConstants.MPATCH_SHORT_NAME + " Application results",
            msg, SWT.NONE);
}

From source file:org.eclipse.gyrex.admin.ui.internal.widgets.NonBlockingMessageDialogs.java

License:Open Source License

private static String[] getButtonLabels(final int kind) {
    String[] dialogButtonLabels;//from   ww  w  .  ja  v  a2 s  . c o  m
    switch (kind) {
    case MessageDialog.ERROR:
    case MessageDialog.INFORMATION:
    case MessageDialog.WARNING: {
        dialogButtonLabels = new String[] { IDialogConstants.get().OK_LABEL };
        break;
    }
    case MessageDialog.CONFIRM: {
        dialogButtonLabels = new String[] { IDialogConstants.get().OK_LABEL,
                IDialogConstants.get().CANCEL_LABEL };
        break;
    }
    case MessageDialog.QUESTION: {
        dialogButtonLabels = new String[] { IDialogConstants.get().YES_LABEL, IDialogConstants.get().NO_LABEL };
        break;
    }
    case MessageDialog.QUESTION_WITH_CANCEL: {
        dialogButtonLabels = new String[] { IDialogConstants.get().YES_LABEL, IDialogConstants.get().NO_LABEL,
                IDialogConstants.get().CANCEL_LABEL };
        break;
    }
    default: {
        throw new IllegalArgumentException("Illegal value for kind in MessageDialog.open()");
    }
    }
    return dialogButtonLabels;
}