01: package newprocess.diagram.view.factories;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: import newprocess.diagram.edit.parts.ExpressionExpressionCompartment6EditPart;
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 ExpressionExpressionCompartment6ViewFactory extends
28: ListCompartmentViewFactory {
29:
30: /**
31: * @generated
32: */
33: protected List createStyles(View view) {
34: List styles = new ArrayList();
35: styles.add(NotationFactory.eINSTANCE.createSortingStyle());
36: styles.add(NotationFactory.eINSTANCE.createFilteringStyle());
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(ExpressionExpressionCompartment6EditPart.VISUAL_ID);
49: view.setType(semanticHint);
50: }
51: super .decorateView(containerView, view, semanticAdapter,
52: semanticHint, index, persisted);
53: setupCompartmentTitle(view);
54: setupCompartmentCollapsed(view);
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: }
66:
67: /**
68: * @generated
69: */
70: protected void setupCompartmentTitle(View view) {
71: TitleStyle titleStyle = (TitleStyle) view
72: .getStyle(NotationPackage.eINSTANCE.getTitleStyle());
73: if (titleStyle != null) {
74: titleStyle.setShowTitle(true);
75: }
76: }
77:
78: /**
79: * @generated
80: */
81: protected void setupCompartmentCollapsed(View view) {
82: DrawerStyle drawerStyle = (DrawerStyle) view
83: .getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
84: if (drawerStyle != null) {
85: drawerStyle.setCollapsed(false);
86: }
87: }
88:
89: }
|