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