|
1 /* |
|
2 * Copyright (c) 2007 Borland Software Corporation |
|
3 * |
|
4 * All rights reserved. This program and the accompanying materials |
|
5 * are made available under the terms of the Eclipse Public License v1.0 |
|
6 * which accompanies this distribution, and is available at |
|
7 * http://www.eclipse.org/legal/epl-v10.html |
|
8 * |
|
9 * Contributors: |
|
10 * Artem Tikhomirov (Borland) - initial API and implementation |
|
11 */ |
|
12 |
|
13 «IMPORT "http://www.eclipse.org/gmf/2006/GraphicalDefinition"» |
|
14 «IMPORT "http://www.eclipse.org/emf/2002/Ecore"» |
|
15 «EXTENSION Util» |
|
16 |
|
17 «DEFINE newInstance(String figureVarName) FOR Figure»«EXPAND fqn» «figureVarName» = «EXPAND newInstance»;«ENDDEFINE» |
|
18 «DEFINE newInstance FOR Figure»new «EXPAND fqn»()«ENDDEFINE» |
|
19 |
|
20 «DEFINE newInstance(String layoutVarName) FOR Layout»«EXPAND fqn» «layoutVarName» = «EXPAND newInstance»;«ENDDEFINE» |
|
21 «DEFINE newInstance FOR Layout»new «EXPAND fqn»()«ENDDEFINE» |
|
22 |
|
23 «DEFINE newInstance(String constraintVarName) FOR LayoutData»«EXPAND fqn» «constraintVarName» = «EXPAND newInstance»;«ENDDEFINE» |
|
24 «DEFINE newInstance FOR LayoutData»new «EXPAND fqn»()«ENDDEFINE» |
|
25 |
|
26 «DEFINE newInstance(String borderVarName) FOR Border»«EXPAND fqn» «borderVarName» = «EXPAND newInstance»;«ENDDEFINE» |
|
27 «DEFINE newInstance FOR Border»new «EXPAND fqn»()«ENDDEFINE» |
|
28 |
|
29 |
|
30 «DEFINE fqn FOR Figure»«ERROR "Abstract definition fqn(Figure)"»«ENDDEFINE» |
|
31 «DEFINE fqn FOR Layout»«ERROR "Abstract definition fqn(Layout)"»«ENDDEFINE» |
|
32 «DEFINE fqn FOR LayoutData»«ERROR "Abstract definition fqn(LayoutData)"»«ENDDEFINE» |
|
33 «DEFINE fqn FOR Border»«ERROR "Abstract definition fqn(Border)"»«ENDDEFINE» |
|
34 |
|
35 //////////////////////// |
|
36 «DEFINE fqn FOR CustomLayout»«qualifiedClassName»«ENDDEFINE» |
|
37 «DEFINE fqn FOR CustomBorder»«qualifiedClassName»«ENDDEFINE» |
|
38 «DEFINE fqn FOR CustomFigure»«qualifiedClassName»«ENDDEFINE» |
|
39 |
|
40 //////////////////////// |
|
41 «DEFINE fqn FOR FlowLayout»«IF forceSingleLine»org.eclipse.draw2d.ToolbarLayout«ELSE»org.eclipse.draw2d.FlowLayout«ENDIF»«ENDDEFINE» |
|
42 |
|
43 «DEFINE fqn FOR XYLayout»org.eclipse.draw2d.XYLayout«ENDDEFINE» |
|
44 «DEFINE fqn FOR XYLayoutData»org.eclipse.draw2d.geometry.Rectangle«ENDDEFINE» |
|
45 |
|
46 «DEFINE fqn FOR GridLayout»org.eclipse.draw2d.GridLayout«ENDDEFINE» |
|
47 «DEFINE fqn FOR GridLayoutData»org.eclipse.draw2d.GridData«ENDDEFINE» |
|
48 |
|
49 «DEFINE fqn FOR StackLayout»org.eclipse.draw2d.StackLayout«ENDDEFINE» |
|
50 «DEFINE fqn FOR BorderLayout»org.eclipse.draw2d.BorderLayout«ENDDEFINE» |
|
51 |
|
52 //////////////////////// |
|
53 «DEFINE fqn FOR FigureRef»«EXPAND fqn FOR figure»«ENDDEFINE» |
|
54 «DEFINE fqn FOR Label»«IF isFullRuntime()»org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel«ELSE»org.eclipse.draw2d.Label«ENDIF»«ENDDEFINE» |
|
55 «DEFINE fqn FOR LabeledContainer»org.eclipse.draw2d.LabeledContainer«ENDDEFINE» |
|
56 «DEFINE fqn FOR Rectangle»org.eclipse.draw2d.RectangleFigure«ENDDEFINE» |
|
57 «DEFINE fqn FOR RoundedRectangle»org.eclipse.draw2d.RoundedRectangle«ENDDEFINE» |
|
58 «DEFINE fqn FOR Ellipse»org.eclipse.draw2d.Ellipse«ENDDEFINE» |
|
59 «DEFINE fqn FOR Polygon»org.eclipse.draw2d.Polygon«ENDDEFINE» |
|
60 «REM»FIXME«ENDREM»«DEFINE fqn FOR ScalablePolygon»org.eclipse.draw2d.Shape«ENDDEFINE» |
|
61 «DEFINE fqn FOR PolygonDecoration»org.eclipse.draw2d.PolygonDecoration«ENDDEFINE» |
|
62 «DEFINE fqn FOR Polyline»org.eclipse.draw2d.Polyline«ENDDEFINE» |
|
63 «DEFINE fqn FOR PolylineDecoration»org.eclipse.draw2d.PolylineDecoration«ENDDEFINE» |
|
64 «DEFINE fqn FOR PolylineConnection»«IF isFullRuntime()»org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx«ELSE»org.eclipse.draw2d.PolylineConnection«ENDIF»«ENDDEFINE» |
|
65 |
|
66 «REM» |
|
67 to utilize around, need to fix XpandExecutionContextImpl to get aspects not only from relative aspects/ path, but from |
|
68 template file as well. |
|
69 // Full GMF Runtime |
|
70 //////////////////////// |
|
71 «AROUND fqn FOR PolylineConnection»«IF isFullRuntime()»org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx«ELSE»«targetDef.proceed()»«ENDIF»«ENDAROUND» |
|
72 «AROUND fqn FOR Label»«IF isFullRuntime()»org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel«ELSE»«targetDef.proceed()»«ENDIF»«ENDAROUND» |
|
73 «ENDREM» |