Search in sources :

Example 11 with EAnnotation

use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.

the class GearBusinessItemViewFactory method decorateView.

/**
     * @generated
     */
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
    if (semanticHint == null) {
        semanticHint = BusinessVisualIDRegistry.getType(org.talend.designer.business.model.business.diagram.edit.parts.GearBusinessItemEditPart.VISUAL_ID);
        view.setType(semanticHint);
    }
    super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
    if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(containerView))) {
        EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
        //$NON-NLS-1$
        shortcutAnnotation.setSource("Shortcut");
        //$NON-NLS-1$
        shortcutAnnotation.getDetails().put("modelID", BusinessProcessEditPart.MODEL_ID);
        view.getEAnnotations().add(shortcutAnnotation);
    }
    getViewService().createNode(semanticAdapter, view, BusinessVisualIDRegistry.getType(GearBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
Also used : EAnnotation(org.eclipse.emf.ecore.EAnnotation)

Example 12 with EAnnotation

use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.

the class BusinessVisualIDRegistry method getModelID.

/**
     * @generated
     */
public static String getModelID(View view) {
    View diagram = view.getDiagram();
    while (view != diagram) {
        //$NON-NLS-1$
        EAnnotation annotation = view.getEAnnotation("Shortcut");
        if (annotation != null) {
            //$NON-NLS-1$
            return (String) annotation.getDetails().get("modelID");
        }
        view = (View) view.eContainer();
    }
    return diagram != null ? diagram.getType() : null;
}
Also used : EAnnotation(org.eclipse.emf.ecore.EAnnotation) View(org.eclipse.gmf.runtime.notation.View)

Example 13 with EAnnotation

use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.

the class DataBusinessItemViewFactory method decorateView.

/**
     * @generated
     */
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
    if (semanticHint == null) {
        semanticHint = BusinessVisualIDRegistry.getType(org.talend.designer.business.model.business.diagram.edit.parts.DataBusinessItemEditPart.VISUAL_ID);
        view.setType(semanticHint);
    }
    super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
    if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(containerView))) {
        EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
        //$NON-NLS-1$
        shortcutAnnotation.setSource("Shortcut");
        //$NON-NLS-1$
        shortcutAnnotation.getDetails().put("modelID", BusinessProcessEditPart.MODEL_ID);
        view.getEAnnotations().add(shortcutAnnotation);
    }
    getViewService().createNode(semanticAdapter, view, BusinessVisualIDRegistry.getType(DataBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
Also used : EAnnotation(org.eclipse.emf.ecore.EAnnotation)

Example 14 with EAnnotation

use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.

the class DatabaseBusinessItemViewFactory method decorateView.

/**
     * @generated
     */
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
    if (semanticHint == null) {
        semanticHint = BusinessVisualIDRegistry.getType(org.talend.designer.business.model.business.diagram.edit.parts.DatabaseBusinessItemEditPart.VISUAL_ID);
        view.setType(semanticHint);
    }
    super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
    if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(containerView))) {
        EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
        //$NON-NLS-1$
        shortcutAnnotation.setSource("Shortcut");
        //$NON-NLS-1$
        shortcutAnnotation.getDetails().put("modelID", BusinessProcessEditPart.MODEL_ID);
        view.getEAnnotations().add(shortcutAnnotation);
    }
    getViewService().createNode(semanticAdapter, view, BusinessVisualIDRegistry.getType(DatabaseBusinessItemNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
Also used : EAnnotation(org.eclipse.emf.ecore.EAnnotation)

Example 15 with EAnnotation

use of org.eclipse.emf.ecore.EAnnotation in project tdi-studio-se by Talend.

the class BidirectionalBusinessItemRelationshipViewFactory method decorateView.

/**
     * @generated
     */
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
    if (semanticHint == null) {
        semanticHint = BusinessVisualIDRegistry.getType(org.talend.designer.business.model.business.diagram.edit.parts.BidirectionalBusinessItemRelationshipEditPart.VISUAL_ID);
        view.setType(semanticHint);
    }
    super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
    if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(containerView))) {
        EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
        //$NON-NLS-1$
        shortcutAnnotation.setSource("Shortcut");
        //$NON-NLS-1$
        shortcutAnnotation.getDetails().put("modelID", BusinessProcessEditPart.MODEL_ID);
        view.getEAnnotations().add(shortcutAnnotation);
    }
    getViewService().createNode(semanticAdapter, view, BusinessVisualIDRegistry.getType(BidirectionalBusinessItemRelationshipNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint());
}
Also used : EAnnotation(org.eclipse.emf.ecore.EAnnotation)

Aggregations

EAnnotation (org.eclipse.emf.ecore.EAnnotation)18 Resource (org.eclipse.emf.ecore.resource.Resource)3 List (java.util.List)2 EObject (org.eclipse.emf.ecore.EObject)2 EReference (org.eclipse.emf.ecore.EReference)2 InternalEObject (org.eclipse.emf.ecore.InternalEObject)2 InternalEList (org.eclipse.emf.ecore.util.InternalEList)2 ILinkingService (org.eclipse.xtext.linking.ILinkingService)2 IllegalNodeException (org.eclipse.xtext.linking.impl.IllegalNodeException)2 LinkingDiagnosticMessageProvider (org.eclipse.xtext.linking.impl.LinkingDiagnosticMessageProvider)2 INode (org.eclipse.xtext.nodemodel.INode)2 LeafNode (org.eclipse.xtext.nodemodel.impl.LeafNode)2 Triple (org.eclipse.xtext.util.Triple)2 Test (org.junit.Test)2 File (java.io.File)1 URI (org.eclipse.emf.common.util.URI)1 EClass (org.eclipse.emf.ecore.EClass)1 EPackage (org.eclipse.emf.ecore.EPackage)1 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 ResourceSetImpl (org.eclipse.emf.ecore.resource.impl.ResourceSetImpl)1