Example usage for org.eclipse.jface.fieldassist FieldDecorationRegistry DEC_ERROR_QUICKFIX

List of usage examples for org.eclipse.jface.fieldassist FieldDecorationRegistry DEC_ERROR_QUICKFIX

Introduction

In this page you can find the example usage for org.eclipse.jface.fieldassist FieldDecorationRegistry DEC_ERROR_QUICKFIX.

Prototype

String DEC_ERROR_QUICKFIX

To view the source code for org.eclipse.jface.fieldassist FieldDecorationRegistry DEC_ERROR_QUICKFIX.

Click Source Link

Document

Decoration id for the decoration that should be used to cue the user that a field has an error with quick fix available.

Usage

From source file:ch.unibe.iam.scg.archie.ui.Decorators.java

License:Open Source License

/**
 * @param type//from w w w.j av  a 2 s  . c o  m
 * @param description 
 * @return FieldDecoration
 */
public static FieldDecoration getFieldDecoration(int type, String description) {
    switch (type) {
    case VALID:
        FieldDecoration validDecoration = registry.getFieldDecoration(DEC_VALID);
        validDecoration.setDescription(description);
        return validDecoration;
    case WARNING:
        FieldDecoration warningDecoration = registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING);
        warningDecoration.setDescription(description);
        return warningDecoration;
    case ERROR:
        FieldDecoration errorDecoration = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
        errorDecoration.setDescription(description);
        return errorDecoration;
    case QUICKFIX:
        FieldDecoration quickfixDecoration = registry
                .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR_QUICKFIX);
        quickfixDecoration.setDescription(description);
        return quickfixDecoration;
    default:
        return null;
    }
}

From source file:com.nokia.tools.variant.common.ui.wizards.dialogfields.DialogField.java

License:Open Source License

protected FieldDecoration getErrorDecoration() {
    if (errorDecoration == null) {
        FieldDecoration standardError;//  ww  w. j a  va2  s  .  com
        if (hasQuickFix()) {
            standardError = FieldDecorationRegistry.getDefault()
                    .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR_QUICKFIX);
        } else {
            standardError = FieldDecorationRegistry.getDefault()
                    .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
        }
        if (getErrorMessage() == null) {
            errorDecoration = standardError;
        } else {
            errorDecoration = new FieldDecoration(standardError.getImage(), getErrorMessage());
        }
    }
    return errorDecoration;

}

From source file:com.teamcenter.hendrickson.schmgr.operations.Validator.java

License:MIT License

Image getFieldDecorationImage(String type) {

    String Icontype = FieldDecorationRegistry.DEC_INFORMATION;

    if (type.equals("error")) {

        Icontype = FieldDecorationRegistry.DEC_ERROR;

    } else if (type.equals("warn")) {

        Icontype = FieldDecorationRegistry.DEC_WARNING;

    } else if (type.equals("required")) {

        Icontype = FieldDecorationRegistry.DEC_REQUIRED;

    } else if (type.equals("content")) {

        Icontype = FieldDecorationRegistry.DEC_CONTENT_PROPOSAL;

    } else if (type.equals("quickfix")) {

        Icontype = FieldDecorationRegistry.DEC_ERROR_QUICKFIX;

    } else {/*  ww  w .  j  av  a 2  s. co  m*/

        Icontype = FieldDecorationRegistry.DEC_INFORMATION;

    }

    Image image = FieldDecorationRegistry.getDefault().getFieldDecoration(Icontype).getImage();

    if (type.equals("correct"))
        return image = ResourceManager.getPluginImage("example", "icons/tick.png");
    else
        return image;
}

From source file:org.eclipse.birt.chart.ui.swt.fieldassist.AssistField.java

License:Open Source License

/**
 * Returns error decoration.// ww w  . j  a v a  2  s  .  co m
 * 
 * @return
 */
public FieldDecoration getErrorDecoration() {
    if (errorDecoration == null) {
        FieldDecoration standardError;
        if (hasQuickFix()) {
            standardError = FieldDecorationRegistry.getDefault()
                    .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR_QUICKFIX);
        } else {
            standardError = FieldDecorationRegistry.getDefault()
                    .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
        }
        if (getErrorMessage() == null) {
            errorDecoration = standardError;
        } else {
            errorDecoration = new FieldDecoration(standardError.getImage(), getErrorMessage());
        }
    }

    if (getErrorMessage() != null) {
        errorDecoration.setDescription(getErrorMessage());
    }
    return errorDecoration;

}