01: package newprocess.diagram.view.factories;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: import newprocess.diagram.edit.parts.ExpressionEditPart;
07: import newprocess.diagram.edit.parts.ExpressionExpressionCompartmentEditPart;
08: import newprocess.diagram.edit.parts.ProcessEditPart;
09:
10: import newprocess.diagram.part.New_processVisualIDRegistry;
11:
12: import org.eclipse.core.runtime.IAdaptable;
13:
14: import org.eclipse.emf.ecore.EAnnotation;
15: import org.eclipse.emf.ecore.EcoreFactory;
16:
17: import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
18:
19: import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
20:
21: import org.eclipse.gmf.runtime.notation.NotationFactory;
22: import org.eclipse.gmf.runtime.notation.View;
23:
24: /**
25: * @generated
26: */
27: public class ExpressionViewFactory extends AbstractShapeViewFactory {
28:
29: /**
30: * @generated
31: */
32: protected List createStyles(View view) {
33: List styles = new ArrayList();
34: styles.add(NotationFactory.eINSTANCE.createFontStyle());
35: styles.add(NotationFactory.eINSTANCE.createDescriptionStyle());
36: styles.add(NotationFactory.eINSTANCE.createFillStyle());
37: styles.add(NotationFactory.eINSTANCE.createLineStyle());
38: return styles;
39: }
40:
41: /**
42: * @generated
43: */
44: protected void decorateView(View containerView, View view,
45: IAdaptable semanticAdapter, String semanticHint, int index,
46: boolean persisted) {
47: if (semanticHint == null) {
48: semanticHint = New_processVisualIDRegistry
49: .getType(ExpressionEditPart.VISUAL_ID);
50: view.setType(semanticHint);
51: }
52: super .decorateView(containerView, view, semanticAdapter,
53: semanticHint, index, persisted);
54: if (!ProcessEditPart.MODEL_ID
55: .equals(New_processVisualIDRegistry
56: .getModelID(containerView))) {
57: EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE
58: .createEAnnotation();
59: shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
60: shortcutAnnotation.getDetails().put(
61: "modelID", ProcessEditPart.MODEL_ID); //$NON-NLS-1$
62: view.getEAnnotations().add(shortcutAnnotation);
63: }
64: getViewService()
65: .createNode(
66: semanticAdapter,
67: view,
68: New_processVisualIDRegistry
69: .getType(ExpressionExpressionCompartmentEditPart.VISUAL_ID),
70: ViewUtil.APPEND, true, getPreferencesHint());
71: }
72:
73: }
|