Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/Border.xpt')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/Border.xpt24
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Border.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Border.xpt
index 02847b54f..5ed36edc6 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Border.xpt
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Border.xpt
@@ -18,12 +18,16 @@
«figureVarName».setBorder(«EXPAND border(figureVarName)»);
«ENDDEFINE»
-«DEFINE Init(String figureVarName) FOR gmfgraph::CustomBorder-»
-{
- «EXPAND Runtime::newInstance("result")»
- «EXPAND attr::CustomClass::Init("result")»
- «figureVarName».setBorder(result);
-}
+«DEFINE InitMethods FOR gmfgraph::Figure»
+«FOREACH getBordersInUse() AS b»«EXPAND initMethod(getBordersInUse().indexOf(b)) FOR b»«ENDFOREACH-»
+«ENDDEFINE»
+
+«DEFINE initMethod(int c) FOR gmfgraph::CustomBorder-»
+ private org.eclipse.draw2d.Border createBorder«c»() {
+ «EXPAND Runtime::newInstance("result")»
+ «EXPAND attr::CustomClass::Init("result")»
+ return result;
+ }
«ENDDEFINE»
«DEFINE border(String figureVarName) FOR gmfgraph::Border»
@@ -37,9 +41,9 @@ new org.eclipse.draw2d.LineBorder(«IF null == color»null«ELSE»«EXPAND attr::Figu
new org.eclipse.draw2d.MarginBorder(«EXPAND MapMode::map FOR insets»)«ENDDEFINE»
«DEFINE border(String figureVarName) FOR gmfgraph::CompoundBorder-»
-new org.eclipse.draw2d.CompoundBorder(«IF outer == null»null«ELSE»«EXPAND internalNewInstance(figureVarName) FOR outer»«ENDIF», «IF inner == null»null«ELSE»«EXPAND internalNewInstance(figureVarName) FOR inner»«ENDIF»)
+new org.eclipse.draw2d.CompoundBorder(«IF outer == null»null«ELSE»«EXPAND border(figureVarName) FOR outer»«ENDIF», «IF inner == null»null«ELSE»«EXPAND border(figureVarName) FOR inner»«ENDIF»)
«ENDDEFINE»
-«DEFINE internalNewInstance(String figureVarName) FOR gmfgraph::Border-»
-«IF {this}.typeSelect(gmfgraph::CustomBorder).isEmpty()»«EXPAND border(figureVarName)»«ELSE»«EXPAND Runtime::newInstance»«ENDIF-»
-«ENDDEFINE»
+«DEFINE border(String figureVarName) FOR gmfgraph::CustomBorder-»
+createBorder«getBordersInUse().size()»()«getBordersInUse().add(this)->""-»
+«ENDDEFINE» \ No newline at end of file

Back to the top