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

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

Introduction

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

Prototype

int INFORMATION

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

Click Source Link

Document

Constant for an info message (value 1).

Usage

From source file:com.agynamix.platform.frontend.dialogs.SimpleInformationViewerDialog.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    Control contents = super.createContents(parent);
    setTitle(title);/*from   w ww. java2  s  . c om*/
    setMessage(headerText, IMessageProvider.INFORMATION);
    text.setText(finalContents);

    return contents;
}

From source file:com.amitinside.mqtt.client.kura.dialog.AboutDialog.java

License:Apache License

@Override
public void create() {
    super.create();
    this.setTitle("About Eclipse Kura MQTT Client Utility");
    this.setMessage("Developed By Amit Kumar Mondal (admin@amitinside.com)", IMessageProvider.INFORMATION);
}

From source file:com.android.ide.eclipse.adt.installer.InstallSdkDialog.java

License:Open Source License

private void validate() {
    setErrorMessage(null);//w  ww.j a  v  a  2  s.  c om
    setMessage(null);
    getButton(OPEN_AVD_MANAGER).setEnabled(false);
    getButton(INSTALL_SDK_ID).setEnabled(false);
    mShowMeButton.setEnabled(true);
    String sdkString = mSdkDirectory.getText();
    if (sdkString.length() == 0) {
        setErrorMessage("Location of SDK is required.");
        return;
    }
    File sdkFile = new File(sdkString);
    if (sdkFile.isFile()) {
        setErrorMessage("The SDK path is invalid.");
        return;
    }
    if (!InstallAndroidSdk.isValidSdk(mSdkDirectory.getText())) {
        setMessage(MESSAGE, IMessageProvider.INFORMATION);
        getButton(INSTALL_SDK_ID).setEnabled(true);

        int enabled = 0;
        int count = 0;
        for (PackageModel model : packageModels) {
            if (!model.isEnabled() && !model.isInstalled() && model.isRequired()) {
                setErrorMessage(model.getPackage().getShortDescription() + " is required.");
                getButton(INSTALL_SDK_ID).setEnabled(false);
                return;
            }
            if (!model.isEnabled() && !model.isInstalled() && model.isRecommended()) {
                setMessage(model.getPackage().getShortDescription() + " is recommended.");
                return;
            }
            if (model.isEnabled()) {
                enabled++;
            }
            count++;
        }
        if (count <= 0) {
            setErrorMessage("There is nothing to install. Please check your internet connection.");
            getButton(INSTALL_SDK_ID).setEnabled(false);
            return;
        }
        if (enabled <= 0) {
            setErrorMessage("There is nothing to install. Please enable required packages.");
            getButton(INSTALL_SDK_ID).setEnabled(false);
            return;
        }
        if (getButton(INSTALL_SDK_ID).isEnabled() && sdkFile.isDirectory()) {
            String[] files = sdkFile.list();
            if (files != null && files.length > 0) {
                setMessage("The '" + sdkString + "' directory isn't empty.");
            }
        }
        return;
    }
    String oldSdkDir = AdtPlugin.getDefault().getPreferenceStore().getString(AdtPrefs.PREFS_SDK_DIR);
    AdtPlugin.getDefault().getPreferenceStore().putValue(AdtPrefs.PREFS_SDK_DIR, sdkString);
    AdtPrefs.getPrefs().loadValues(null /*event*/);
    DdmsPlugin.setToolsLocation(AdtPlugin.getOsAbsoluteAdb(), true /* startAdb */,
            AdtPlugin.getOsAbsoluteHprofConv(), AdtPlugin.getOsAbsoluteTraceview());
    AdtPlugin.getDefault().reparseSdk();
    checkForLoad();
    if (Sdk.getCurrent() != null) {
        getButton(OPEN_AVD_MANAGER).setEnabled(true);
        mShowMeButton.setEnabled(false);
        mDescriptionText.setText(""); //$NON-NLS-1$
        return;
    } else {
        AdtPlugin.getDefault().getPreferenceStore().putValue(AdtPrefs.PREFS_SDK_DIR, oldSdkDir);
    }
}

From source file:com.android.ide.eclipse.adt.internal.build.ConvertSwitchDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    String text = String.format("As of ADT 14, the resource fields (such as %1$s) are no longer constants "
            + "when defined in library projects. This is necessary to make library "
            + "projects reusable without recompiling them.\n" + "\n"
            + "One consequence of this is that you can no longer use the fields directly "
            + "in switch statements. You must use an if-else chain instead.\n" + "\n"
            + "Eclipse can automatically convert from a switch statement to an if-else "
            + "statement. Just place the caret on the switch keyword and invoke "
            + "Quick Fix (Ctrl-1 on Windows and Linux, Cmd-1 on Mac), then select "
            + "\"Convert 'switch' to 'if-else'\".\n" + "\n" + "For more information, see <a href=\"" + URL
            + "\">" + URL + "</a>", mField);

    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new GridLayout(1, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    mLink = new Link(container, SWT.NONE);
    mLink.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1));
    mLink.setText(text);//  www . j  a v  a2s.c o  m
    mLink.addSelectionListener(this);

    setMessage("Non-Constant Expressions: Migration Necessary", IMessageProvider.INFORMATION);

    return area;
}

From source file:com.aptana.formatter.ui.util.StatusUtil.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 *///w w w .  ja v  a 2  s  .  c  o  m
public static void applyToStatusLine(DialogPage page, IStatus status) {
    String message = status.getMessage();
    switch (status.getSeverity()) {
    case IStatus.OK:
        page.setMessage(message, IMessageProvider.NONE);
        page.setErrorMessage(null);
        break;
    case IStatus.WARNING:
        page.setMessage(message, IMessageProvider.WARNING);
        page.setErrorMessage(null);
        break;
    case IStatus.INFO:
        page.setMessage(message, IMessageProvider.INFORMATION);
        page.setErrorMessage(null);
        break;
    default:
        if (message.length() == 0) {
            message = null;
        }
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
}

From source file:com.aptana.ide.installer.wizard.InstallerWizardDialog.java

License:Open Source License

private void updateDoNotShowLayout() {
    if (fDoNotShowButton.getSelection()) {
        setMessage(Messages.InstallerWizardDialog_DoNotShowNote, IMessageProvider.INFORMATION);
    } else {//from  w w  w . j a v a  2 s .  c  om
        setMessage(Messages.PluginsWizardPage_Description);

    }
}

From source file:com.aptana.internal.ui.text.spelling.StatusUtil.java

License:Open Source License

/**
 * Applies the status to the status line of a dialog page.
 * /*from   w  ww .  jav a2 s.co  m*/
 * @param page
 *            the dialog page
 * @param status
 *            the status to apply
 */
public static void applyToStatusLine(DialogPage page, IStatus status) {
    String message = status.getMessage();
    if ((message != null) && (message.length() == 0)) {
        message = null;
    }
    switch (status.getSeverity()) {
    case IStatus.OK:
        page.setMessage(message, IMessageProvider.NONE);
        page.setErrorMessage(null);
        break;
    case IStatus.WARNING:
        page.setMessage(message, IMessageProvider.WARNING);
        page.setErrorMessage(null);
        break;
    case IStatus.INFO:
        page.setMessage(message, IMessageProvider.INFORMATION);
        page.setErrorMessage(null);
        break;
    default:
        page.setMessage(null);
        page.setErrorMessage(message);
        break;
    }
}

From source file:com.aptana.portal.ui.dispatch.configurationProcessors.installer.InstallerOptionsDialog.java

License:Open Source License

/**
 * Validate the path/*from   w  ww .j av  a  2  s. c om*/
 */
protected void validatePath() {
    String pathText = path.getText();
    if (pathText.trim().length() == 0) {
        // empty path
        setErrorMessage(Messages.InstallerOptionsDialog_emptyPathError);
        return;
    }
    if (!new File(pathText).exists()) {
        if (createInstallDir) {
            setMessage(Messages.InstallerOptionsDialog_inputDirectoryWillBeCreated,
                    IMessageProvider.INFORMATION);
        } else {
            // non-existing path
            setErrorMessage(Messages.InstallerOptionsDialog_nonExistingPathError);
            return;
        }

    }
    setErrorMessage(null);
}

From source file:com.buildml.eclipse.utils.AlertDialog.java

License:Open Source License

/**
 * Display an informational dialog box in the context of the current shell. Both
 * a general message and an explanatory reason will be display. Given that there's
 * only an "OK" button, there's no return code needed.
 * @param title The general informational message to be displayed.
 * @param message The detailed reason for the event.
 *///w w  w. j  a  va 2s .  co  m
public static void displayInfoDialog(String title, String message) {
    openDialog(title, message, IMessageProvider.INFORMATION, false);
}

From source file:com.buildml.eclipse.utils.AlertDialog.java

License:Open Source License

/**
 * Display an question dialog box in the context of the current shell. The user will
 * be expected to click on OK or CANCEL to answer the question.
 * @param message The question to be displayed.
 * @return The answer to the question (IDialogConstants.OK_ID or IDialogConstants.CANCEL_ID).
 *//*from w  w w .  j  av a2 s  .  co m*/
public static int displayOKCancelDialog(final String message) {
    return openDialog("Question...", message, IMessageProvider.INFORMATION, true);
}