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

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

Introduction

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

Prototype

int ERROR

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

Click Source Link

Document

Constant for an error message (value 3).

Usage

From source file:org.eclipse.jpt.jpa.ui.internal.details.AddQueryStateObject.java

License:Open Source License

private void addQueryTypeProblemsTo(List<Problem> currentProblems) {
    if (StringTools.isBlank(this.queryType)) {
        currentProblems.add(buildProblem(JptJpaUiDetailsMessages.QueryStateObject_typeMustBeSpecified,
                IMessageProvider.ERROR));
    }//from   www  .  j  av a  2 s .  c o  m
}

From source file:org.eclipse.jpt.jpa.ui.internal.details.orm.AddGeneratorStateObject.java

License:Open Source License

private void addNameProblemsTo(List<Problem> currentProblems) {
    if (StringTools.isBlank(this.name)) {
        currentProblems/*from   ww  w .ja va  2 s  . c o  m*/
                .add(buildProblem(JptJpaUiDetailsOrmMessages.GENERATOR_STATE_OBJECT_NAME_MUST_BE_SPECIFIED,
                        IMessageProvider.ERROR));
    } else if (names().contains(this.name)) {
        currentProblems.add(buildProblem(JptJpaUiDetailsOrmMessages.GENERATOR_STATE_OBJECT_NAME_EXISTS,
                IMessageProvider.WARNING));
    }
}

From source file:org.eclipse.jpt.jpa.ui.internal.details.orm.AddGeneratorStateObject.java

License:Open Source License

private void addGeneratorTypeProblemsTo(List<Problem> currentProblems) {
    if (StringTools.isBlank(this.generatorType)) {
        currentProblems/*from ww w.j a  v a  2 s . c o m*/
                .add(buildProblem(JptJpaUiDetailsOrmMessages.GENERATOR_STATE_OBJECT_TYPE_MUST_BE_SPECIFIED,
                        IMessageProvider.ERROR));
    }
}

From source file:org.eclipse.jst.server.generic.ui.internal.JRESelectDecorator.java

License:Open Source License

public boolean validate() {
    IStatus status = fRuntime.validate();
    if (status.getSeverity() != IStatus.OK) {
        fWizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
        fWizard.update();//from   www. ja  va2s. co  m
        return true;
    }

    fWizard.setMessage("", IMessageProvider.NONE); //$NON-NLS-1$
    fWizard.update();
    return false;

}

From source file:org.eclipse.jst.server.generic.ui.internal.ServerTypeDefinitionRuntimeDecorator.java

License:Open Source License

public boolean validate() {

    if (fRuntime == null)
        return false;
    fRuntime.setServerDefinitionId(fRuntime.getRuntime().getRuntimeType().getId());
    fRuntime.setServerInstanceProperties(getValues());

    IStatus status = fRuntime.validate();

    if (status == null || status.isOK()) {

        fWizard.setMessage(null, IMessageProvider.NONE);
        fWizard.update();// w  ww  .  ja v a2 s .  co  m
        String wDir = fRuntime.getServerTypeDefinition().getResolver()
                .resolveProperties(fRuntime.getServerTypeDefinition().getStart().getWorkingDirectory());
        fRuntime.getRuntimeWorkingCopy().setLocation(new Path(wDir));

        return false;
    }

    fWizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
    fWizard.update();
    return true;
}

From source file:org.eclipse.jst.server.generic.ui.internal.ServerTypeDefinitionServerDecorator.java

License:Open Source License

public boolean validate() {
    IStatus status = null;/*from w ww  .  ja  v  a  2s .co  m*/
    if (fServer != null) {
        fServer.setServerInstanceProperties(getValues());
        status = fServer.validate();
    }
    if (status == null || status.isOK()) {
        fWizard.setMessage(null, IMessageProvider.NONE);
        fWizard.update();
    } else {
        fWizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
        fWizard.update();
        return true;
    }
    return false;
}

From source file:org.eclipse.jst.server.jetty.ui.internal.JettyRuntimeComposite.java

License:Open Source License

protected void validate() {
    if (runtime == null) {
        wizard.setMessage("", IMessageProvider.ERROR);
        return;/*from   w w  w . j ava2s .c o m*/
    }

    IStatus status = runtimeWC.validate(null);
    if (status == null || status.isOK())
        wizard.setMessage(null, IMessageProvider.NONE);
    else if (status.getSeverity() == IStatus.WARNING)
        wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
    else
        wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
    wizard.update();
}

From source file:org.eclipse.jst.server.ui.internal.GenericRuntimeComposite.java

License:Open Source License

protected void validate() {
    if (runtime == null) {
        wizard.setMessage("", IMessageProvider.ERROR);
        return;/*w  w w. j a  v a 2s.  c o m*/
    }

    IStatus status = runtimeWC.validate(null);
    if (status == null || status.isOK())
        wizard.setMessage(null, IMessageProvider.NONE);
    else
        wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
}

From source file:org.eclipse.jst.ws.internal.consumption.ui.wizard.RuntimeServerSelectionDialog.java

License:Open Source License

public void validateServerRuntimeSelection() {
    IStatus status = getStatus();/*from   ww  w .ja  v a 2s.  com*/
    String message = new String(messageBanner_);
    message = new String(status.getMessage());
    if (status.getSeverity() == Status.ERROR) {
        setMessage(message, IMessageProvider.ERROR);
        getButton(IDialogConstants.OK_ID).setEnabled(false);
    }
    if (status.getSeverity() == Status.WARNING) {
        setMessage(message, IMessageProvider.WARNING);
        getButton(IDialogConstants.OK_ID).setEnabled(true);
    }
    if (status.getSeverity() == Status.INFO) {
        setMessage(message, IMessageProvider.INFORMATION);
        getButton(IDialogConstants.OK_ID).setEnabled(false);
    }
    if (status.getSeverity() == Status.OK) {
        setMessage(messageBanner_);
        getButton(IDialogConstants.OK_ID).setEnabled(true);
    }
}

From source file:org.eclipse.jubula.client.ui.rcp.dialogs.AUTPropertiesDialog.java

License:Open Source License

/** 
 * The action of the AUT name field.//www . ja va 2s . co m
 * @return false, if the AUT name field contents an error:
 * the project name starts or end with a blank, or the field is empty
 */
private boolean modifyAUTNameFieldAction() {
    boolean isError = false;
    String autName = m_autNameText.getText();
    if (!isError) {
        Iterator iter = m_project.getAutMainList().iterator();
        while (iter.hasNext()) {
            IAUTMainPO aut = (IAUTMainPO) iter.next();
            if (!m_edit) {
                if (aut.getName().equals(m_autNameText.getText())) {
                    setMessage(Messages.AUTPropertiesDialogDoubleAUTName, IMessageProvider.ERROR);
                    isError |= true;
                }
            } else {
                if (aut.getName().equals(m_autNameText.getText())
                        && !m_autNameText.getText().equals(m_origAUTName)) {
                    setMessage(Messages.AUTPropertiesDialogDoubleAUTName, IMessageProvider.ERROR);
                    isError |= true;
                }
            }
        }
    }
    if (!isError) {
        if (autName.length() == 0) {
            setMessage(Messages.AUTPropertiesDialogEmptyAUTName, IMessageProvider.ERROR);
            isError |= true;
        }
    }

    if (!isError) {
        if (autName.startsWith(StringConstants.SPACE) || autName.charAt(autName.length() - 1) == ' ') {
            setMessage(Messages.AUTPropertiesDialogInvalidAUTName, IMessageProvider.ERROR);
            isError |= true;
        }
    }

    return isError;
}