Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-03-13 17:53:14 +0000
committeratikhomirov2006-03-13 17:53:14 +0000
commit2817409de45f43ad87eb1c260fa5bcea0b8f8d17 (patch)
treef73d0a003639e3fbc5dd86f9920de2b5869dd48f /plugins/org.eclipse.gmf.graphdef.codegen/src
parentcc7f4191120cb57f4565fb0eb94f9bfb68d1efbe (diff)
downloadorg.eclipse.gmf-tooling-2817409de45f43ad87eb1c260fa5bcea0b8f8d17.tar.gz
org.eclipse.gmf-tooling-2817409de45f43ad87eb1c260fa5bcea0b8f8d17.tar.xz
org.eclipse.gmf-tooling-2817409de45f43ad87eb1c260fa5bcea0b8f8d17.zip
explicit method names for fqn switch to better reflect it's intention
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/src')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitCustomLayoutDataGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitFlowLayoutGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitGridLayoutDataGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitXYLayoutDataGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewFigureGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewLayoutGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java8
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java4
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopShapeGenerator.java8
10 files changed, 17 insertions, 17 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java
index c0741679e..9fad96667 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java
@@ -196,7 +196,7 @@ public class StandaloneGenerator extends GeneratorBase {
if (myInput[i].getImplementationBundle() != null && myInput[i].getImplementationBundle().trim().length() > 0) {
rv.add(myInput[i].getImplementationBundle());
}
- String[] additional = (String[]) myFigureNameSwitch.doSwitch(myInput[i]);
+ String[] additional = myFigureNameSwitch.getDependencies(myInput[i]);
rv.addAll(Arrays.asList(additional));
}
return (String[]) rv.toArray(new String[rv.size()]);
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitCustomLayoutDataGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitCustomLayoutDataGenerator.java
index 17b53a8d8..74edd205e 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitCustomLayoutDataGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitCustomLayoutDataGenerator.java
@@ -33,7 +33,7 @@ public class InitCustomLayoutDataGenerator
GraphDefDispatcher.LayoutArgs args = (GraphDefDispatcher.LayoutArgs) argument;
final CustomLayoutData layoutData = (CustomLayoutData) args.getData();
final GraphDefDispatcher dispatcher = args.getDispatcher();
-final String layoutImplClassName = dispatcher.getImportManager().getImportedName((String) dispatcher.getFQNSwitch().doSwitch(layoutData));
+final String layoutImplClassName = dispatcher.getFQNSwitch().get(layoutData, dispatcher.getImportManager());
stringBuffer.append(TEXT_1);
stringBuffer.append(layoutImplClassName);
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitFlowLayoutGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitFlowLayoutGenerator.java
index 16f06a75a..43869dcfe 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitFlowLayoutGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitFlowLayoutGenerator.java
@@ -47,7 +47,7 @@ GraphDefDispatcher.LayoutArgs argsBundle = (GraphDefDispatcher.LayoutArgs) argum
final FlowLayout gmfLayout = (FlowLayout) argsBundle.getLayout();
final String layouterVarName = argsBundle.getManagerVariableName();
final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
-final String layouterClassName = dispatcher.getImportManager().getImportedName((String) dispatcher.getFQNSwitch().doSwitch(gmfLayout));
+final String layouterClassName = dispatcher.getFQNSwitch().get(gmfLayout, dispatcher.getImportManager());
class AlignmentConverter {
private final String myBegin;
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitGridLayoutDataGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitGridLayoutDataGenerator.java
index 79c8f272e..3bc22d6a8 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitGridLayoutDataGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitGridLayoutDataGenerator.java
@@ -55,7 +55,7 @@ final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
final String layoutConstraintVarName = argsBundle.getConstraintVariableName();
final String layoutManagerVarName = argsBundle.getManagerVariableName();
-final String layoutImplClassName = dispatcher.getImportManager().getImportedName((String) dispatcher.getFQNSwitch().doSwitch(gmfLayoutData));
+final String layoutImplClassName = dispatcher.getFQNSwitch().get(gmfLayoutData, dispatcher.getImportManager());
stringBuffer.append(TEXT_1);
stringBuffer.append(layoutImplClassName);
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitXYLayoutDataGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitXYLayoutDataGenerator.java
index 220850ae9..25aa6785c 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitXYLayoutDataGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/InitXYLayoutDataGenerator.java
@@ -46,7 +46,7 @@ final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
final String layoutConstraintVarName = argsBundle.getConstraintVariableName();
final String layoutManagerVarName = argsBundle.getManagerVariableName();
-final String layoutImplClassName = dispatcher.getImportManager().getImportedName((String) dispatcher.getFQNSwitch().doSwitch(gmfLayoutData));
+final String layoutImplClassName = dispatcher.getFQNSwitch().get(gmfLayoutData, dispatcher.getImportManager());
stringBuffer.append(TEXT_1);
stringBuffer.append(layoutImplClassName);
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewFigureGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewFigureGenerator.java
index 270de0933..68ed392ac 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewFigureGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewFigureGenerator.java
@@ -31,7 +31,7 @@ GraphDefDispatcher.Args args = (GraphDefDispatcher.Args) argument;
final Figure figureInstance = args.getFigure();
final String figureVarName = args.getVariableName();
final GraphDefDispatcher dispatcher = args.getDispatcher();
-final String figureClassName = dispatcher.getImportManager().getImportedName((String) dispatcher.getFQNSwitch().doSwitch(figureInstance));
+final String figureClassName = dispatcher.getFQNSwitch().get(figureInstance, dispatcher.getImportManager());
// PRODUCES instance AND (!) initializes attributes
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewLayoutGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewLayoutGenerator.java
index ac006c4cc..517bd9f1e 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewLayoutGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/NewLayoutGenerator.java
@@ -39,7 +39,7 @@ final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
Layout gmfLayout= figureMarker.getLayout();
if (gmfLayout != null){
- final String layouterImplClass = dispatcher.getImportManager().getImportedName((String) dispatcher.getFQNSwitch().doSwitch(gmfLayout));
+ final String layouterImplClass = dispatcher.getFQNSwitch().get(gmfLayout, dispatcher.getImportManager());
stringBuffer.append(TEXT_2);
stringBuffer.append(layouterImplClass);
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java
index a8bcc55b8..f2a9b8c3a 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopConnectionGenerator.java
@@ -44,7 +44,7 @@ public class TopConnectionGenerator
Object[] args = (Object[]) argument;
PolylineConnection figure = (PolylineConnection) args[0];
final ImportAssistant importManager = (ImportAssistant) args[1];
-final GMFGraphSwitch fqnSwitch = (GMFGraphSwitch) args[2];
+final FigureQualifiedNameSwitch fqnSwitch = (FigureQualifiedNameSwitch) args[2];
final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3];
stringBuffer.append(TEXT_1);
@@ -52,7 +52,7 @@ final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3];
stringBuffer.append(TEXT_2);
stringBuffer.append(figure.getName());
stringBuffer.append(TEXT_3);
- stringBuffer.append(importManager.getImportedName((String) fqnSwitch.doSwitch(figure)));
+ stringBuffer.append(fqnSwitch.get(figure, importManager));
stringBuffer.append(TEXT_4);
stringBuffer.append(figure.getName());
stringBuffer.append(TEXT_5);
@@ -66,7 +66,7 @@ if (figure.getTargetDecoration() != null) {
}
stringBuffer.append(TEXT_9);
if (figure.getSourceDecoration() != null) {
- final String className = importManager.getImportedName((String) fqnSwitch.doSwitch(figure.getSourceDecoration()));
+ final String className = fqnSwitch.get(figure.getSourceDecoration(), importManager);
stringBuffer.append(TEXT_10);
stringBuffer.append(className);
stringBuffer.append(TEXT_11);
@@ -76,7 +76,7 @@ if (figure.getTargetDecoration() != null) {
} /*if sourceDecoration != null */
stringBuffer.append(TEXT_14);
if (figure.getTargetDecoration() != null) {
- final String className = importManager.getImportedName((String) fqnSwitch.doSwitch(figure.getTargetDecoration()));
+ final String className = fqnSwitch.get(figure.getTargetDecoration(), importManager);
stringBuffer.append(TEXT_15);
stringBuffer.append(className);
stringBuffer.append(TEXT_16);
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java
index 045d735d3..e0b79ef25 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopFigureGenerator.java
@@ -33,7 +33,7 @@ public class TopFigureGenerator
Object[] args = (Object[]) argument;
Figure figure = (Figure) args[0];
final ImportAssistant importManager = (ImportAssistant) args[1];
-final GMFGraphSwitch fqnSwitch = (GMFGraphSwitch) args[2];
+final FigureQualifiedNameSwitch fqnSwitch = (FigureQualifiedNameSwitch) args[2];
final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3];
stringBuffer.append(TEXT_1);
@@ -41,7 +41,7 @@ final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3];
stringBuffer.append(TEXT_2);
stringBuffer.append(figure.getName());
stringBuffer.append(TEXT_3);
- stringBuffer.append(importManager.getImportedName((String) fqnSwitch.doSwitch(figure)));
+ stringBuffer.append(fqnSwitch.get(figure, importManager));
stringBuffer.append(TEXT_4);
stringBuffer.append(figure.getName());
stringBuffer.append(TEXT_5);
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopShapeGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopShapeGenerator.java
index cf8f2940b..361e301bd 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopShapeGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/templates/TopShapeGenerator.java
@@ -58,7 +58,7 @@ public class TopShapeGenerator
Object[] args = (Object[]) argument;
Shape figure = (Shape) args[0];
final ImportAssistant importManager = (ImportAssistant) args[1];
-final GMFGraphSwitch fqnSwitch = (GMFGraphSwitch) args[2];
+final FigureQualifiedNameSwitch fqnSwitch = (FigureQualifiedNameSwitch) args[2];
final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3];
stringBuffer.append(TEXT_1);
@@ -66,7 +66,7 @@ final GraphDefDispatcher dispatcher = (GraphDefDispatcher) args[3];
stringBuffer.append(TEXT_2);
stringBuffer.append(figure.getName());
stringBuffer.append(TEXT_3);
- stringBuffer.append(importManager.getImportedName((String) fqnSwitch.doSwitch(figure)));
+ stringBuffer.append(fqnSwitch.get(figure, importManager));
stringBuffer.append(TEXT_4);
stringBuffer.append(figure.getName());
stringBuffer.append(TEXT_5);
@@ -82,7 +82,7 @@ for (Iterator it = figure.getResolvedChildren().iterator(); it.hasNext();) {
Figure next = (Figure) it.next();
final String childVarName = "child" + next.getName();
stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName((String) fqnSwitch.doSwitch(next)));
+ stringBuffer.append(fqnSwitch.get(next, importManager));
stringBuffer.append(TEXT_9);
stringBuffer.append(childVarName);
stringBuffer.append(TEXT_10);
@@ -102,7 +102,7 @@ for (Iterator it = figure.getResolvedChildren().iterator(); it.hasNext();) {
int fc = 0;
for (Iterator it = figure.getResolvedChildren().iterator(); it.hasNext(); fc++) {
Figure next = (Figure) it.next();
- final String nextClassName = importManager.getImportedName((String) fqnSwitch.doSwitch(next));
+ final String nextClassName = fqnSwitch.get(next, importManager);
stringBuffer.append(TEXT_17);
stringBuffer.append(nextClassName);
stringBuffer.append(TEXT_18);

Back to the top