Search in sources :

Example 1 with ParserEditStatus

use of org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus in project tdi-studio-se by Talend.

the class BusinessStructuralFeatureParser method validateValues.

/**
     * @generated
     */
protected IParserEditStatus validateValues(Object[] values) {
    if (values.length > 1) {
        return ParserEditStatus.UNEDITABLE_STATUS;
    }
    Object value = values.length == 1 ? values[0] : null;
    value = getValidNewValue(feature, value);
    if (value instanceof InvalidValue) {
        return new ParserEditStatus(BusinessDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, value.toString());
    }
    return ParserEditStatus.EDITABLE_STATUS;
}
Also used : ParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus) IParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) EObject(org.eclipse.emf.ecore.EObject)

Example 2 with ParserEditStatus

use of org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus in project tdi-studio-se by Talend.

the class BusinessAbstractParser method isValidEditString.

/**
     * @generated NOT
     */
public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
    ParsePosition pos = new ParsePosition(0);
    Object[] values = getEditProcessor().parse(editString, pos);
    if (values == null) {
        return new ParserEditStatus(BusinessDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, Messages.getString(//$NON-NLS-1$
        "BusinessAbstractParser.InvalidInputAt") + pos.getErrorIndex());
    }
    return validateNewValues(values);
}
Also used : ParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus) IParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) EObject(org.eclipse.emf.ecore.EObject) ParsePosition(java.text.ParsePosition)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)2 IParserEditStatus (org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus)2 ParserEditStatus (org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus)2 ParsePosition (java.text.ParsePosition)1