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

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

Introduction

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

Prototype

int WARNING

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

Click Source Link

Document

Constant for a warning message (value 2).

Usage

From source file:org.apache.felix.sigil.eclipse.ui.internal.preferences.LibraryConfigurationDialog.java

License:Apache License

private void updateState() {
    String error = null;//w w  w.  ja va  2 s  .c o m
    String warning = null;

    name = txtName.getText();

    try {
        version = VersionTable.getVersion(txtVersion.getText());
        if (version.getQualifier().indexOf('_') > -1) {
            warning = "The use of underscores in a version qualifier is discouraged.";
        }
    } catch (IllegalArgumentException e) {
        version = null;
        error = "Invalid version format";
    }

    Button okButton = getButton(IDialogConstants.OK_ID);
    if (okButton != null && !okButton.isDisposed())
        okButton.setEnabled(allowOkay());

    setErrorMessage(error);
    setMessage(warning, IMessageProvider.WARNING);
}

From source file:org.apache.felix.sigil.ui.eclipse.ui.preferences.LibraryConfigurationDialog.java

License:Apache License

private void updateState() {
    String error = null;/* www.  jav a 2 s . c o  m*/
    String warning = null;

    name = txtName.getText();

    try {
        version = new Version(txtVersion.getText());
        if (version.getQualifier().indexOf('_') > -1) {
            warning = "The use of underscores in a version qualifier is discouraged.";
        }
    } catch (IllegalArgumentException e) {
        version = null;
        error = "Invalid version format";
    }

    Button okButton = getButton(IDialogConstants.OK_ID);
    if (okButton != null && !okButton.isDisposed())
        okButton.setEnabled(allowOkay());

    setErrorMessage(error);
    setMessage(warning, IMessageProvider.WARNING);
}

From source file:org.apache.hadoop.eclipse.servers.HadoopLocationWizard.java

License:Apache License

/**
 * Validates the current Hadoop location settings (look for Hadoop
 * installation directory)./*  ww w.  j  av a2  s  .  c o m*/
 * 
 */
private void testLocation() {
    setMessage("Not implemented yet", IMessageProvider.WARNING);
}

From source file:org.apache.ivyde.eclipse.resolvevisualizer.ResolveVisualizerForm.java

License:Apache License

private Image getImage(int type) {
    switch (type) {
    case IMessageProvider.ERROR:
        return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
    case IMessageProvider.WARNING:
        return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
    case IMessageProvider.INFORMATION:
        return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
    }//from   w w w . jav a  2 s .  com
    return null;
}

From source file:org.apache.ivyde.eclipse.resolvevisualizer.ResolveVisualizerForm.java

License:Apache License

private void configureFormText(final Form form, FormText text) {
    text.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent e) {
            String is = (String) e.getHref();
            try {
                ((FormText) e.widget).getShell().dispose();
                int index = Integer.parseInt(is);
                IMessage[] messages = form.getChildrenMessages();
                IMessage message = messages[index];
                Set/* <IvyNodeElement> */ conflicts = (Set/* <IvyNodeElement> */) message.getData();
                if (conflicts != null) {
                    viewer.setSelection(new StructuredSelection(new ArrayList(conflicts)));
                }//  ww w  .jav a 2 s  . c  om
            } catch (NumberFormatException ex) {
            }
        }
    });
    text.setImage("error", getImage(IMessageProvider.ERROR));
    text.setImage("warning", getImage(IMessageProvider.WARNING));
    text.setImage("info", getImage(IMessageProvider.INFORMATION));
}

From source file:org.bbaw.pdr.ae.repositoryconnection.view.UpdateConflictDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.Dialog#create()
 *//* w  w w .j a  va 2  s  .c om*/
@Override
public final void create() {
    super.create();

    // Set the title
    setTitle("Update Conflict Dialog");
    // Set the message
    setMessage("Please select the version - either local or form repository - you want to keep",
            IMessageProvider.WARNING);

}

From source file:org.becausecucumber.eclipse.plugin.ui.preference.searcherPage.ValidationResult.java

License:Open Source License

/**
 * Convert the status code of this validation results into an
 * IMessageProvider status code./*from www.java  2 s.  c om*/
 */
public int getMessageProviderStatus() {
    switch (status) {
    case IStatus.OK:
        return IMessageProvider.NONE;
    case IStatus.CANCEL:
        // There's no corresponding statis in IMessageProvider. Treat
        // cancelation like an error.
        return IMessageProvider.ERROR;
    case IStatus.ERROR:
        return IMessageProvider.ERROR;
    case IStatus.INFO:
        return IMessageProvider.INFORMATION;
    case IStatus.WARNING:
        return IMessageProvider.WARNING;
    default:
        // Shouldn't happen since all cases should be covered above... byt
        // anyhow
        return IMessageProvider.ERROR;
    }
}

From source file:org.bonitasoft.studio.connectors.ui.wizard.page.ConnectorContainerSwitchWizardPage.java

License:Open Source License

@Override
public boolean isPageComplete() {
    if (getSelectedConnector() != null) {
        ConnectableElement source = (ConnectableElement) getSelectedConnector().eContainer();
        if (!(source instanceof AbstractProcess)) {
            setMessage(Messages.warningLocalVariableinConnector, IMessageProvider.WARNING);
        } else {//w  ww. jav  a  2s  . c o m
            setMessage(null);
        }
    }

    return !modelTree.getViewer().getSelection().isEmpty()
            && !connectorsTree.getViewer().getSelection().isEmpty() && getSelectedConnectableElement() != null;
}

From source file:org.bonitasoft.studio.simulation.wizards.AddResourceAssignmentWizardPage.java

License:Open Source License

@Override
public boolean isPageComplete() {
    setErrorMessage(null);/*ww w . j  a v  a  2s .c  om*/
    String resourceID = getResourceID();

    if (resourceID.length() <= 0) {
        setErrorMessage(Messages.EditSimulationResourceWizard_ErrorEmptyName);
        return false;
    }
    String quantityText = getQuantity();
    int quantity = 0;
    try {
        quantity = Integer.parseInt(quantityText);
    } catch (NumberFormatException e) {
        setErrorMessage(Messages.EditSimulationResourceWizard_ErrorQuantity);
        return false;
    }

    if (activity.getExecutionTime() == 0) {
        setMessage(Messages.NoExecutionTime, IMessageProvider.WARNING);
    }
    return super.isPageComplete();
}

From source file:org.caleydo.vis.lineup.ui.detail.JSCombineEditorDialog.java

License:Open Source License

private void testPressed() {
    try {/*from   ww  w  .  j  a  v  a  2 s . co m*/
        float[] fs = parseArray(testUI.getText());
        if (!verifyCode())
            return;
        w.getBuffer().setLength(0); // reset
        Bindings b = engine.createBindings();
        b.put("v", new Wrapper(fs, 0));
        b.put("weights", parseArray(testWeightUI.getText()));
        b.put("mode", "apply");
        String output = Objects.toString(script.eval(b));
        testOutputUI.setText(output);
        String extra = w.toString();
        if (extra.length() > 0)
            setMessage(extra, IMessageProvider.WARNING);
        else
            setMessage(DEFAULT_MESSAGE, IMessageProvider.INFORMATION);
    } catch (NumberFormatException e) {
        testOutputUI.setText("Invalid input: " + e.getMessage());
    } catch (ScriptException e) {
        testOutputUI.setText("Error: " + e.getMessage());
    }
}