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:com.microsoft.tfs.client.common.ui.dialogs.vc.checkinpolicies.PolicyScopeDialog.java

License:Open Source License

@Override
protected void hookCustomButtonPressed(final int buttonId) {
    if (buttonId == IDialogConstants.HELP_ID) {
        final String text = Messages.getString("PolicyScopeDialog.CheckInPolicyRegexDialogText"); //$NON-NLS-1$

        final MessageDialog dialog = new MessageDialog(getShell(),
                Messages.getString("PolicyScopeDialog.CheckInPolicyRegexDialogTitle"), //$NON-NLS-1$
                null, text, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0);

        dialog.open();// w  w w . ja v  a  2 s  .  c  o m
    }
}

From source file:com.motorola.studio.android.common.utilities.EclipseUtils.java

License:Apache License

/**
 * Shows an information dialog/*  w  w w  .j a v  a 2  s  .  c  o  m*/
 * @param dialogTitle
 *            The dialog title
 * @param dialogMessage
 *            The dialog message
 * @param buttonLabels
 *            The labels to be displayed as buttons in the dialog, or
 *            <code>null</code> to have only an "OK" button.
 * 
 * @return The code of the button pressed by the user
 */
public static int showInformationDialog(String dialogTitle, String dialogMessage, String[] buttonLabels) {
    return showInformationDialog(dialogTitle, dialogMessage, null, buttonLabels, MessageDialog.INFORMATION);
}

From source file:com.motorola.studio.android.common.utilities.EclipseUtils.java

License:Apache License

/**
 * Shows an information dialog/*from   ww w.  j  ava2  s.  c  o  m*/
 * @param dialogTitle
 *            The dialog title
 * @param dialogMessage
 *            The dialog message
 * @param detailsMessage
 *            The details message
 * @param buttonLabels
 *            The labels to be displayed as buttons in the dialog, or
 *            <code>null</code> to have only an "OK" button.
 * @param dialogImageType
 *            The image to be displayed right before the dialogMessage
 * 
 * @return The code of the button pressed by the user
 */
public static int showInformationDialogWithDetails(String dialogTitle, String dialogMessage,
        String detailsMessage, String[] buttonLabels) {
    return showInformationDialog(dialogTitle, dialogMessage, detailsMessage, buttonLabels,
            MessageDialog.INFORMATION);
}

From source file:com.nokia.carbide.cpp.internal.project.ui.editors.common.CarbideFormEditor.java

License:Open Source License

/**
 * If the file has been deleted, and the editor is dirty,
 * offer to save the file or close the editor.
 *///from  ww  w  .j ava  2s .c o  m
protected void handleResourceDeleted() {
    // offer user the choice of saving the file or closing the editor
    boolean doSaveAs = false;
    if (isDirty()) {
        MessageDialog dialog = new MessageDialog(getSite().getShell(),
                Messages.CarbideFormEditor_saveResourceTitle, null,
                Messages.CarbideFormEditor_saveResourceMessage, MessageDialog.INFORMATION,
                new String[] { Messages.CarbideFormEditor_saveResourceLabel, IDialogConstants.CLOSE_LABEL }, 0);
        if (dialog.open() == 0) {
            doSaveAs = true;
            resourceDeleted = false;
        }
    }

    // save the file or close the editor at the next reasonable opportunity
    final boolean saveAs = doSaveAs;
    Display.getDefault().asyncExec(new Runnable() {
        public void run() {
            if (saveAs)
                doSaveAs();
            else
                getSite().getPage().closeEditor(CarbideFormEditor.this, false);
        }
    });
}

From source file:com.nokia.cpp.internal.api.utils.ui.QueryWithBooleanPrefDialog.java

License:Open Source License

/**
 * Create the dialog// w w  w. j  a va 2s  .c om
 * @param parentShell parent of the dialog, null for default
 * @param title the dialog title, required
 * @param prompt the prompt text, required
 * @param plugin the plugin owning the preference, required
 * @param prefName the name of the boolean preference, required
 * @param valueToSkipDialog the boolean preference value which corresponds to
 * skipping the dialog.
 */
public QueryWithBooleanPrefDialog(Shell parentShell, String title, String prompt, AbstractUIPlugin plugin,
        String prefName, boolean valueToSkipDialog) {
    preferences = plugin.getPreferenceStore();
    dialog = new MessageDialogWithToggle(parentShell, title, null, prompt, MessageDialog.INFORMATION,
            new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0, null,
            preferences.getBoolean(prefName) == valueToSkipDialog);
    this.prefName = prefName;
    this.valueToSkipDialog = valueToSkipDialog;
}

From source file:com.nokia.s60ct.quickfixers.QuickFixPopupDialog.java

License:Open Source License

public QuickFixPopupDialog(Shell parentShell, IMarker[] markers) {
    super(parentShell, "Quick fixes availeble", null,
            "Validation errors/warnings have quick fixes available.\nSelect items that you want to fix automatically.",
            MessageDialog.INFORMATION, new String[] { "Fix", IDialogConstants.CANCEL_LABEL }, 0);
    this.markers = markers;
    checkedElements = markers;/*from  w w w  .j  a  v a 2s .co m*/

}

From source file:com.salesforce.ide.core.internal.utils.DialogUtils.java

License:Open Source License

public int closeMessage(String title, String message) {
    MessageDialog dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.INFORMATION,
            new String[] { IDialogConstants.CLOSE_LABEL }, IDialogConstants.CLOSE_ID);
    return dialog.open();
}

From source file:com.salesforce.ide.ui.actions.RefreshResourceActionController.java

License:Open Source License

protected void handleSourceComponentFolderRefresh(IProgressMonitor monitor)
        throws InterruptedException, ForceConnectionException, ForceRemoteException, FactoryException,
        CoreException, IOException, InvocationTargetException, ServiceException, Exception {
    monitorCheck(monitor);// w  w w  .j  av  a 2  s  . co m
    List<IResource> folders = getProjectService().getResourcesByType(selectedResources, IResource.FOLDER);
    List<String> componentTypes = new ArrayList<String>();
    if (Utils.isNotEmpty(folders)) {
        for (IResource folder : folders) {
            if (getProjectService().isComponentFolder(folder)) {
                Component component = getComponentFactory().getComponentByFolderName(folder.getName());
                componentTypes.add(component.getComponentType());
            } else if (getProjectService().isSubComponentFolder(folder)) {
                Component component = getComponentFactory().getComponentFromSubFolder((IFolder) folder, false);
                componentTypes.add(component.getSecondaryComponentType());
            }
            // reference package folders is handled in methods specific for reference packages.
        }

        if (Utils.isNotEmpty(componentTypes)) {
            // Bug #206315: In package project, prompt user that refresh on component folder is not support, and
            // either cancel or refresh from src.
            Package packageManifest = getPackageManifestFactory().getPackageManifest(getProject());
            if (Utils.isEmpty(packageManifest)) {
                throw new FactoryException(Messages.getString(
                        "Retrieve.PackageProject.RefreshComponentFolder.MissPackageManifest.Exception.message",
                        new String[] { getProject().getName() }));
            }
            if (Utils.isNotEmpty(packageManifest.getFullName())) {
                String dialogMsg = Messages
                        .getString("Retrieve.PackageProject.RefreshComponentFolder.Dialog.message");
                MessageDialogRunnable messageDialogRunnable = new MessageDialogRunnable("Refresh from server",
                        null, dialogMsg, MessageDialog.INFORMATION,
                        new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
                Display.getDefault().syncExec(messageDialogRunnable);

                if (messageDialogRunnable.getAction() == Window.CANCEL) {
                    String cancelMsg = Messages
                            .getString("Retrieve.PackageProject.RefreshComponentFolder.Cancel.message");
                    logger.info(cancelMsg);
                    throw new InterruptedException(cancelMsg);
                }
            }

            // refresh component dirs
            ProjectPackageList projectPackageList = getProjectPackageFactory()
                    .getProjectPackageListInstance(project);

            // only save these types
            String[] saveComponentTypes = componentTypes.toArray(new String[componentTypes.size()]);

            // perform retrieve
            RetrieveResultExt retrieveResultHandler = null;
            try {
                retrieveResultHandler = getServiceLocator().getPackageRetrieveService()
                        .retrieveSelective(projectPackageList, saveComponentTypes, monitor);
            } catch (ServiceTimeoutException ex) {
                retrieveResultHandler = getServiceLocator().getPackageRetrieveService()
                        .handleRetrieveServiceTimeoutException(ex, OPERATION, monitor);
            }

            if (retrieveResultHandler == null || !getProjectService().handleRetrieveResult(projectPackageList,
                    retrieveResultHandler, true, saveComponentTypes, monitor)) {
                logger.warn("Unable to refresh component folders");
                failRefreshResult();
            }
        }
    }
}

From source file:com.salesforce.ide.ui.dialogs.HyperLinkMessageDialog.java

License:Open Source License

/**
 * Convenience method to open a standard information dialog.
 * //from ww  w.  j av  a  2  s.  c  om
 * @param parent
 *            the parent shell of the dialog, or <code>null</code> if none
 * @param title
 *            the dialog's title, or <code>null</code> if none
 * @param message
 *            the message
 */
public static void openInformation(Shell parent, String title, String message) {
    HyperLinkMessageDialog dialog = new HyperLinkMessageDialog(parent, title, null, // accept
            // the
            // default
            // window
            // icon
            message, MessageDialog.INFORMATION, new String[] { IDialogConstants.OK_LABEL }, 0);
    // ok is the default
    dialog.open();
    return;
}

From source file:com.salesforce.ide.ui.views.runtest.RunTestsLaunchConfigurationDelegate.java

License:Open Source License

/**
 * Inform user there is an existing Trace Flag.
 * @return False if abort, true if continue
 *///  w w w  .ja va 2 s.c o m
@VisibleForTesting
public boolean confirmExistingTraceFlag() {
    Display display = getDisplay();
    final AtomicInteger choice = new AtomicInteger(0);

    display.syncExec(new Runnable() {
        @Override
        public void run() {
            choice.set(
                    DialogUtils.getInstance().cancelContinueMessage(Messages.LaunchDelegate_ConfirmDialogTitle,
                            Messages.LaunchDelegate_ExistingTraceFlag, MessageDialog.INFORMATION));
        }
    });

    return choice.get() == 1;
}