01: package newprocess.diagram.view.factories;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: import newprocess.diagram.edit.parts.GlobalsGlobalsConditionCompartmentEditPart;
07: import newprocess.diagram.edit.parts.ProcessEditPart;
08:
09: import newprocess.diagram.part.New_processVisualIDRegistry;
10:
11: import org.eclipse.core.runtime.IAdaptable;
12:
13: import org.eclipse.emf.ecore.EAnnotation;
14: import org.eclipse.emf.ecore.EcoreFactory;
15:
16: import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
17:
18: import org.eclipse.gmf.runtime.notation.DrawerStyle;
19: import org.eclipse.gmf.runtime.notation.NotationFactory;
20: import org.eclipse.gmf.runtime.notation.NotationPackage;
21: import org.eclipse.gmf.runtime.notation.TitleStyle;
22: import org.eclipse.gmf.runtime.notation.View;
23:
24: /**
25: * @generated
26: */
27: public class GlobalsGlobalsConditionCompartmentViewFactory extends
28: ListCompartmentViewFactory {
29:
30: /**
31: * @generated
32: */
33: protected List createStyles(View view) {
34: List styles = new ArrayList();
35: styles.add(NotationFactory.eINSTANCE.createDrawerStyle());
36: styles.add(NotationFactory.eINSTANCE.createSortingStyle());
37: styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
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(GlobalsGlobalsConditionCompartmentEditPart.VISUAL_ID);
50: view.setType(semanticHint);
51: }
52: super .decorateView(containerView, view, semanticAdapter,
53: semanticHint, index, persisted);
54: setupCompartmentTitle(view);
55: setupCompartmentCollapsed(view);
56: if (!ProcessEditPart.MODEL_ID
57: .equals(New_processVisualIDRegistry
58: .getModelID(containerView))) {
59: EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE
60: .createEAnnotation();
61: shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
62: shortcutAnnotation.getDetails().put(
63: "modelID", ProcessEditPart.MODEL_ID); //$NON-NLS-1$
64: view.getEAnnotations().add(shortcutAnnotation);
65: }
66: }
67:
68: /**
69: * @generated
70: */
71: protected void setupCompartmentTitle(View view) {
72: TitleStyle titleStyle = (TitleStyle) view
73: .getStyle(NotationPackage.eINSTANCE.getTitleStyle());
74: if (titleStyle != null) {
75: titleStyle.setShowTitle(true);
76: }
77: }
78:
79: /**
80: * @generated
81: */
82: protected void setupCompartmentCollapsed(View view) {
83: DrawerStyle drawerStyle = (DrawerStyle) view
84: .getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
85: if (drawerStyle != null) {
86: drawerStyle.setCollapsed(false);
87: }
88: }
89:
90: }
|