Search in sources :

Example 26 with ISemanticParser

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

the class DirectionalBusinessItemRelationshipNameEditPart method addSemanticListeners.

/**
     * @generated
     */
protected void addSemanticListeners() {
    if (getParser() instanceof ISemanticParser) {
        EObject element = resolveSemanticElement();
        parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
        for (int i = 0; i < parserElements.size(); i++) {
            //$NON-NLS-1$
            addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i));
        }
    } else {
        super.addSemanticListeners();
    }
}
Also used : ISemanticParser(org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) EObject(org.eclipse.emf.ecore.EObject) Point(org.eclipse.draw2d.geometry.Point)

Example 27 with ISemanticParser

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

the class DirectionalBusinessItemRelationshipNameEditPart method handleNotificationEvent.

/**
     * @generated
     */
protected void handleNotificationEvent(Notification event) {
    Object feature = event.getFeature();
    if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
        Integer c = (Integer) event.getNewValue();
        setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
        refreshUnderline();
    } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
        refreshStrikeThrough();
    } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
        refreshFont();
    } else {
        if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
            refreshLabel();
        }
        if (getParser() instanceof ISemanticParser) {
            ISemanticParser modelParser = (ISemanticParser) getParser();
            if (modelParser.areSemanticElementsAffected(null, event)) {
                removeSemanticListeners();
                if (resolveSemanticElement() != null) {
                    addSemanticListeners();
                }
                refreshLabel();
            }
        }
    }
    super.handleNotificationEvent(event);
}
Also used : ISemanticParser(org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) EObject(org.eclipse.emf.ecore.EObject)

Example 28 with ISemanticParser

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

the class ActionBusinessItemNameEditPart method handleNotificationEvent.

/**
     * @generated
     */
protected void handleNotificationEvent(Notification event) {
    Object feature = event.getFeature();
    if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
        Integer c = (Integer) event.getNewValue();
        setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
        refreshUnderline();
    } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
        refreshStrikeThrough();
    } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
        refreshFont();
    } else {
        if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
            refreshLabel();
        }
        if (getParser() instanceof ISemanticParser) {
            ISemanticParser modelParser = (ISemanticParser) getParser();
            if (modelParser.areSemanticElementsAffected(null, event)) {
                removeSemanticListeners();
                if (resolveSemanticElement() != null) {
                    addSemanticListeners();
                }
                refreshLabel();
            }
        }
    }
    super.handleNotificationEvent(event);
}
Also used : ISemanticParser(org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser) EObject(org.eclipse.emf.ecore.EObject)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)28 ISemanticParser (org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser)28 Point (org.eclipse.draw2d.geometry.Point)14