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