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:com.samsung.sec.dexter.eclipse.ui.login.LoginDialog.java

License:Open Source License

private boolean handleCreateAccount(final String id, final String pwd) {
    try {/* w  w  w . j a v a  2  s. c  om*/
        IDexterClient client = DexterUIActivator.getDefault().getDexterClient();
        client.createAccount(id, pwd, false);
        return true;
    } catch (DexterRuntimeException e) {
        DexterUIActivator.LOG.error(e.getMessage(), e);
        setMessage(Messages.LoginDialog_ACCOUNT_ERROR_MSG, IMessageProvider.ERROR);
        return false;
    }
}

From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.wizard.SapNWRuntimeComposite.java

License:Open Source License

protected void validate() {
    if (runtime == null) {
        wizard.setMessage("Internal error: runtime is null", IMessageProvider.ERROR);
        return;/*ww  w.j  ava2 s  . com*/
    }

    IStatus status = runtime.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:com.sap.netweaver.porta.ide.eclipse.server.ui.wizard.SapNWServerComposite.java

License:Open Source License

protected void validate() {
    if (server == null) {
        wizard.setMessage("Internal error: server is null", IMessageProvider.ERROR);
        return;//from  www .  j  av a  2  s .c o m
    }

    // validate the host
    IStatus status = validateHost(hostName.getText());
    // validate the instance number
    if (!StatusUtil.hasErrorMessage(status)) {
        status = StatusUtil.merge(status, validateInstanceNumber(instanceNumber.getText()));
    }
    // validate ping status
    if (!StatusUtil.hasErrorMessage(status)) {
        status = StatusUtil.merge(status, validatePingStatus());
    }

    if (status == null || status.isOK()) {
        wizard.setMessage(null, IMessageProvider.NONE);
    } else if (status.getSeverity() == IStatus.INFO) {
        wizard.setMessage(status.getMessage(), IMessageProvider.INFORMATION);
    } else if (status.getSeverity() == IStatus.WARNING) {
        wizard.setMessage(status.getMessage(), IMessageProvider.WARNING);
    } else {
        wizard.setMessage(status.getMessage(), IMessageProvider.ERROR);
    }

    pingServer.setEnabled(wizard.getMessageType() != IMessageProvider.ERROR);

    wizard.update();
}

From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.wizard.SapNWServerWizardFragment.java

License:Open Source License

public boolean isComplete() {
    IServerWorkingCopy server = getServer();
    if (server == null)
        return false;

    return comp.isPinged() && wizard.getMessageType() != IMessageProvider.ERROR;
}

From source file:com.siteview.mde.internal.ui.editor.monitor.GeneralInfoSection.java

License:Open Source License

private boolean validateIdEntry() {
    // Value must be specified
    return ControlValidationUtility.validateRequiredField(fIdEntry.getText().getText(), fIdEntryValidator,
            IMessageProvider.ERROR);
}

From source file:com.siteview.mde.internal.ui.editor.monitor.GeneralInfoSection.java

License:Open Source License

private boolean validateVersionEntry() {
    // Value must be specified
    if (ControlValidationUtility.validateRequiredField(fVersionEntry.getText().getText(),
            fVersionEntryValidator, IMessageProvider.ERROR) == false) {
        return false;
    }/*from ww  w.  j  a v a  2  s .c  o  m*/
    // Value must be a valid version
    return ControlValidationUtility.validateVersionField(fVersionEntry.getText().getText(),
            fVersionEntryValidator);
}

From source file:com.siteview.mde.internal.ui.editor.targetdefinition.InformationSection.java

License:Open Source License

/**
 * Creates the UI for this section./*from  www. j  a v  a2s .  c o m*/
 * 
 * @param section section the UI is being added to
 * @param toolkit form toolkit used to create the widgets
 */
protected void createClient(Section section, FormToolkit toolkit) {
    section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.verticalAlignment = SWT.TOP;
    data.horizontalSpan = 2;
    section.setLayoutData(data);

    section.setText(MDEUIMessages.InformationSection_0);
    section.setDescription(MDEUIMessages.InformationSection_1);

    Composite client = toolkit.createComposite(section);
    client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 2));
    client.setLayoutData(new GridData(GridData.FILL_BOTH));

    fNameText = toolkit.createText(client, getTarget().getName());
    fNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fNameText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            String value = fNameText.getText().trim();
            getTarget().setName(value.length() > 0 ? value : null);
            markDirty();
        }
    });

    fNameTextValidator = new TextValidator(fPage.getManagedForm(), fNameText, null, true) {

        protected boolean autoEnable() {
            if (getText().getEditable() == false) {
                return false;
            }
            return true;
        }

        protected boolean validateControl() {
            return ControlValidationUtility.validateRequiredField(fNameText.getText(), fNameTextValidator,
                    IMessageProvider.ERROR);
        }
    };
    toolkit.paintBordersFor(client);
    section.setClient(client);
}

From source file:com.siteview.mde.internal.ui.editor.validation.AbstractControlValidator.java

License:Open Source License

public static int getMessageType(IStatus status) {
    int severity = status.getSeverity();
    // Translate severity to the equivalent message provider type
    if (severity == IStatus.OK) {
        return IMessageProvider.NONE;
    } else if (severity == IStatus.ERROR) {
        return IMessageProvider.ERROR;
    } else if (severity == IStatus.WARNING) {
        return IMessageProvider.WARNING;
    } else if (severity == IStatus.INFO) {
        return IMessageProvider.INFORMATION;
    }//from   ww w  .  j  a  va  2  s. co m
    // IStatus.CANCEL
    return IMessageProvider.NONE;
}

From source file:com.siteview.mde.internal.ui.editor.validation.AbstractControlValidator.java

License:Open Source License

public static int getMessageType(IProject project, String compilerFlagId) {
    int severity = CompilerFlags.getFlag(project, compilerFlagId);
    // Translate severity to the equivalent message provider type
    if (severity == CompilerFlags.IGNORE) {
        return IMessageProvider.NONE;
    } else if (severity == CompilerFlags.ERROR) {
        return IMessageProvider.ERROR;
    } else {//  w  w w  .  jav  a  2  s.co m
        // CompilerFlags.WARNING
        return IMessageProvider.WARNING;
    }
}

From source file:com.siteview.mde.internal.ui.editor.validation.ControlValidationUtility.java

License:Open Source License

public static boolean validatePlatformFilterField(String value, IValidatorMessageHandler validator) {
    // Check to see if the platform filter syntax is valid
    try {//w ww.  j a  v  a 2s  .c o m
        MDECore.getDefault().getBundleContext().createFilter(value);
    } catch (InvalidSyntaxException ise) {
        validator.addMessage(MDEUIMessages.ControlValidationUtility_errorMsgFilterInvalidSyntax,
                IMessageProvider.ERROR);
        return false;
    }

    return true;
}