diff options
94 files changed, 8508 insertions, 9802 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java deleted file mode 100644 index f0f18d5f2..000000000 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.eclipse.gmf.codegen.templates.lite.commands; - -import org.eclipse.gmf.common.codegen.*; - -public class CreateNotationalEdgeCommandGenerator -{ - protected static String nl; - public static synchronized CreateNotationalEdgeCommandGenerator create(String lineSeparator) - { - nl = lineSeparator; - CreateNotationalEdgeCommandGenerator result = new CreateNotationalEdgeCommandGenerator(); - nl = null; - return result; - } - - protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; - protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL; - protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class CreateNotationalEdgeCommand extends CreateNotationalElementCommand {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_4 = " source;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_5 = " target;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic CreateNotationalEdgeCommand("; - protected final String TEXT_6 = " parent, "; - protected final String TEXT_7 = " createdEdge, "; - protected final String TEXT_8 = " source, "; - protected final String TEXT_9 = " target) {" + NL + "\t\tsuper(parent);" + NL + "\t\tthis.source = source;" + NL + "\t\tthis.target = target;" + NL + "\t\tsetCreatedView(createdEdge);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn super.canExecute() && getParent() instanceof "; - protected final String TEXT_10 = " && getCreatedView() instanceof "; - protected final String TEXT_11 = " && this.source != null && this.target != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\t"; - protected final String TEXT_12 = " createdEdge = ("; - protected final String TEXT_13 = ") getCreatedView();" + NL + "\t\t(("; - protected final String TEXT_14 = ")getParent()).insertEdge(createdEdge);" + NL + "\t\tcreatedEdge.setSource(source);" + NL + "\t\tcreatedEdge.setTarget(target);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\t"; - protected final String TEXT_15 = " createdEdge = ("; - protected final String TEXT_16 = ") getCreatedView();" + NL + "\t\t(("; - protected final String TEXT_17 = ")getParent()).removeEdge(createdEdge);" + NL + "\t\tcreatedEdge.setSource(null);" + NL + "\t\tcreatedEdge.setTarget(null);" + NL + "\t}" + NL + "}"; - protected final String TEXT_18 = NL; - - public String generate(Object argument) - { - final StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(TEXT_1); - -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; - - stringBuffer.append(TEXT_2); - -importManager.emitPackageStatement(stringBuffer); -importManager.markImportLocation(stringBuffer); - - stringBuffer.append(TEXT_3); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_9); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_10); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_11); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_12); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_13); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_14); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_15); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_16); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_17); - importManager.emitSortedImports(); - stringBuffer.append(TEXT_18); - return stringBuffer.toString(); - } -} diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java deleted file mode 100644 index ff776f884..000000000 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.gmf.codegen.templates.lite.commands; - -import org.eclipse.gmf.common.codegen.*; - -public class CreateNotationalElementCommandGenerator -{ - protected static String nl; - public static synchronized CreateNotationalElementCommandGenerator create(String lineSeparator) - { - nl = lineSeparator; - CreateNotationalElementCommandGenerator result = new CreateNotationalElementCommandGenerator(); - nl = null; - return result; - } - - protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; - protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL; - protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class CreateNotationalElementCommand extends "; - protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_5 = " parent;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_6 = " createdView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic CreateNotationalElementCommand("; - protected final String TEXT_7 = " parent) {" + NL + "\t\tthis.parent = parent;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final void setCreatedView("; - protected final String TEXT_8 = " view) {" + NL + "\t\tthis.createdView = view;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_9 = " getCreatedView() {" + NL + "\t\treturn createdView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final "; - protected final String TEXT_10 = " getParent() {" + NL + "\t\treturn parent;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn createdView != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn true;" + NL + "\t}" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tparent.insertChild(createdView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\tparent.removeChild(createdView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "}"; - protected final String TEXT_11 = NL; - - public String generate(Object argument) - { - final StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(TEXT_1); - -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; - - stringBuffer.append(TEXT_2); - -importManager.emitPackageStatement(stringBuffer); -importManager.markImportLocation(stringBuffer); - - stringBuffer.append(TEXT_3); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_9); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_10); - importManager.emitSortedImports(); - stringBuffer.append(TEXT_11); - return stringBuffer.toString(); - } -} diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReconnectNotationalEdgeSourceCommandGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReconnectNotationalEdgeSourceCommandGenerator.java deleted file mode 100644 index 9b26f16a1..000000000 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReconnectNotationalEdgeSourceCommandGenerator.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.gmf.codegen.templates.lite.commands; - -import org.eclipse.gmf.common.codegen.*; - -public class ReconnectNotationalEdgeSourceCommandGenerator -{ - protected static String nl; - public static synchronized ReconnectNotationalEdgeSourceCommandGenerator create(String lineSeparator) - { - nl = lineSeparator; - ReconnectNotationalEdgeSourceCommandGenerator result = new ReconnectNotationalEdgeSourceCommandGenerator(); - nl = null; - return result; - } - - protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; - protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL; - protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ReconnectNotationalEdgeSourceCommand extends "; - protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_5 = " edge;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_6 = " newSource;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_7 = " oldSource;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ReconnectNotationalEdgeSourceCommand("; - protected final String TEXT_8 = " edge, "; - protected final String TEXT_9 = " newSource) {" + NL + "\t\tthis.edge = edge;" + NL + "\t\tthis.newSource = newSource;" + NL + "\t}" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn newSource != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn oldSource != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\toldSource = edge.getSource();" + NL + "\t\tedge.setSource(newSource);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\tedge.setSource(oldSource);" + NL + "\t\toldSource = null;" + NL + "\t}" + NL + "}"; - protected final String TEXT_10 = NL; - - public String generate(Object argument) - { - final StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(TEXT_1); - -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; - - stringBuffer.append(TEXT_2); - -importManager.emitPackageStatement(stringBuffer); -importManager.markImportLocation(stringBuffer); - - stringBuffer.append(TEXT_3); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_9); - importManager.emitSortedImports(); - stringBuffer.append(TEXT_10); - return stringBuffer.toString(); - } -} diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReconnectNotationalEdgeTargetCommandGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReconnectNotationalEdgeTargetCommandGenerator.java deleted file mode 100644 index 33fa673a9..000000000 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReconnectNotationalEdgeTargetCommandGenerator.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.gmf.codegen.templates.lite.commands; - -import org.eclipse.gmf.common.codegen.*; - -public class ReconnectNotationalEdgeTargetCommandGenerator -{ - protected static String nl; - public static synchronized ReconnectNotationalEdgeTargetCommandGenerator create(String lineSeparator) - { - nl = lineSeparator; - ReconnectNotationalEdgeTargetCommandGenerator result = new ReconnectNotationalEdgeTargetCommandGenerator(); - nl = null; - return result; - } - - protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; - protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL; - protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ReconnectNotationalEdgeTargetCommand extends "; - protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_5 = " edge;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_6 = " newTarget;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_7 = " oldTarget;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ReconnectNotationalEdgeTargetCommand("; - protected final String TEXT_8 = " edge, "; - protected final String TEXT_9 = " newTarget) {" + NL + "\t\tthis.edge = edge;" + NL + "\t\tthis.newTarget = newTarget;" + NL + "\t}" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn newTarget != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn oldTarget != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\toldTarget = edge.getTarget();" + NL + "\t\tedge.setTarget(newTarget);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\tedge.setTarget(oldTarget);" + NL + "\t\toldTarget = null;" + NL + "\t}" + NL + "}"; - protected final String TEXT_10 = NL; - - public String generate(Object argument) - { - final StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(TEXT_1); - -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; - - stringBuffer.append(TEXT_2); - -importManager.emitPackageStatement(stringBuffer); -importManager.markImportLocation(stringBuffer); - - stringBuffer.append(TEXT_3); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_9); - importManager.emitSortedImports(); - stringBuffer.append(TEXT_10); - return stringBuffer.toString(); - } -} diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java deleted file mode 100644 index b19123d27..000000000 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.eclipse.gmf.codegen.templates.lite.commands; - -import org.eclipse.gmf.common.codegen.*; - -public class RemoveNotationalEdgeCommandGenerator -{ - protected static String nl; - public static synchronized RemoveNotationalEdgeCommandGenerator create(String lineSeparator) - { - nl = lineSeparator; - RemoveNotationalEdgeCommandGenerator result = new RemoveNotationalEdgeCommandGenerator(); - nl = null; - return result; - } - - protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; - protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL; - protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class RemoveNotationalEdgeCommand extends RemoveNotationalElementCommand {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_4 = " source;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_5 = " target;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic RemoveNotationalEdgeCommand("; - protected final String TEXT_6 = " parentView, "; - protected final String TEXT_7 = " childView) {" + NL + "\t\tsuper(parentView, childView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn getParent() instanceof "; - protected final String TEXT_8 = " && getChildView() instanceof "; - protected final String TEXT_9 = NL + "\t\t\t&& (("; - protected final String TEXT_10 = ") getParent()).getEdges().contains(getChildView());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\t"; - protected final String TEXT_11 = " edgeToRemove = ("; - protected final String TEXT_12 = ")getChildView();" + NL + "\t\tsource = edgeToRemove.getSource();" + NL + "\t\ttarget = edgeToRemove.getTarget();" + NL + "\t\tedgeToRemove.setSource(null);" + NL + "\t\tedgeToRemove.setTarget(null);" + NL + "\t\t(("; - protected final String TEXT_13 = ")getParent()).removeEdge(edgeToRemove);" + NL + "\t\tsweepElement();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\trestoreElement();" + NL + "\t\t"; - protected final String TEXT_14 = " edge = ("; - protected final String TEXT_15 = ")getChildView();" + NL + "\t\t(("; - protected final String TEXT_16 = ")getParent()).insertEdge(edge);" + NL + "\t\tedge.setSource(source);" + NL + "\t\tedge.setTarget(target);" + NL + "\t}" + NL + "}"; - protected final String TEXT_17 = NL; - - public String generate(Object argument) - { - final StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(TEXT_1); - -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; - - stringBuffer.append(TEXT_2); - -importManager.emitPackageStatement(stringBuffer); -importManager.markImportLocation(stringBuffer); - - stringBuffer.append(TEXT_3); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_9); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_10); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_11); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_12); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_13); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_14); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_15); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_16); - importManager.emitSortedImports(); - stringBuffer.append(TEXT_17); - return stringBuffer.toString(); - } -} diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java deleted file mode 100644 index 9dad5384d..000000000 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.eclipse.gmf.codegen.templates.lite.commands; - -import org.eclipse.gmf.common.codegen.*; - -public class RemoveNotationalElementCommandGenerator -{ - protected static String nl; - public static synchronized RemoveNotationalElementCommandGenerator create(String lineSeparator) - { - nl = lineSeparator; - RemoveNotationalElementCommandGenerator result = new RemoveNotationalElementCommandGenerator(); - nl = null; - return result; - } - - protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; - protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL; - protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class RemoveNotationalElementCommand extends "; - protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_5 = " childView;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_6 = " parentView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_7 = " domainElement;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_8 = " removeEdgeCommands;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic RemoveNotationalElementCommand("; - protected final String TEXT_9 = " parentView, "; - protected final String TEXT_10 = " childView) {" + NL + "\t\tthis.parentView = parentView;" + NL + "\t\tthis.childView = childView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean prepare() {" + NL + "\t\tif (!parentView.getChildren().contains(childView)) {" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "\t\tremoveEdgeCommands = new "; - protected final String TEXT_11 = "();" + NL + "\t\tfor("; - protected final String TEXT_12 = " it = childView.getSourceEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_13 = " next = ("; - protected final String TEXT_14 = ") it.next();" + NL + "\t\t\tremoveEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next));" + NL + "\t\t}" + NL + "\t\tfor(Iterator it = childView.getTargetEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_15 = " next = ("; - protected final String TEXT_16 = ") it.next();" + NL + "\t\t\tremoveEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next));" + NL + "\t\t}" + NL + "\t\tif (removeEdgeCommands.isEmpty()) {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\treturn removeEdgeCommands.canExecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tparentView.removeChild(childView);" + NL + "\t\tif (!removeEdgeCommands.isEmpty()) {" + NL + "\t\t\tremoveEdgeCommands.execute();" + NL + "\t\t}" + NL + "\t\tsweepElement();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void sweepElement() {" + NL + "\t\tif (childView.isSetElement()) {" + NL + "\t\t\tdomainElement = childView.getElement();" + NL + "\t\t\tchildView.setElement(null);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\trestoreElement();" + NL + "\t\tremoveEdgeCommands.undo();" + NL + "\t\tparentView.insertChild(childView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void restoreElement() {" + NL + "\t\tif (childView.isSetElement()) {" + NL + "\t\t\tchildView.setElement(domainElement);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final "; - protected final String TEXT_17 = " getChildView() {" + NL + "\t\treturn childView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final "; - protected final String TEXT_18 = " getParent() {" + NL + "\t\treturn parentView;" + NL + "\t}" + NL + "}"; - protected final String TEXT_19 = NL; - - public String generate(Object argument) - { - final StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(TEXT_1); - -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; - - stringBuffer.append(TEXT_2); - -importManager.emitPackageStatement(stringBuffer); -importManager.markImportLocation(stringBuffer); - - stringBuffer.append(TEXT_3); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_9); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_10); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_11); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_12); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_13); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_14); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_15); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_16); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_17); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_18); - importManager.emitSortedImports(); - stringBuffer.append(TEXT_19); - return stringBuffer.toString(); - } -} diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java deleted file mode 100644 index eb120ba2c..000000000 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.eclipse.gmf.codegen.templates.lite.commands; - -import org.eclipse.gmf.common.codegen.*; - -public class ReplaceNotationalElementCommandGenerator -{ - protected static String nl; - public static synchronized ReplaceNotationalElementCommandGenerator create(String lineSeparator) - { - nl = lineSeparator; - ReplaceNotationalElementCommandGenerator result = new ReplaceNotationalElementCommandGenerator(); - nl = null; - return result; - } - - protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; - protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL; - protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ReplaceNotationalElementCommand extends "; - protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final CreateNotationalElementCommand createCommand;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final RemoveNotationalElementCommand removeCommand;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final "; - protected final String TEXT_5 = " obsoleteView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ReplaceNotationalElementCommand("; - protected final String TEXT_6 = " parentView, CreateNotationalElementCommand createCommand, "; - protected final String TEXT_7 = " obsoleteView) {" + NL + "\t\tthis.createCommand = createCommand;" + NL + "\t\tthis.obsoleteView = obsoleteView;" + NL + "\t\tthis.removeCommand = obsoleteView instanceof "; - protected final String TEXT_8 = " ? new RemoveNotationalEdgeCommand(parentView, obsoleteView) : new RemoveNotationalElementCommand(parentView, obsoleteView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn createCommand != null && createCommand.canExecute() && removeCommand != null && removeCommand.canExecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn createCommand != null && createCommand.canUndo() && removeCommand != null && removeCommand.canUndo();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tcreateCommand.execute();" + NL + "\t\tremoveCommand.execute();" + NL + "\t\t"; - protected final String TEXT_9 = " createdView = createCommand.getCreatedView();" + NL + "//\t\tcreatedView.getSourceEdges().addAll(obsoleteView.getSourceEdges());" + NL + "//\t\tcreatedView.getTargetEdges().addAll(obsoleteView.getTargetEdges());" + NL + "\t\tif (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) {" + NL + "\t\t\tif ("; - protected final String TEXT_10 = ".eINSTANCE.getNode().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, "; - protected final String TEXT_11 = ".eINSTANCE.getNode_LayoutConstraint());" + NL + "\t\t\t} else if ("; - protected final String TEXT_12 = ".eINSTANCE.getEdge().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, "; - protected final String TEXT_13 = ".eINSTANCE.getEdge_Bendpoints());" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void copy("; - protected final String TEXT_14 = " source, "; - protected final String TEXT_15 = " target, "; - protected final String TEXT_16 = " feature) {" + NL + "\t\t"; - protected final String TEXT_17 = " oldValue = ("; - protected final String TEXT_18 = ") source.eGet(feature);" + NL + "\t\tif (oldValue == null) {" + NL + "\t\t\treturn;\t//nothing to copy" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_19 = " newValue = ("; - protected final String TEXT_20 = ") target.eGet(feature);" + NL + "\t\tif (newValue != null && !newValue.eClass().equals(oldValue.eClass())) {" + NL + "\t\t\treturn;\t//incompatible instances." + NL + "\t\t}" + NL + "\t\ttarget.eSet(feature, oldValue);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\t"; - protected final String TEXT_21 = " createdView = createCommand.getCreatedView();" + NL + "\t\tif (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) {" + NL + "\t\t\tif ("; - protected final String TEXT_22 = ".eINSTANCE.getNode().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, "; - protected final String TEXT_23 = ".eINSTANCE.getNode_LayoutConstraint());" + NL + "\t\t\t} else if ("; - protected final String TEXT_24 = ".eINSTANCE.getEdge().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, "; - protected final String TEXT_25 = ".eINSTANCE.getEdge_Bendpoints());" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "//\t\tobsoleteView.getSourceEdges().addAll(createdView.getSourceEdges());" + NL + "//\t\tobsoleteView.getTargetEdges().addAll(createdView.getTargetEdges());" + NL + "\t\tremoveCommand.undo();" + NL + "\t\tcreateCommand.undo();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "}"; - protected final String TEXT_26 = NL; - - public String generate(Object argument) - { - final StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(TEXT_1); - -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; - - stringBuffer.append(TEXT_2); - -importManager.emitPackageStatement(stringBuffer); -importManager.markImportLocation(stringBuffer); - - stringBuffer.append(TEXT_3); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_9); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_10); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_11); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_12); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_13); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_14); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_15); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_16); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_17); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_18); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_19); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_20); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_21); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_22); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_23); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_24); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_25); - importManager.emitSortedImports(); - stringBuffer.append(TEXT_26); - return stringBuffer.toString(); - } -} diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java index 7db592300..eb296af6a 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java @@ -19,124 +19,207 @@ public class EditorGenerator protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = ""; protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_3 = " extends GraphicalEditorWithFlyoutPalette {"; - protected final String TEXT_4 = NL + "\t/**" + NL + "\t * This class listens to changes to the file system in the workspace, and" + NL + "\t * makes the following changes: " + NL + "\t * <ul><li>If an open, saved file gets deleted, the editor is closed.</li>" + NL + "\t * <li>If an open file gets renamed or moved, the editor's" + NL + "\t * input is changed accordingly.</li></ul>" + NL + "\t *" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class ResourceTracker implements "; - protected final String TEXT_5 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void resourceChanged("; - protected final String TEXT_6 = " event) {" + NL + "\t\t\t"; - protected final String TEXT_7 = " delta = event.getDelta();" + NL + "\t\t\tif (delta != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_8 = " fileDelta = delta.findMember((("; - protected final String TEXT_9 = ") getEditorInput()).getFile().getFullPath());" + NL + "\t\t\t\tif (fileDelta != null) {" + NL + "\t\t\t\t\tprocessFileDelta(fileDelta);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void processFileDelta("; - protected final String TEXT_10 = " delta) {" + NL + "\t\t\tassert (delta != null && delta.getResource().equals((("; - protected final String TEXT_11 = ") getEditorInput()).getFile()));" + NL + "\t\t\tif (delta.getKind() == "; - protected final String TEXT_12 = ".REMOVED) {" + NL + "\t\t\t\tif (("; - protected final String TEXT_13 = ".MOVED_TO & delta.getFlags()) == 0) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_14 = NL + "\t\t\t\t\tif (!isDirty()) {" + NL + "\t\t\t\t\t\tcloseEditor();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\t// else if it was moved or renamed" + NL + "\t\t\t\t\tfinal "; - protected final String TEXT_15 = " newFile = "; - protected final String TEXT_16 = ".getWorkspace().getRoot().getFile(delta.getMovedToPath());" + NL + "\t\t\t\t\t"; - protected final String TEXT_17 = " display = getSite().getShell().getDisplay();" + NL + "\t\t\t\t\tdisplay.asyncExec(new Runnable() {" + NL + "\t\t\t\t\t\tpublic void run() {" + NL + "\t\t\t\t\t\t\tsetInput(new "; - protected final String TEXT_18 = "(newFile));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t});" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ResourceTracker resourceTracker;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ResourceTracker getResourceTracker() {" + NL + "\t\tif (resourceTracker == null) {" + NL + "\t\t\tresourceTracker = new ResourceTracker();" + NL + "\t\t}" + NL + "\t\treturn resourceTracker;" + NL + "\t}" + NL; - protected final String TEXT_19 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class UpdatableActionGroup {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void addAction(UpdateAction action) {" + NL + "\t\t\tassert action != null;" + NL + "\t\t\tmyActions.add(action);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void removeAction(UpdateAction action) {" + NL + "\t\t\tmyActions.remove(action);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void update() {" + NL + "\t\t\tfor (Iterator it = myActions.iterator(); it.hasNext();) {" + NL + "\t\t\t\tUpdateAction next = (UpdateAction) it.next();" + NL + "\t\t\t\tnext.update();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ArrayList myActions = new ArrayList();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Copied from <code>org.eclipse.gef.ui.properties.UndoablePropertySheetEntry</code> to provide EMF compatibility." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final class UndoablePropertySheetEntry extends "; - protected final String TEXT_20 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate static class SetValueCommand extends "; - protected final String TEXT_21 = " {" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected Object propertyValue;" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected Object propertyName;" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected Object undoValue;" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected boolean resetOnUndo;" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected "; - protected final String TEXT_22 = " target;" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic SetValueCommand() {" + NL + "\t\t\t\tsuper(\"\"); //$NON-NLS-1$" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic SetValueCommand(String propLabel) {" + NL + "\t\t\t\tsuper("; - protected final String TEXT_23 = ".format(\"Set {0} property\", new Object[]{propLabel}).trim());" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void execute() {" + NL + "\t\t\t\t/*" + NL + "\t\t\t\t * Fix for Bug# 54250" + NL + "\t\t\t\t * IPropertySource.isPropertySet(String) returns false both when there is no default " + NL + "\t\t\t\t * value, and when there is a default value and the property is set to that value." + NL + "\t\t\t\t * To correctly determine if a reset should be done during undo, we compare the" + NL + "\t\t\t\t * return value of isPropertySet(String) before and after setPropertyValue(...) is" + NL + "\t\t\t\t * invoked. If they are different (it must have been false before and true after --" + NL + "\t\t\t\t * it cannot be the other way around), then that means we need to reset." + NL + "\t\t\t\t */" + NL + "\t\t\t\tboolean wasPropertySet = getTarget().isPropertySet(propertyName);" + NL + "\t\t\t\tundoValue = getTarget().getPropertyValue(propertyName);" + NL + "\t\t\t\tif (undoValue instanceof "; - protected final String TEXT_24 = ") {" + NL + "\t\t\t\t\tundoValue = (("; - protected final String TEXT_25 = ")undoValue).getEditableValue();" + NL + "\t\t\t\t} else if (undoValue instanceof "; - protected final String TEXT_26 = ") {" + NL + "\t\t\t\t\tundoValue = (("; - protected final String TEXT_27 = ")undoValue).getEditableValue(propertyName);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (propertyValue instanceof "; - protected final String TEXT_28 = ")" + NL + "\t\t\t\t\tpropertyValue = (("; - protected final String TEXT_29 = ")propertyValue).getEditableValue();" + NL + "\t\t\t\tgetTarget().setPropertyValue(propertyName, propertyValue);" + NL + "\t\t\t\tif (getTarget() instanceof "; - protected final String TEXT_30 = ")" + NL + "\t\t\t\t\tresetOnUndo = !wasPropertySet" + NL + "\t\t\t\t\t\t\t&& (("; - protected final String TEXT_31 = ")getTarget()).isPropertyResettable(propertyName);" + NL + "\t\t\t\telse" + NL + "\t\t\t\t\tresetOnUndo = !wasPropertySet && getTarget().isPropertySet(propertyName);" + NL + "\t\t\t\tif (resetOnUndo)" + NL + "\t\t\t\t\tundoValue = null;" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic "; - protected final String TEXT_32 = " getTarget() {" + NL + "\t\t\t\treturn target;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void setTarget("; - protected final String TEXT_33 = " aTarget) {" + NL + "\t\t\t\ttarget = aTarget;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void redo() {" + NL + "\t\t\t\texecute();" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void setPropertyId(Object pName) {" + NL + "\t\t\t\tpropertyName = pName;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void setPropertyValue(Object val) {" + NL + "\t\t\t\tpropertyValue = val;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void undo() {" + NL + "\t\t\t\tif (resetOnUndo)" + NL + "\t\t\t\t\tgetTarget().resetPropertyValue(propertyName);" + NL + "\t\t\t\telse" + NL + "\t\t\t\t\tgetTarget().setPropertyValue(propertyName, undoValue);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate static class ResetValueCommand extends "; - protected final String TEXT_34 = " {" + NL + "\t\t\t/** " + NL + "\t\t\t * the property that has to be reset " + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected Object propertyName;" + NL + "\t\t\t/** " + NL + "\t\t\t * the current non-default value of the property " + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected Object undoValue;" + NL + "\t\t\t/**" + NL + "\t\t\t * the property source whose property has to be reset " + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tprotected "; - protected final String TEXT_35 = " target;" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * Default Constructor: Sets the label for the Command" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic ResetValueCommand() {" + NL + "\t\t\t\tsuper(\"Restore Default Value\");" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * Returns <code>true</code> IFF:<br>" + NL + "\t\t\t * 1) the target and property have been specified<br>" + NL + "\t\t\t * 2) the property has a default value<br>" + NL + "\t\t\t * 3) the value set for that property is not the default" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\tboolean answer = false;" + NL + "\t\t\t\tif (target != null && propertyName != null) {" + NL + "\t\t\t\t\tanswer = target.isPropertySet(propertyName);" + NL + "\t\t\t\t\tif (target instanceof "; - protected final String TEXT_36 = ")" + NL + "\t\t\t\t\t\tanswer = answer " + NL + "\t\t\t\t\t\t\t\t&& ((("; - protected final String TEXT_37 = ")target).isPropertyResettable(propertyName));" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn answer;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * Caches the undo value and invokes redo()" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void execute() {" + NL + "\t\t\t\tundoValue = target.getPropertyValue(propertyName);" + NL + "\t\t\t\tif (undoValue instanceof "; - protected final String TEXT_38 = ") {" + NL + "\t\t\t\t\tundoValue = (("; - protected final String TEXT_39 = ")undoValue).getEditableValue();" + NL + "\t\t\t\t} else if (undoValue instanceof "; - protected final String TEXT_40 = ") {" + NL + "\t\t\t\t\tundoValue = (("; - protected final String TEXT_41 = ")undoValue).getEditableValue(propertyName);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tredo();" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * Sets the IPropertySource." + NL + "\t\t\t * @param propSource the IPropertySource whose property has to be reset" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void setTarget("; - protected final String TEXT_42 = " propSource) {" + NL + "\t\t\t\ttarget = propSource;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * Resets the specified property on the specified IPropertySource" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void redo() {" + NL + "\t\t\t\ttarget.resetPropertyValue(propertyName);" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * Sets the property that is to be reset." + NL + "\t\t\t * @param pName the property to be reset" + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void setPropertyId(Object pName) {" + NL + "\t\t\t\tpropertyName = pName;" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t\t/**" + NL + "\t\t\t * Restores the non-default value that was reset. " + NL + "\t\t\t * @generated" + NL + "\t\t\t */" + NL + "\t\t\tpublic void undo() {" + NL + "\t\t\t\ttarget.setPropertyValue(propertyName, undoValue);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_43 = " commandStackListener;" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_44 = " stack;" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate UndoablePropertySheetEntry() { }" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Constructs the root entry using the given command stack." + NL + "\t\t * @param stack the command stack" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic UndoablePropertySheetEntry("; - protected final String TEXT_45 = " stack) {" + NL + "\t\t\tsetCommandStack(stack);" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_46 = " createChildEntry() {" + NL + "\t\t\treturn new UndoablePropertySheetEntry();" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void dispose() {" + NL + "\t\t\tif (stack != null)" + NL + "\t\t\t\tstack.removeCommandStackListener(commandStackListener);" + NL + "\t\t\tsuper.dispose();" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\t"; - protected final String TEXT_47 = " getCommandStack() {" + NL + "\t\t\t//only the root has, and is listening to the command stack" + NL + "\t\t\tif (getParent() != null)" + NL + "\t\t\t\treturn ((UndoablePropertySheetEntry)getParent()).getCommandStack();" + NL + "\t\t\treturn stack;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void resetPropertyValue() {" + NL + "\t\t\t"; - protected final String TEXT_48 = " cc = new "; - protected final String TEXT_49 = "();" + NL + "\t\t\tResetValueCommand restoreCmd;" + NL + "\t" + NL + "\t\t\tif (getParent() == null)" + NL + "\t\t\t\t// root does not have a default value" + NL + "\t\t\t\treturn;" + NL + "\t" + NL + "\t\t\t//\tUse our parent's values to reset our values." + NL + "\t\t\tboolean change = false;" + NL + "\t\t\tObject[] objects = getParent().getValues();" + NL + "\t\t\tfor (int i = 0; i < objects.length; i++) {" + NL + "\t\t\t\t"; - protected final String TEXT_50 = " source = getPropertySource(objects[i]);" + NL + "\t\t\t\tif (source.isPropertySet(getDescriptor().getId())) {" + NL + "\t\t\t\t\t//source.resetPropertyValue(getDescriptor()getId());" + NL + "\t\t\t\t\trestoreCmd = new ResetValueCommand();" + NL + "\t\t\t\t\trestoreCmd.setTarget(source);" + NL + "\t\t\t\t\trestoreCmd.setPropertyId(getDescriptor().getId());" + NL + "\t\t\t\t\tcc.add(restoreCmd);\t\t\t" + NL + "\t\t\t\t\tchange = true;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (change) {" + NL + "\t\t\t\tgetCommandStack().execute(cc);" + NL + "\t\t\t\trefreshFromRoot();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tvoid setCommandStack("; - protected final String TEXT_51 = " stack) {" + NL + "\t\t\tthis.stack = stack;" + NL + "\t\t\tcommandStackListener = new "; - protected final String TEXT_52 = "() {" + NL + "\t\t\t\tpublic void commandStackChanged("; - protected final String TEXT_53 = " e) {" + NL + "\t\t\t\t\trefreshFromRoot();" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tstack.addCommandStackListener(commandStackListener);" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void valueChanged("; - protected final String TEXT_54 = " child) {" + NL + "\t\t\tvalueChanged((UndoablePropertySheetEntry)child," + NL + "\t\t\t\t\tnew "; - protected final String TEXT_55 = "());" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tvoid valueChanged(UndoablePropertySheetEntry child, "; - protected final String TEXT_56 = " command) {" + NL + "\t\t\t"; - protected final String TEXT_57 = " cc = new "; - protected final String TEXT_58 = "();" + NL + "\t\t\tcommand.add(cc);" + NL + "\t" + NL + "\t\t\tSetValueCommand setCommand;" + NL + "\t\t\tfor (int i = 0; i < getValues().length; i++) {" + NL + "\t\t\t\tsetCommand = new SetValueCommand(child.getDisplayName());" + NL + "\t\t\t\tsetCommand.setTarget(getPropertySource(getValues()[i]));" + NL + "\t\t\t\tsetCommand.setPropertyId(child.getDescriptor().getId());" + NL + "\t\t\t\tsetCommand.setPropertyValue(child.getValues()[i]);" + NL + "\t\t\t\tcc.add(setCommand);" + NL + "\t\t\t}" + NL + "\t" + NL + "\t\t\t// inform our parent" + NL + "\t\t\tif (getParent() != null)" + NL + "\t\t\t\t((UndoablePropertySheetEntry)getParent()).valueChanged(this, command);" + NL + "\t\t\telse {" + NL + "\t\t\t\t//I am the root entry" + NL + "\t\t\t\tstack.execute(command);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TransactionalEditingDomain editingDomain;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_59 = " diagramRoot;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_60 = " diagram;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean isDirty = false;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PaletteRoot paletteRoot;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PropertySheetPage undoablePropertySheetPage;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup stackActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CommandStackListener commandStackListener = new CommandStackListener() {" + NL + "" + NL + "\t\tpublic void commandStackChanged(EventObject event) {" + NL + "\t\t\tstackActions.update();" + NL + "\t\t\tsetDirty(((CommandStack) event.getSource()).isDirty());" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup editPartActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ISelectionListener selectionListener = new ISelectionListener() {" + NL + "" + NL + "\t\tpublic void selectionChanged(IWorkbenchPart part, ISelection selection) {" + NL + "\t\t\teditPartActions.update();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup editorActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ComposedAdapterFactory domainAdapterFactory;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void firePropertyChange(int propertyId) {" + NL + "\t\tsuper.firePropertyChange(propertyId);" + NL + "\t\teditorActions.update();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an action to this editor's <code>ActionRegistry</code>. (This is" + NL + "\t * a helper method.)" + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t * the action to add." + NL + "\t */" + NL + "\tprotected void addAction(IAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an editor action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * Editor actions are actions that depend and work on the editor." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t * the editor action" + NL + "\t */" + NL + "\tprotected void addEditorAction(WorkbenchPartAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\teditorActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an <code>EditPart</code> action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * <code>EditPart</code> actions are actions that depend and work on the" + NL + "\t * selected <code>EditPart</code>s." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t * the <code>EditPart</code> action" + NL + "\t */" + NL + "\tprotected void addEditPartAction(SelectionAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\teditPartActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an <code>CommandStack</code> action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * <code>CommandStack</code> actions are actions that depend and work on" + NL + "\t * the <code>CommandStack</code>." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t * the <code>CommandStack</code> action" + NL + "\t */" + NL + "\tprotected void addStackAction(StackAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\tstackActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createActions() {" + NL + "\t\taddStackAction(new UndoAction(this));" + NL + "\t\taddStackAction(new RedoAction(this));" + NL + "" + NL + "\t\taddEditPartAction(new DeleteAction((IWorkbenchPart) this));" + NL + "\t\taddEditPartAction(new DirectEditAction((IWorkbenchPart) this));" + NL + "" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.LEFT));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.RIGHT));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.TOP));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.BOTTOM));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.CENTER));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.MIDDLE));" + NL + "" + NL + "\t\taddEditorAction(new SaveAction(this));" + NL + "\t\taddEditorAction(new PrintAction(this));" + NL + "" + NL + "\t\tIAction zoomIn = new ZoomInAction(getZoomManager());" + NL + "\t\tIAction zoomOut = new ZoomOutAction(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t}" + NL; - protected final String TEXT_61 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tvoid closeEditor() {" + NL + "\t\tgetSite().getShell().getDisplay().syncExec(new Runnable() {" + NL + "\t\t\tpublic void run() {" + NL + "\t\t\t\tgetSite().getPage().closeEditor("; - protected final String TEXT_62 = ".this, false);" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}"; - protected final String TEXT_63 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void dispose() {" + NL + "\t\t// remove CommandStackListener" + NL + "\t\tgetCommandStack().removeCommandStackListener(getStackActionsListener());" + NL + "" + NL + "\t\t// remove selection listener" + NL + "\t\tgetSite().getWorkbenchWindow().getSelectionService().removeSelectionListener(getSelectionListener());" + NL + "" + NL + "\t\t// dispose the ActionRegistry (will dispose all actions)" + NL + "\t\tgetActionRegistry().dispose();" + NL + "" + NL + "\t\t// important: always call super implementation of dispose" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void doSave(IProgressMonitor monitor) {" + NL + "\t\ttry {" + NL + "\t\t\tsave(monitor);" + NL + "\t\t\tgetCommandStack().markSaveLocation();" + NL + "\t\t} catch (CoreException e) {" + NL + "\t\t\tErrorDialog.openError(getSite().getShell(), \"Error During Save\", \"The current "; - protected final String TEXT_64 = " model could not be saved.\", e.getStatus());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void save(IProgressMonitor progressMonitor) throws CoreException {" + NL + "\t\tif (progressMonitor == null) {" + NL + "\t\t\tprogressMonitor = new NullProgressMonitor();" + NL + "\t\t}" + NL + "\t\tprogressMonitor.beginTask(\"Saving\", getEditingDomain().getResourceSet().getResources().size());" + NL + "\t\ttry {" + NL + "\t\t\tfor(Iterator it = getEditingDomain().getResourceSet().getResources().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\tResource next = (Resource)it.next();" + NL + "\t\t\t\tnext.save(Collections.EMPTY_MAP);" + NL + "\t\t\t\tprogressMonitor.worked(1);" + NL + "\t\t\t}" + NL + "\t\t} catch (IOException e) {" + NL + "\t\t\tIStatus status = new Status(IStatus.ERROR, "; - protected final String TEXT_65 = ".ID, 0, \"Error writing file.\", e);" + NL + "\t\t\tthrow new CoreException(status);" + NL + "\t\t} finally {" + NL + "\t\t\tprogressMonitor.done();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isSaveAsAllowed() {" + NL + "\t\t// TODO: should be allowed." + NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void doSaveAs() {" + NL + "\t\t// TODO: Implement." + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class type) {" + NL + "\t\tif (type == IPropertySheetPage.class) {" + NL + "\t\t\treturn getPropertySheetPage();" + NL + "\t\t} else if (type == IContentOutlinePage.class) {" + NL + "\t\t\treturn getOutlinePage();" + NL + "\t\t} else if (type == ZoomManager.class) {" + NL + "\t\t\treturn getZoomManager();" + NL + "\t\t}" + NL + "\t\treturn super.getAdapter(type);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ZoomManager getZoomManager() {" + NL + "\t\treturn getZoomManager(getGraphicalViewer());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ZoomManager getZoomManager(GraphicalViewer viewer) {" + NL + "\t\t// get zoom manager from root edit part" + NL + "\t\tRootEditPart rootEditPart = viewer.getRootEditPart();" + NL + "\t\tZoomManager zoomManager = null;" + NL + "\t\tif (rootEditPart instanceof ScalableFreeformRootEditPart) {" + NL + "\t\t\tzoomManager = ((ScalableFreeformRootEditPart) rootEditPart).getZoomManager();" + NL + "\t\t} else if (rootEditPart instanceof ScalableRootEditPart) {" + NL + "\t\t\tzoomManager = ((ScalableRootEditPart) rootEditPart).getZoomManager();" + NL + "\t\t}" + NL + "\t\treturn zoomManager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CommandStackListener getStackActionsListener() {" + NL + "\t\treturn commandStackListener;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IContentOutlinePage getOutlinePage() {" + NL + "\t\t//TODO: outline page missing" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected PaletteRoot getPaletteRoot() {" + NL + "\t\tif (paletteRoot == null) {" + NL + "\t\t\tpaletteRoot = new PaletteRoot();"; - protected final String TEXT_66 = NL + "\t\t\tnew "; - protected final String TEXT_67 = "(getDomainAdapterFactory()).contributeToPalette(paletteRoot);"; - protected final String TEXT_68 = NL + "\t\t}" + NL + "\t\treturn paletteRoot;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected PropertySheetPage getPropertySheetPage() {" + NL + "\t\tif (undoablePropertySheetPage == null) {" + NL + "\t\t\tundoablePropertySheetPage = new PropertySheetPage();" + NL + "\t\t\tUndoablePropertySheetEntry rootEntry = new UndoablePropertySheetEntry(getCommandStack());" + NL + "\t\t\trootEntry.setPropertySourceProvider(new "; - protected final String TEXT_69 = "(getDomainAdapterFactory()));" + NL + "\t\t\tundoablePropertySheetPage.setRootEntry(rootEntry);" + NL + "\t\t}" + NL + "" + NL + "\t\treturn undoablePropertySheetPage;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ISelectionListener getSelectionListener() {" + NL + "\t\treturn selectionListener;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_70 = " getDiagramRoot() {" + NL + "\t\treturn diagramRoot;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Diagram getDiagram() {" + NL + "\t\treturn diagram;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void init(IEditorSite site, IEditorInput input) throws PartInitException {" + NL + "\t\tURI file = getURIFromInput(input);" + NL + "\t\tif (file == null) {" + NL + "\t\t\tthrow new PartInitException(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t\tsetSite(site);" + NL + "\t\tsetInput(input);" + NL + "\t\tsetEditDomain(new DefaultEditDomain(this));" + NL + "" + NL + "\t\t// validate" + NL + "\t\tif (getDiagramRoot() == null) {" + NL + "\t\t\tthrow new PartInitException(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "" + NL + "\t\t// add CommandStackListener" + NL + "\t\tgetCommandStack().addCommandStackListener(getStackActionsListener());" + NL + "" + NL + "\t\t// add selection change listener" + NL + "\t\tgetSite().getWorkbenchWindow().getSelectionService().addSelectionListener(getSelectionListener());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setInput(IEditorInput input) {"; - protected final String TEXT_71 = NL + "\t\tif (getEditorInput() instanceof "; - protected final String TEXT_72 = ") {" + NL + "\t\t\t"; - protected final String TEXT_73 = " resource = (("; - protected final String TEXT_74 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().removeResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; - protected final String TEXT_75 = NL + "\t\tURI file = getURIFromInput(input);" + NL + "\t\tload(file);" + NL + "\t\tsetPartName(file.lastSegment());" + NL + "\t\tsuper.setInput(input);"; - protected final String TEXT_76 = NL + "\t\tif (getEditorInput() instanceof "; - protected final String TEXT_77 = ") {" + NL + "\t\t\t"; - protected final String TEXT_78 = " resource = (("; - protected final String TEXT_79 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().addResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; - protected final String TEXT_80 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate URI getURIFromInput(IEditorInput input) {"; - protected final String TEXT_81 = NL + "\t\tif (input instanceof "; - protected final String TEXT_82 = ") {" + NL + "\t\t\treturn (("; - protected final String TEXT_83 = ") input).getURI();" + NL + "\t\t}" + NL + "\t\tif (input instanceof "; - protected final String TEXT_84 = ") {" + NL + "\t\t\treturn URI.createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}"; - protected final String TEXT_85 = NL + "\t\tif (input instanceof "; - protected final String TEXT_86 = ") {" + NL + "\t\t\treturn URI.createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}"; - protected final String TEXT_87 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isDirty() {" + NL + "\t\treturn isDirty;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void setDirty(boolean dirty) {" + NL + "\t\tif (isDirty != dirty) {" + NL + "\t\t\tisDirty = dirty;" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected TransactionalEditingDomain getEditingDomain() {" + NL + "\t\tif (editingDomain == null) {" + NL + "\t\t\teditingDomain = "; - protected final String TEXT_88 = ".INSTANCE.createEditingDomain();" + NL + "\t\t\t//editingDomain.setAdapterFactory(getDomainAdapterFactory());" + NL + "\t\t\teditingDomain.getResourceSet().eAdapters().add(new AdapterFactoryEditingDomain.EditingDomainProvider(editingDomain));" + NL + "\t\t}" + NL + "\t\treturn editingDomain;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate AdapterFactory getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\tList factories = new ArrayList();" + NL + "\t\t\tfactories.add(new ResourceItemProviderAdapterFactory());"; - protected final String TEXT_89 = NL + "\t\t\tfactories.add(new "; - protected final String TEXT_90 = "());"; - protected final String TEXT_91 = NL + "\t\t\tfactories.add(new ReflectiveItemProviderAdapterFactory());" + NL + "\t\t\tfactories.add(new NotationItemProviderAdapterFactory());" + NL + "\t\t\tdomainAdapterFactory = new ComposedAdapterFactory(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load(URI diagramFile) {" + NL + "\t\tdiagramRoot = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tTransactionalEditingDomain editingDomain = getEditingDomain();" + NL + "\t\tResourceSet resourceSet = editingDomain.getResourceSet();" + NL + "\t\tResource diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = (Diagram) findInResource(diagramResource, Diagram.class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = NotationFactory.eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save(Collections.EMPTY_MAP);" + NL + "\t\t\t} catch (IOException e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tdiagramRoot = ("; - protected final String TEXT_92 = ") diagram.getElement();" + NL + "\t\tif (diagramRoot == null) {"; - protected final String TEXT_93 = NL + "\t\t\tURI modelFile = "; - protected final String TEXT_94 = ".getModelFileURI(diagramFile);" + NL + "\t\t\tResource modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}"; - protected final String TEXT_95 = NL + "\t\t\tdiagramRoot = ("; - protected final String TEXT_96 = ") findInResource("; - protected final String TEXT_97 = ", "; - protected final String TEXT_98 = ".class);" + NL + "\t\t\tif (diagramRoot == null) {" + NL + "\t\t\t\tdiagramRoot = "; - protected final String TEXT_99 = ".eINSTANCE.create"; - protected final String TEXT_100 = "();" + NL + "\t\t\t\t"; - protected final String TEXT_101 = ".getContents().add(0, diagramRoot);" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t"; - protected final String TEXT_102 = ".save(Collections.EMPTY_MAP);" + NL + "\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement("; - protected final String TEXT_103 = "("; - protected final String TEXT_104 = ") "; - protected final String TEXT_105 = "diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_106 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource(Resource resource, Class expectedClass) {" + NL + "\t\tfor(Iterator it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setFocus() {" + NL + "\t\tgetGraphicalViewer().getControl().setFocus();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic final void createPartControl(Composite parent) {" + NL + "\t\tsuper.createPartControl(parent);" + NL + "\t\t// initialize actions" + NL + "\t\tcreateActions();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer(Composite parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\tScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new "; - protected final String TEXT_107 = "());" + NL + "" + NL + "\t\t"; - protected final String TEXT_108 = " printableLayers = ("; - protected final String TEXT_109 = ") root.getLayer("; - protected final String TEXT_110 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; - protected final String TEXT_111 = " extLabelsLayer = new "; - protected final String TEXT_112 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; - protected final String TEXT_113 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; - protected final String TEXT_114 = ".EXTERNAL_NODE_LABELS_LAYER, "; - protected final String TEXT_115 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\tGraphicalViewer viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\tContextMenuProvider provider = new "; - protected final String TEXT_116 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; - protected final String TEXT_117 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\tKeyHandler keyHandler = new GraphicalViewerKeyHandler(viewer);" + NL + "\t\tkeyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId()));" + NL + "\t\tkeyHandler.put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class "; - protected final String TEXT_118 = "ContextMenuProvider extends ContextMenuProvider {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_119 = "ContextMenuProvider(EditPartViewer viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t public void buildContextMenu(IMenuManager menuManager) {" + NL + "\t GEFActionConstants.addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.UNDO.getId(), GEFActionConstants.GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.REDO.getId(), GEFActionConstants.GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.COPY.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.PASTE.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.DELETE.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, GEFActionConstants.DIRECT_EDIT, GEFActionConstants.GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.SAVE.getId(), GEFActionConstants.GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu(IMenuManager menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\tMenuManager submenu = new MenuManager(\"Align\");" + NL + "\t\t\tsubmenu.add(new Separator(GEFActionConstants.MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_LEFT, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_CENTER, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_RIGHT, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_TOP, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_MIDDLE, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_BOTTOM, GEFActionConstants.MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup(GEFActionConstants.GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu(IMenuManager menu, String actionId, String menuGroup) {" + NL + "\t\t\tIAction action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}"; - protected final String TEXT_120 = NL; + protected final String TEXT_3 = " extends "; + protected final String TEXT_4 = " {"; + protected final String TEXT_5 = NL + "\t/**" + NL + "\t * This class listens to changes to the file system in the workspace, and" + NL + "\t * makes the following changes: " + NL + "\t * <ul><li>If an open, saved file gets deleted, the editor is closed.</li>" + NL + "\t * <li>If an open file gets renamed or moved, the editor's" + NL + "\t * input is changed accordingly.</li></ul>" + NL + "\t *" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class ResourceTracker implements "; + protected final String TEXT_6 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void resourceChanged("; + protected final String TEXT_7 = " event) {" + NL + "\t\t\t"; + protected final String TEXT_8 = " delta = event.getDelta();" + NL + "\t\t\tif (delta != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_9 = " fileDelta = delta.findMember((("; + protected final String TEXT_10 = ") getEditorInput()).getFile().getFullPath());" + NL + "\t\t\t\tif (fileDelta != null) {" + NL + "\t\t\t\t\tprocessFileDelta(fileDelta);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void processFileDelta("; + protected final String TEXT_11 = " delta) {" + NL + "\t\t\tassert (delta != null && delta.getResource().equals((("; + protected final String TEXT_12 = ") getEditorInput()).getFile()));" + NL + "\t\t\tif (delta.getKind() == "; + protected final String TEXT_13 = ".REMOVED) {" + NL + "\t\t\t\tif (("; + protected final String TEXT_14 = ".MOVED_TO & delta.getFlags()) == 0) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_15 = NL + "\t\t\t\t\tif (!isDirty()) {" + NL + "\t\t\t\t\t\tcloseEditor();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\t// else if it was moved or renamed" + NL + "\t\t\t\t\tfinal "; + protected final String TEXT_16 = " newFile = "; + protected final String TEXT_17 = ".getWorkspace().getRoot().getFile(delta.getMovedToPath());" + NL + "\t\t\t\t\t"; + protected final String TEXT_18 = " display = getSite().getShell().getDisplay();" + NL + "\t\t\t\t\tdisplay.asyncExec(new Runnable() {" + NL + "\t\t\t\t\t\tpublic void run() {" + NL + "\t\t\t\t\t\t\tsetInput(new "; + protected final String TEXT_19 = "(newFile));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t});" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ResourceTracker resourceTracker;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ResourceTracker getResourceTracker() {" + NL + "\t\tif (resourceTracker == null) {" + NL + "\t\t\tresourceTracker = new ResourceTracker();" + NL + "\t\t}" + NL + "\t\treturn resourceTracker;" + NL + "\t}" + NL; + protected final String TEXT_20 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_21 = " diagramRoot;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_22 = " diagram;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_23 = " domainAdapterFactory;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createActions() {" + NL + "\t\taddStackAction(new "; + protected final String TEXT_24 = "(this));" + NL + "\t\taddStackAction(new "; + protected final String TEXT_25 = "(this));" + NL + "" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_26 = "(("; + protected final String TEXT_27 = ") this));" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_28 = "(("; + protected final String TEXT_29 = ") this));" + NL + "" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_30 = "(("; + protected final String TEXT_31 = ") this, "; + protected final String TEXT_32 = ".LEFT));" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_33 = "(("; + protected final String TEXT_34 = ") this, "; + protected final String TEXT_35 = ".RIGHT));" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_36 = "(("; + protected final String TEXT_37 = ") this, "; + protected final String TEXT_38 = ".TOP));" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_39 = "(("; + protected final String TEXT_40 = ") this, "; + protected final String TEXT_41 = ".BOTTOM));" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_42 = "(("; + protected final String TEXT_43 = ") this, "; + protected final String TEXT_44 = ".CENTER));" + NL + "\t\taddEditPartAction(new "; + protected final String TEXT_45 = "(("; + protected final String TEXT_46 = ") this, "; + protected final String TEXT_47 = ".MIDDLE));" + NL + "" + NL + "\t\taddEditorAction(new "; + protected final String TEXT_48 = "(this));" + NL + "\t\taddEditorAction(new "; + protected final String TEXT_49 = "(this));" + NL + "" + NL + "\t\t"; + protected final String TEXT_50 = " zoomIn = new "; + protected final String TEXT_51 = "(getZoomManager());" + NL + "\t\t"; + protected final String TEXT_52 = " zoomOut = new "; + protected final String TEXT_53 = "(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t}" + NL; + protected final String TEXT_54 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tvoid closeEditor() {" + NL + "\t\tgetSite().getShell().getDisplay().syncExec(new Runnable() {" + NL + "\t\t\tpublic void run() {" + NL + "\t\t\t\tgetSite().getPage().closeEditor("; + protected final String TEXT_55 = ".this, false);" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}"; + protected final String TEXT_56 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void dispose() {" + NL + "\t\t// important: always call super implementation of dispose" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void doSave("; + protected final String TEXT_57 = " monitor) {" + NL + "\t\ttry {" + NL + "\t\t\tsave(monitor);" + NL + "\t\t\tgetCommandStack().markSaveLocation();" + NL + "\t\t} catch ("; + protected final String TEXT_58 = " e) {" + NL + "\t\t\t"; + protected final String TEXT_59 = ".openError(getSite().getShell(), \"Error During Save\", \"The current "; + protected final String TEXT_60 = " model could not be saved.\", e.getStatus());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configurePalette("; + protected final String TEXT_61 = " paletteRoot) {"; + protected final String TEXT_62 = NL + "\t\tnew "; + protected final String TEXT_63 = "(getDomainAdapterFactory()).contributeToPalette(paletteRoot);"; + protected final String TEXT_64 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_65 = " getDiagramRoot() {" + NL + "\t\treturn diagramRoot;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_66 = " getDiagram() {" + NL + "\t\treturn diagram;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void init("; + protected final String TEXT_67 = " site, "; + protected final String TEXT_68 = " input) throws "; + protected final String TEXT_69 = " {" + NL + "\t\t"; + protected final String TEXT_70 = " file = getURIFromInput(input);" + NL + "\t\tif (file == null) {" + NL + "\t\t\tthrow new "; + protected final String TEXT_71 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t\tsuper.init(site, input);" + NL + "\t\t// validate" + NL + "\t\tif (getDiagramRoot() == null) {" + NL + "\t\t\tthrow new "; + protected final String TEXT_72 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setInput("; + protected final String TEXT_73 = " input) {"; + protected final String TEXT_74 = NL + "\t\tif (getEditorInput() instanceof "; + protected final String TEXT_75 = ") {" + NL + "\t\t\t"; + protected final String TEXT_76 = " resource = (("; + protected final String TEXT_77 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().removeResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; + protected final String TEXT_78 = NL + "\t\t"; + protected final String TEXT_79 = " file = getURIFromInput(input);" + NL + "\t\tload(file);" + NL + "\t\tsetPartName(file.lastSegment());" + NL + "\t\tsuper.setInput(input);"; + protected final String TEXT_80 = NL + "\t\tif (getEditorInput() instanceof "; + protected final String TEXT_81 = ") {" + NL + "\t\t\t"; + protected final String TEXT_82 = " resource = (("; + protected final String TEXT_83 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().addResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; + protected final String TEXT_84 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_85 = " getURIFromInput("; + protected final String TEXT_86 = " input) {"; + protected final String TEXT_87 = NL + "\t\tif (input instanceof "; + protected final String TEXT_88 = ") {" + NL + "\t\t\treturn (("; + protected final String TEXT_89 = ") input).getURI();" + NL + "\t\t}" + NL + "\t\tif (input instanceof "; + protected final String TEXT_90 = ") {" + NL + "\t\t\treturn "; + protected final String TEXT_91 = ".createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}"; + protected final String TEXT_92 = NL + "\t\tif (input instanceof "; + protected final String TEXT_93 = ") {" + NL + "\t\t\treturn "; + protected final String TEXT_94 = ".createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}"; + protected final String TEXT_95 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_96 = " getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\t"; + protected final String TEXT_97 = " factories = new "; + protected final String TEXT_98 = "();" + NL + "\t\t\tfactories.add(new "; + protected final String TEXT_99 = "());"; + protected final String TEXT_100 = NL + "\t\t\tfactories.add(new "; + protected final String TEXT_101 = "());"; + protected final String TEXT_102 = NL + "\t\t\tfactories.add(new "; + protected final String TEXT_103 = "());" + NL + "\t\t\tfactories.add(new "; + protected final String TEXT_104 = "());" + NL + "\t\t\tdomainAdapterFactory = new "; + protected final String TEXT_105 = "(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load("; + protected final String TEXT_106 = " diagramFile) {" + NL + "\t\tdiagramRoot = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_107 = " editingDomain = getEditingDomain();" + NL + "\t\t"; + protected final String TEXT_108 = " resourceSet = editingDomain.getResourceSet();" + NL + "\t\t"; + protected final String TEXT_109 = " diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = ("; + protected final String TEXT_110 = ") findInResource(diagramResource, "; + protected final String TEXT_111 = ".class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = "; + protected final String TEXT_112 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save("; + protected final String TEXT_113 = ".EMPTY_MAP);" + NL + "\t\t\t} catch ("; + protected final String TEXT_114 = " e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tdiagramRoot = ("; + protected final String TEXT_115 = ") diagram.getElement();" + NL + "\t\tif (diagramRoot == null) {"; + protected final String TEXT_116 = NL + "\t\t\t"; + protected final String TEXT_117 = " modelFile = "; + protected final String TEXT_118 = ".getModelFileURI(diagramFile);" + NL + "\t\t\t"; + protected final String TEXT_119 = " modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}"; + protected final String TEXT_120 = NL + "\t\t\tdiagramRoot = ("; + protected final String TEXT_121 = ") findInResource("; + protected final String TEXT_122 = ", "; + protected final String TEXT_123 = ".class);" + NL + "\t\t\tif (diagramRoot == null) {" + NL + "\t\t\t\tdiagramRoot = "; + protected final String TEXT_124 = ".eINSTANCE.create"; + protected final String TEXT_125 = "();" + NL + "\t\t\t\t"; + protected final String TEXT_126 = ".getContents().add(0, diagramRoot);" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t"; + protected final String TEXT_127 = ".save("; + protected final String TEXT_128 = ".EMPTY_MAP);" + NL + "\t\t\t\t} catch ("; + protected final String TEXT_129 = " e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement("; + protected final String TEXT_130 = "("; + protected final String TEXT_131 = ") "; + protected final String TEXT_132 = "diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_133 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource("; + protected final String TEXT_134 = " resource, Class expectedClass) {" + NL + "\t\tfor("; + protected final String TEXT_135 = " it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer("; + protected final String TEXT_136 = " parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\t"; + protected final String TEXT_137 = " root = new "; + protected final String TEXT_138 = "();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new "; + protected final String TEXT_139 = "());" + NL + "" + NL + "\t\t"; + protected final String TEXT_140 = " printableLayers = ("; + protected final String TEXT_141 = ") root.getLayer("; + protected final String TEXT_142 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; + protected final String TEXT_143 = " extLabelsLayer = new "; + protected final String TEXT_144 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; + protected final String TEXT_145 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; + protected final String TEXT_146 = ".EXTERNAL_NODE_LABELS_LAYER, "; + protected final String TEXT_147 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\t"; + protected final String TEXT_148 = " viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\t"; + protected final String TEXT_149 = " provider = new "; + protected final String TEXT_150 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; + protected final String TEXT_151 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\t"; + protected final String TEXT_152 = " keyHandler = new "; + protected final String TEXT_153 = "(viewer);" + NL + "\t\tkeyHandler.put("; + protected final String TEXT_154 = ".getPressed("; + protected final String TEXT_155 = ".DEL, 127, 0), getActionRegistry().getAction("; + protected final String TEXT_156 = ".DELETE.getId()));" + NL + "\t\tkeyHandler.put("; + protected final String TEXT_157 = ".getPressed("; + protected final String TEXT_158 = ".F2, 0), getActionRegistry().getAction("; + protected final String TEXT_159 = ".DIRECT_EDIT));" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty("; + protected final String TEXT_160 = ".KeyGenerator.getKey("; + protected final String TEXT_161 = ".CTRL), "; + protected final String TEXT_162 = ".SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class "; + protected final String TEXT_163 = "ContextMenuProvider extends "; + protected final String TEXT_164 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_165 = "ContextMenuProvider("; + protected final String TEXT_166 = " viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t public void buildContextMenu("; + protected final String TEXT_167 = " menuManager) {" + NL + "\t "; + protected final String TEXT_168 = ".addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_169 = ".UNDO.getId(), "; + protected final String TEXT_170 = ".GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_171 = ".REDO.getId(), "; + protected final String TEXT_172 = ".GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_173 = ".COPY.getId(), "; + protected final String TEXT_174 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_175 = ".PASTE.getId(), "; + protected final String TEXT_176 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_177 = ".DELETE.getId(), "; + protected final String TEXT_178 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_179 = ".DIRECT_EDIT, "; + protected final String TEXT_180 = ".GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_181 = ".SAVE.getId(), "; + protected final String TEXT_182 = ".GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu("; + protected final String TEXT_183 = " menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\t"; + protected final String TEXT_184 = " submenu = new "; + protected final String TEXT_185 = "(\"Align\");" + NL + "\t\t\tsubmenu.add(new "; + protected final String TEXT_186 = "("; + protected final String TEXT_187 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_188 = ".ALIGN_LEFT, "; + protected final String TEXT_189 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_190 = ".ALIGN_CENTER, "; + protected final String TEXT_191 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_192 = ".ALIGN_RIGHT, "; + protected final String TEXT_193 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_194 = ".ALIGN_TOP, "; + protected final String TEXT_195 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_196 = ".ALIGN_MIDDLE, "; + protected final String TEXT_197 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_198 = ".ALIGN_BOTTOM, "; + protected final String TEXT_199 = ".MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup("; + protected final String TEXT_200 = ".GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu("; + protected final String TEXT_201 = " menu, String actionId, String menuGroup) {" + NL + "\t\t\t"; + protected final String TEXT_202 = " action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}"; + protected final String TEXT_203 = NL; public String generate(Object argument) { @@ -151,299 +234,265 @@ importManager.emitPackageStatement(stringBuffer); importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_1); -importManager.registerInnerClass("UndoablePropertySheetEntry"); -importManager.registerInnerClass("SetValueCommand"); -importManager.registerInnerClass("ResetValueCommand"); -importManager.registerInnerClass("UpdatableActionGroup"); importManager.registerInnerClass(genEditor.getClassName() + "ContextMenuProvider"); if (!isRichClientPlatform) { importManager.registerInnerClass("ResourceTracker"); } -importManager.addImport("java.io.IOException"); -importManager.addImport("java.util.ArrayList"); -importManager.addImport("java.util.Collections"); -importManager.addImport("java.util.EventObject"); -importManager.addImport("java.util.HashMap"); -importManager.addImport("java.util.Iterator"); -importManager.addImport("java.util.List"); - -importManager.addImport("org.eclipse.core.runtime.CoreException"); -importManager.addImport("org.eclipse.core.runtime.IProgressMonitor"); -importManager.addImport("org.eclipse.core.runtime.IStatus"); -importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor"); -importManager.addImport("org.eclipse.core.runtime.Status"); -importManager.addImport("org.eclipse.draw2d.PositionConstants"); -importManager.addImport("org.eclipse.emf.common.util.URI"); -importManager.addImport("org.eclipse.emf.ecore.resource.Resource"); -importManager.addImport("org.eclipse.emf.ecore.resource.ResourceSet"); -importManager.addImport("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"); -importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain"); -importManager.addImport("org.eclipse.emf.edit.provider.ComposedAdapterFactory"); -importManager.addImport("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory"); -importManager.addImport("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory"); -importManager.addImport("org.eclipse.gef.ContextMenuProvider"); -importManager.addImport("org.eclipse.gef.EditPartViewer"); -importManager.addImport("org.eclipse.gef.GraphicalViewer"); -importManager.addImport("org.eclipse.gef.KeyHandler"); -importManager.addImport("org.eclipse.gef.KeyStroke"); -importManager.addImport("org.eclipse.gef.RootEditPart"); -importManager.addImport("org.eclipse.gef.MouseWheelHandler"); -importManager.addImport("org.eclipse.gef.MouseWheelZoomHandler"); -importManager.addImport("org.eclipse.gef.commands.CommandStack"); -importManager.addImport("org.eclipse.gef.commands.CommandStackListener"); -importManager.addImport("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"); -importManager.addImport("org.eclipse.gef.editparts.ScalableRootEditPart"); -importManager.addImport("org.eclipse.gef.editparts.ZoomManager"); -importManager.addImport("org.eclipse.gef.palette.PaletteRoot"); -importManager.addImport("org.eclipse.gef.ui.actions.AlignmentAction"); -importManager.addImport("org.eclipse.gef.ui.actions.DeleteAction"); -importManager.addImport("org.eclipse.gef.ui.actions.DirectEditAction"); -importManager.addImport("org.eclipse.gef.ui.actions.GEFActionConstants"); -importManager.addImport("org.eclipse.gef.ui.actions.PrintAction"); -importManager.addImport("org.eclipse.gef.ui.actions.RedoAction"); -importManager.addImport("org.eclipse.gef.ui.actions.SaveAction"); -importManager.addImport("org.eclipse.gef.ui.actions.SelectionAction"); -importManager.addImport("org.eclipse.gef.ui.actions.StackAction"); -importManager.addImport("org.eclipse.gef.ui.actions.UndoAction"); -importManager.addImport("org.eclipse.gef.ui.actions.UpdateAction"); -importManager.addImport("org.eclipse.gef.ui.actions.WorkbenchPartAction"); -importManager.addImport("org.eclipse.gef.ui.actions.ZoomInAction"); -importManager.addImport("org.eclipse.gef.ui.actions.ZoomOutAction"); -importManager.addImport("org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler"); -importManager.addImport("org.eclipse.gmf.runtime.notation.Diagram"); -importManager.addImport("org.eclipse.gmf.runtime.notation.NotationFactory"); -importManager.addImport("org.eclipse.gmf.runtime.notation.provider.NotationItemProviderAdapterFactory"); -importManager.addImport("org.eclipse.jface.action.IAction"); -importManager.addImport("org.eclipse.jface.action.IMenuManager"); -importManager.addImport("org.eclipse.jface.action.MenuManager"); -importManager.addImport("org.eclipse.jface.action.Separator"); -importManager.addImport("org.eclipse.jface.dialogs.ErrorDialog"); -importManager.addImport("org.eclipse.jface.viewers.ISelection"); -importManager.addImport("org.eclipse.swt.SWT"); -importManager.addImport("org.eclipse.swt.widgets.Composite"); -importManager.addImport("org.eclipse.ui.IEditorPart"); -importManager.addImport("org.eclipse.ui.IEditorInput"); -importManager.addImport("org.eclipse.ui.IEditorSite"); -importManager.addImport("org.eclipse.ui.ISelectionListener"); -importManager.addImport("org.eclipse.ui.IWorkbenchPart"); -importManager.addImport("org.eclipse.ui.PartInitException"); -importManager.addImport("org.eclipse.ui.actions.ActionFactory"); -importManager.addImport("org.eclipse.ui.views.contentoutline.IContentOutlinePage"); -importManager.addImport("org.eclipse.ui.views.properties.IPropertySheetPage"); -importManager.addImport("org.eclipse.ui.views.properties.PropertySheetPage"); -importManager.addImport("org.eclipse.emf.common.notify.AdapterFactory"); -importManager.addImport("org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette"); -importManager.addImport("org.eclipse.gef.DefaultEditDomain"); - stringBuffer.append(TEXT_2); stringBuffer.append(genEditor.getClassName()); stringBuffer.append(TEXT_3); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.parts.DiagramEditor")); + stringBuffer.append(TEXT_4); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_4); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceChangeListener")); stringBuffer.append(TEXT_5); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceChangeEvent")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceChangeListener")); stringBuffer.append(TEXT_6); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceDelta")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceChangeEvent")); stringBuffer.append(TEXT_7); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceDelta")); stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); - stringBuffer.append(TEXT_9); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceDelta")); - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_9); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_10); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceDelta")); + stringBuffer.append(TEXT_11); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); stringBuffer.append(TEXT_12); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceDelta")); stringBuffer.append(TEXT_13); - /*XXX: make sure unsaved deleted file is handled correctly*/ + stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IResourceDelta")); stringBuffer.append(TEXT_14); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); + /*XXX: make sure unsaved deleted file is handled correctly*/ stringBuffer.append(TEXT_15); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.ResourcesPlugin")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); stringBuffer.append(TEXT_16); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Display")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.ResourcesPlugin")); stringBuffer.append(TEXT_17); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.part.FileEditorInput")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Display")); stringBuffer.append(TEXT_18); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.part.FileEditorInput")); + stringBuffer.append(TEXT_19); } - stringBuffer.append(TEXT_19); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.PropertySheetEntry")); stringBuffer.append(TEXT_20); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); + stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); stringBuffer.append(TEXT_21); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_22); - stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ComposedAdapterFactory")); stringBuffer.append(TEXT_23); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.UndoAction")); stringBuffer.append(TEXT_24); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.RedoAction")); stringBuffer.append(TEXT_25); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IItemPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.DeleteAction")); stringBuffer.append(TEXT_26); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IItemPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_27); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.DirectEditAction")); stringBuffer.append(TEXT_28); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_29); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource2")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.AlignmentAction")); stringBuffer.append(TEXT_30); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource2")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_31); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); stringBuffer.append(TEXT_32); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.AlignmentAction")); stringBuffer.append(TEXT_33); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_34); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); stringBuffer.append(TEXT_35); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource2")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.AlignmentAction")); stringBuffer.append(TEXT_36); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource2")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_37); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); stringBuffer.append(TEXT_38); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.AlignmentAction")); stringBuffer.append(TEXT_39); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IItemPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_40); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IItemPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); stringBuffer.append(TEXT_41); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.AlignmentAction")); stringBuffer.append(TEXT_42); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CommandStackListener")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_43); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CommandStack")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); stringBuffer.append(TEXT_44); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CommandStack")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.AlignmentAction")); stringBuffer.append(TEXT_45); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.PropertySheetEntry")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchPart")); stringBuffer.append(TEXT_46); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CommandStack")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); stringBuffer.append(TEXT_47); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.SaveAction")); stringBuffer.append(TEXT_48); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.PrintAction")); stringBuffer.append(TEXT_49); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.IPropertySource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); stringBuffer.append(TEXT_50); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CommandStack")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction")); stringBuffer.append(TEXT_51); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CommandStackListener")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); stringBuffer.append(TEXT_52); - stringBuffer.append(importManager.getImportedName("java.util.EventObject")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction")); stringBuffer.append(TEXT_53); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.views.properties.PropertySheetEntry")); - stringBuffer.append(TEXT_54); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.ForwardUndoCompoundCommand")); - stringBuffer.append(TEXT_55); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")); - stringBuffer.append(TEXT_56); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")); - stringBuffer.append(TEXT_57); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")); - stringBuffer.append(TEXT_58); - stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_59); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_60); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_54); stringBuffer.append(genEditor.getClassName()); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_55); } - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_56); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IProgressMonitor")); + stringBuffer.append(TEXT_57); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.CoreException")); + stringBuffer.append(TEXT_58); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.ErrorDialog")); + stringBuffer.append(TEXT_59); stringBuffer.append(genDiagram.getEditorGen().getDomainGenModel().getModelName()); - stringBuffer.append(TEXT_64); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_60); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.palette.PaletteRoot")); + stringBuffer.append(TEXT_61); { final Palette palette = genDiagram.getPalette(); if (palette != null) { - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_63); } } + stringBuffer.append(TEXT_64); + stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_65); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); + stringBuffer.append(TEXT_66); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorSite")); + stringBuffer.append(TEXT_67); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); stringBuffer.append(TEXT_68); - stringBuffer.append(importManager.getImportedName(genDiagram.getPropertyProviderQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); stringBuffer.append(TEXT_69); - stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_70); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); + stringBuffer.append(TEXT_71); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); + stringBuffer.append(TEXT_72); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); + stringBuffer.append(TEXT_73); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_77); } - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_78); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(TEXT_79); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_83); } - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_84); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(TEXT_85); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); + stringBuffer.append(TEXT_86); if (isRichClientPlatform) { - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPathEditorInput")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_90); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(TEXT_91); } else { - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_93); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(TEXT_94); } - stringBuffer.append(TEXT_87); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.workspace.WorkspaceEditingDomainFactory")); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_95); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.AdapterFactory")); + stringBuffer.append(TEXT_96); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_97); + stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); + stringBuffer.append(TEXT_98); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory")); + stringBuffer.append(TEXT_99); final EList genPackages = genDiagram.getEditorGen().getAllDomainGenPackages(true); for (int i = 0; i < genPackages.size(); i++) { GenPackage genPackage = (GenPackage) genPackages.get(i); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName())); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_101); } - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_102); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory")); + stringBuffer.append(TEXT_103); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.provider.NotationItemProviderAdapterFactory")); + stringBuffer.append(TEXT_104); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ComposedAdapterFactory")); + stringBuffer.append(TEXT_105); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(TEXT_106); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_107); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.ResourceSet")); + stringBuffer.append(TEXT_108); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); + stringBuffer.append(TEXT_109); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); + stringBuffer.append(TEXT_110); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); + stringBuffer.append(TEXT_111); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); + stringBuffer.append(TEXT_112); + stringBuffer.append(importManager.getImportedName("java.util.Collections")); + stringBuffer.append(TEXT_113); + stringBuffer.append(importManager.getImportedName("java.io.IOException")); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_115); { @@ -452,68 +501,188 @@ for (int i = 0; i < genPackages.size(); i++) { String resourceToUse; if (!sameFile) { - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_116); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(TEXT_117); stringBuffer.append(genDiagram.getDiagramEditorUtilClassName()); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_118); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); + stringBuffer.append(TEXT_119); resourceToUse = "modelResource"; } else { resourceToUse = "diagramResource"; } - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_121); stringBuffer.append(resourceToUse); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName())); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_124); stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName()); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_125); stringBuffer.append(resourceToUse); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_126); stringBuffer.append(resourceToUse); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_127); + stringBuffer.append(importManager.getImportedName("java.util.Collections")); + stringBuffer.append(TEXT_128); + stringBuffer.append(importManager.getImportedName("java.io.IOException")); + stringBuffer.append(TEXT_129); if (genDiagram.getDomainDiagramElement().isExternalInterface()) { - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_131); } - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_132); } - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_133); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); + stringBuffer.append(TEXT_134); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_135); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); + stringBuffer.append(TEXT_136); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); + stringBuffer.append(TEXT_137); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_140); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_147); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); + stringBuffer.append(TEXT_148); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider")); + stringBuffer.append(TEXT_149); stringBuffer.append(genEditor.getClassName()); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_151); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler")); + stringBuffer.append(TEXT_152); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler")); + stringBuffer.append(TEXT_153); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke")); + stringBuffer.append(TEXT_154); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(TEXT_155); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_156); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke")); + stringBuffer.append(TEXT_157); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(TEXT_158); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_159); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelHandler")); + stringBuffer.append(TEXT_160); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(TEXT_161); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelZoomHandler")); + stringBuffer.append(TEXT_162); stringBuffer.append(genEditor.getClassName()); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_163); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider")); + stringBuffer.append(TEXT_164); stringBuffer.append(genEditor.getClassName()); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_165); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPartViewer")); + stringBuffer.append(TEXT_166); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_167); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_168); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_169); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_170); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_171); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_172); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_173); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_174); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_175); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_176); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_177); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_178); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_179); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_180); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_181); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_182); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_183); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(TEXT_184); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(TEXT_185); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); + stringBuffer.append(TEXT_186); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_187); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_188); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_189); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_190); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_191); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_192); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_193); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_194); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_195); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_196); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_197); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_198); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_199); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_200); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_201); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(TEXT_202); importManager.emitSortedImports(); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_203); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java index 404afb001..4b092dd77 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java @@ -23,7 +23,7 @@ public class ManifestGenerator protected final String TEXT_5 = NL + "Require-Bundle: org.eclipse.core.runtime,"; protected final String TEXT_6 = "org.eclipse.core.resources," + NL + " org.eclipse.ui.ide,"; protected final String TEXT_7 = NL + " org.eclipse.jface," + NL + " org.eclipse.ui.views," + NL + " org.eclipse.ui.workbench," + NL + " org.eclipse.emf.ecore," + NL + " org.eclipse.emf.edit.ui," + NL + " org.eclipse.emf.workspace,"; - protected final String TEXT_8 = NL + " org.eclipse.gef;visibility:=reexport," + NL + " org.eclipse.gmf.runtime.notation," + NL + " org.eclipse.gmf.runtime.notation.edit"; + protected final String TEXT_8 = NL + " org.eclipse.gef;visibility:=reexport," + NL + " org.eclipse.gmf.runtime.lite," + NL + " org.eclipse.gmf.runtime.notation," + NL + " org.eclipse.gmf.runtime.notation.edit"; protected final String TEXT_9 = ","; protected final String TEXT_10 = NL + " "; protected final String TEXT_11 = ";visibility:=reexport"; diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java index fecf505cb..522e4e907 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java @@ -50,36 +50,40 @@ public class PaletteFactoryGenerator protected final String TEXT_31 = "\t\t" + NL + "\t\t};" + NL + "\t\treturn new "; protected final String TEXT_32 = "(\""; protected final String TEXT_33 = "\", " + NL + "\t\t\t\""; - protected final String TEXT_34 = "\", new ModelCreationFactory("; - protected final String TEXT_35 = ".class), smallImage, largeImage) {" + NL + "\t\t\tpublic Tool createTool() {" + NL + "\t\t\t\tTool result = new CreationTool() {" + NL + "\t\t\t\t\tprotected Request createTargetRequest() {" + NL + "\t\t\t\t\t\tCreateRequestEx request = new CreateRequestEx(visualIds);" + NL + "\t\t\t\t\t\trequest.setFactory(getFactory());" + NL + "\t\t\t\t\t\treturn request;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected void performCreation(int button) {" + NL + "\t\t\t\t\t\tsuper.performCreation(button);" + NL + "\t\t\t\t\t\tfinal "; - protected final String TEXT_36 = " createdEditPart = ("; - protected final String TEXT_37 = ")getCurrentViewer().getEditPartRegistry().get(getCreateRequest().getNewObject());" + NL + "\t\t\t\t\t\tif (createdEditPart != null) {" + NL + "\t\t\t\t\t\t\tgetCurrentViewer().getControl().getDisplay().asyncExec(new Runnable() {" + NL + "\t\t\t\t\t\t\t\tpublic void run() {" + NL + "\t\t\t\t\t\t\t\t\tif (createdEditPart.isActive()) {" + NL + "\t\t\t\t\t\t\t\t\t\tcreatedEditPart.performRequest(new "; - protected final String TEXT_38 = "("; - protected final String TEXT_39 = ".REQ_DIRECT_EDIT));" + NL + "\t\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t});" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\tresult.setProperties(getToolProperties());" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}"; - protected final String TEXT_40 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ToolEntry "; - protected final String TEXT_41 = "() {" + NL + "\t\t"; - protected final String TEXT_42 = NL + "\t\tImageDescriptor smallImage = ImageDescriptor.createFromFile("; - protected final String TEXT_43 = ".class, \""; - protected final String TEXT_44 = "\");" + NL + "\t\t"; - protected final String TEXT_45 = NL + "\t\tImageDescriptor smallImage = getImage("; - protected final String TEXT_46 = ");" + NL + "\t\t"; - protected final String TEXT_47 = NL + "\t\t"; - protected final String TEXT_48 = NL + "\t\tImageDescriptor largeImage = ImageDescriptor.createFromFile("; - protected final String TEXT_49 = ".class, \""; - protected final String TEXT_50 = "\");" + NL + "\t\t"; - protected final String TEXT_51 = NL + "\t\tImageDescriptor largeImage = smallImage;" + NL + "\t\t"; - protected final String TEXT_52 = NL + "\t\tfinal int[] visualIds = new int[] {"; - protected final String TEXT_53 = NL + "\t\t\t"; - protected final String TEXT_54 = ".VISUAL_ID"; - protected final String TEXT_55 = ","; - protected final String TEXT_56 = "\t\t" + NL + "\t\t};" + NL + "\t\treturn new ConnectionCreationToolEntry(\""; - protected final String TEXT_57 = "\", \""; - protected final String TEXT_58 = "\", " + NL + "\t\t\tnew ModelCreationFactory("; - protected final String TEXT_59 = ".class), smallImage, largeImage) {" + NL + "\t\t\tpublic Tool createTool() {" + NL + "\t\t\t\tTool result = new ConnectionCreationTool() {" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tsetUnloadWhenFinished(true);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected Request createTargetRequest() {" + NL + "\t\t\t\t\t\tCreateConnectionRequestEx request = new CreateConnectionRequestEx(visualIds);" + NL + "\t\t\t\t\t\trequest.setFactory(getFactory());" + NL + "\t\t\t\t\t\treturn request;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\tresult.setProperties(getToolProperties());" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}"; - protected final String TEXT_60 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PaletteContainer createContainer(String title) {" + NL + "\t\treturn new PaletteDrawer(title);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ImageDescriptor getImage(Object o) {" + NL + "\t\tIItemLabelProvider labelProvider = (IItemLabelProvider) domainAdapterFactory.adapt(o, IItemLabelProvider.class);" + NL + "\t\tif (labelProvider != null) {" + NL + "\t\t\treturn ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(o));" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class CreateRequestEx extends "; - protected final String TEXT_61 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final int[] visualIds;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic CreateRequestEx(int[] visualIds) {" + NL + "\t\t\tthis.visualIds = visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int[] getVisualIds() {" + NL + "\t\t\treturn visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\t((ModelCreationFactory)getFactory()).setCreatedObject(createdObject);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class CreateConnectionRequestEx extends "; - protected final String TEXT_62 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final int[] visualIds;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic CreateConnectionRequestEx(int[] visualIds) {" + NL + "\t\t\tthis.visualIds = visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int[] getVisualIds() {" + NL + "\t\t\treturn visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\t((ModelCreationFactory)getFactory()).setCreatedObject(createdObject);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class ModelCreationFactory implements CreationFactory {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Object createdObject;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Class createdObjectType;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ModelCreationFactory(Class objectType) {" + NL + "\t\t\tcreatedObjectType = objectType;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object getNewObject() {" + NL + "\t\t\treturn createdObject;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object getObjectType() {" + NL + "\t\t\treturn createdObjectType;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\tthis.createdObject = createdObject;" + NL + "\t\t}" + NL + "\t}" + NL + "}"; - protected final String TEXT_63 = NL; + protected final String TEXT_34 = "\", new "; + protected final String TEXT_35 = "("; + protected final String TEXT_36 = ".class), smallImage, largeImage) {" + NL + "\t\t\tpublic Tool createTool() {" + NL + "\t\t\t\tTool result = new CreationTool() {" + NL + "\t\t\t\t\tprotected Request createTargetRequest() {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_37 = " request = new "; + protected final String TEXT_38 = "(visualIds);" + NL + "\t\t\t\t\t\trequest.setFactory(getFactory());" + NL + "\t\t\t\t\t\treturn request;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected void performCreation(int button) {" + NL + "\t\t\t\t\t\tsuper.performCreation(button);" + NL + "\t\t\t\t\t\tfinal "; + protected final String TEXT_39 = " createdEditPart = ("; + protected final String TEXT_40 = ")getCurrentViewer().getEditPartRegistry().get(getCreateRequest().getNewObject());" + NL + "\t\t\t\t\t\tif (createdEditPart != null) {" + NL + "\t\t\t\t\t\t\tgetCurrentViewer().getControl().getDisplay().asyncExec(new Runnable() {" + NL + "\t\t\t\t\t\t\t\tpublic void run() {" + NL + "\t\t\t\t\t\t\t\t\tif (createdEditPart.isActive()) {" + NL + "\t\t\t\t\t\t\t\t\t\tcreatedEditPart.performRequest(new "; + protected final String TEXT_41 = "("; + protected final String TEXT_42 = ".REQ_DIRECT_EDIT));" + NL + "\t\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t});" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\tresult.setProperties(getToolProperties());" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}"; + protected final String TEXT_43 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ToolEntry "; + protected final String TEXT_44 = "() {" + NL + "\t\t"; + protected final String TEXT_45 = NL + "\t\tImageDescriptor smallImage = ImageDescriptor.createFromFile("; + protected final String TEXT_46 = ".class, \""; + protected final String TEXT_47 = "\");" + NL + "\t\t"; + protected final String TEXT_48 = NL + "\t\tImageDescriptor smallImage = getImage("; + protected final String TEXT_49 = ");" + NL + "\t\t"; + protected final String TEXT_50 = NL + "\t\t"; + protected final String TEXT_51 = NL + "\t\tImageDescriptor largeImage = ImageDescriptor.createFromFile("; + protected final String TEXT_52 = ".class, \""; + protected final String TEXT_53 = "\");" + NL + "\t\t"; + protected final String TEXT_54 = NL + "\t\tImageDescriptor largeImage = smallImage;" + NL + "\t\t"; + protected final String TEXT_55 = NL + "\t\tfinal int[] visualIds = new int[] {"; + protected final String TEXT_56 = NL + "\t\t\t"; + protected final String TEXT_57 = ".VISUAL_ID"; + protected final String TEXT_58 = ","; + protected final String TEXT_59 = "\t\t" + NL + "\t\t};" + NL + "\t\treturn new ConnectionCreationToolEntry(\""; + protected final String TEXT_60 = "\", \""; + protected final String TEXT_61 = "\", " + NL + "\t\t\tnew "; + protected final String TEXT_62 = "("; + protected final String TEXT_63 = ".class), smallImage, largeImage) {" + NL + "\t\t\tpublic Tool createTool() {" + NL + "\t\t\t\tTool result = new ConnectionCreationTool() {" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tsetUnloadWhenFinished(true);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected Request createTargetRequest() {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_64 = " request = new "; + protected final String TEXT_65 = "(visualIds);" + NL + "\t\t\t\t\t\trequest.setFactory(getFactory());" + NL + "\t\t\t\t\t\treturn request;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\tresult.setProperties(getToolProperties());" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}"; + protected final String TEXT_66 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PaletteContainer createContainer(String title) {" + NL + "\t\treturn new PaletteDrawer(title);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ImageDescriptor getImage(Object o) {" + NL + "\t\tIItemLabelProvider labelProvider = (IItemLabelProvider) domainAdapterFactory.adapt(o, IItemLabelProvider.class);" + NL + "\t\tif (labelProvider != null) {" + NL + "\t\t\treturn ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(o));" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "}"; + protected final String TEXT_67 = NL; public String generate(Object argument) { @@ -220,16 +224,22 @@ for (int j = 0; j < tools.size(); j++) { stringBuffer.append(TEXT_33); stringBuffer.append(nodeCreationTool.getDescription()); stringBuffer.append(TEXT_34); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.ModelCreationFactory")); stringBuffer.append(TEXT_35); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_36); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_37); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_38); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_39); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_40); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); + stringBuffer.append(TEXT_41); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); + stringBuffer.append(TEXT_42); } @@ -247,61 +257,63 @@ for (int j = 0; j < tools.size(); j++) { domainElementInstanceCreationCode = "null"; } - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_43); stringBuffer.append(linkCreationTool.getCreateMethodName()); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_44); if (linkCreationTool.getSmallIconPath() != null) { - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_45); stringBuffer.append(palette.getFactoryClassName()); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_46); stringBuffer.append(linkCreationTool.getSmallIconPath()); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_47); } else { - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_48); stringBuffer.append(domainElementInstanceCreationCode); - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_49); } - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_50); if (linkCreationTool.getLargeIconPath() != null) { - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_51); stringBuffer.append(palette.getFactoryClassName()); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_52); stringBuffer.append(linkCreationTool.getLargeIconPath()); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_53); } else { - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_54); } - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_55); for (Iterator genLinksIterator = genLinks.iterator(); genLinksIterator.hasNext();) { GenLink nextLink = (GenLink) genLinksIterator.next(); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_57); if (genLinksIterator.hasNext()) { - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_58); } } - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_59); stringBuffer.append(linkCreationTool.getTitle()); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_60); stringBuffer.append(linkCreationTool.getDescription()); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_61); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.ModelCreationFactory")); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_63); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateConnectionRequestEx")); + stringBuffer.append(TEXT_64); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateConnectionRequestEx")); + stringBuffer.append(TEXT_65); } - stringBuffer.append(TEXT_60); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest")); - stringBuffer.append(TEXT_61); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_66); importManager.emitSortedImports(); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_67); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java index 2c243843f..97b4d6b73 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java @@ -40,275 +40,278 @@ public class ChildNodeEditPartGenerator protected final String TEXT_20 = NL; protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; protected final String TEXT_22 = " extends "; - protected final String TEXT_23 = " implements IUpdatableEditPart {"; - protected final String TEXT_24 = NL; - protected final String TEXT_25 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_26 = ";"; - protected final String TEXT_27 = NL; + protected final String TEXT_23 = " implements "; + protected final String TEXT_24 = " {"; + protected final String TEXT_25 = NL; + protected final String TEXT_26 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_27 = ";"; protected final String TEXT_28 = NL; - protected final String TEXT_29 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_30 = " manager;" + NL; - protected final String TEXT_31 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_32 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_33 = " getDiagramNode() {" + NL + "\t\treturn ("; - protected final String TEXT_34 = ") getModel();" + NL + "\t}" + NL; - protected final String TEXT_35 = NL; - protected final String TEXT_36 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; - protected final String TEXT_37 = " view = ("; - protected final String TEXT_38 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; - protected final String TEXT_39 = " view = ("; - protected final String TEXT_40 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!"; - protected final String TEXT_41 = NL; - protected final String TEXT_42 = "\t\tinstallEditPolicy("; - protected final String TEXT_43 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; - protected final String TEXT_44 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; - protected final String TEXT_45 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tgetLabel().setText(value);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected "; - protected final String TEXT_46 = " getDirectEditCommand("; - protected final String TEXT_47 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tif (value == null) {" + NL + "\t\t\t\t\t\t\t//Invalid value is transformed into a null by the validator." + NL + "\t\t\t\t\t\t\t//XXX: implement validator" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_48 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tfinal Object[] parseResult;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tparseResult = new "; - protected final String TEXT_49 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_50 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; - protected final String TEXT_51 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_52 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_53 = " editingDomain = "; - protected final String TEXT_54 = ".getEditingDomain("; - protected final String TEXT_55 = ".getDiagram().getElement());"; - protected final String TEXT_56 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_57 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_58 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_59 = " createDomainModelCommand("; - protected final String TEXT_60 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_61 = " element = "; - protected final String TEXT_62 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_63 = " feature = ("; - protected final String TEXT_64 = ") "; - protected final String TEXT_65 = ".eINSTANCE.get"; - protected final String TEXT_66 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; - protected final String TEXT_67 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_68 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_69 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_70 = " result = new "; - protected final String TEXT_71 = "();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_72 = " values = new "; - protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_74 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_75 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_76 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; - protected final String TEXT_77 = NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_78 = ".create(editingDomain, element, feature, valueToSet);"; - protected final String TEXT_79 = NL + "\t\t\t\t\t}"; - protected final String TEXT_80 = NL + "\t\t\t\t\t\tif (parseResult.length != "; - protected final String TEXT_81 = ") {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_82 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_83 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_84 = " createDomainModelCommand("; - protected final String TEXT_85 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_86 = " element = "; - protected final String TEXT_87 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_88 = " result = new "; - protected final String TEXT_89 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; - protected final String TEXT_90 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_91 = " "; - protected final String TEXT_92 = "feature = ("; - protected final String TEXT_93 = ") "; - protected final String TEXT_94 = ".eINSTANCE.get"; - protected final String TEXT_95 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; - protected final String TEXT_96 = ".parseValue(feature, values["; - protected final String TEXT_97 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_98 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_99 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_100 = " "; - protected final String TEXT_101 = "values = new "; - protected final String TEXT_102 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_103 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_104 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_105 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_106 = NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_107 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_108 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; - protected final String TEXT_109 = NL + "\t\t\t\t});"; - protected final String TEXT_110 = NL; - protected final String TEXT_111 = "\t\tinstallEditPolicy("; - protected final String TEXT_112 = ".COMPONENT_ROLE, new "; - protected final String TEXT_113 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_114 = " createDeleteCommand("; - protected final String TEXT_115 = " deleteRequest) {" + NL + "\t\t\t\t"; - protected final String TEXT_116 = " editingDomain = "; - protected final String TEXT_117 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_118 = " cc = new "; - protected final String TEXT_119 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; - protected final String TEXT_120 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand("; - protected final String TEXT_121 = " editingDomain) {"; - protected final String TEXT_122 = NL + "\t\t\t\t"; - protected final String TEXT_123 = " result = new "; - protected final String TEXT_124 = "();"; - protected final String TEXT_125 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_126 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_127 = ".eINSTANCE.get"; - protected final String TEXT_128 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_29 = NL; + protected final String TEXT_30 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_31 = " manager;" + NL; + protected final String TEXT_32 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_33 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_34 = " getDiagramNode() {" + NL + "\t\treturn ("; + protected final String TEXT_35 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_36 = NL; + protected final String TEXT_37 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; + protected final String TEXT_38 = " view = ("; + protected final String TEXT_39 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; + protected final String TEXT_40 = " view = ("; + protected final String TEXT_41 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!"; + protected final String TEXT_42 = NL; + protected final String TEXT_43 = "\t\tinstallEditPolicy("; + protected final String TEXT_44 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; + protected final String TEXT_45 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; + protected final String TEXT_46 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tgetLabel().setText(value);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected "; + protected final String TEXT_47 = " getDirectEditCommand("; + protected final String TEXT_48 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tif (value == null) {" + NL + "\t\t\t\t\t\t\t//Invalid value is transformed into a null by the validator." + NL + "\t\t\t\t\t\t\t//XXX: implement validator" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_49 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tfinal Object[] parseResult;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tparseResult = new "; + protected final String TEXT_50 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_51 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; + protected final String TEXT_52 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_53 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_54 = " editingDomain = "; + protected final String TEXT_55 = ".getEditingDomain("; + protected final String TEXT_56 = ".getDiagram().getElement());"; + protected final String TEXT_57 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_58 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_59 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);" + NL + "\t\t\t\t\t\treturn new "; + protected final String TEXT_60 = "(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; + protected final String TEXT_61 = " createDomainModelCommand("; + protected final String TEXT_62 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_63 = " element = "; + protected final String TEXT_64 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_65 = " feature = ("; + protected final String TEXT_66 = ") "; + protected final String TEXT_67 = ".eINSTANCE.get"; + protected final String TEXT_68 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_69 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_70 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_71 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_72 = " result = new "; + protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_74 = " values = new "; + protected final String TEXT_75 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_76 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_77 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_78 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; + protected final String TEXT_79 = NL + "\t\t\t\t\t\treturn "; + protected final String TEXT_80 = ".create(editingDomain, element, feature, valueToSet);"; + protected final String TEXT_81 = NL + "\t\t\t\t\t}"; + protected final String TEXT_82 = NL + "\t\t\t\t\t\tif (parseResult.length != "; + protected final String TEXT_83 = ") {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_84 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_85 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult);" + NL + "\t\t\t\t\t\treturn new "; + protected final String TEXT_86 = "(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; + protected final String TEXT_87 = " createDomainModelCommand("; + protected final String TEXT_88 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_89 = " element = "; + protected final String TEXT_90 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_91 = " result = new "; + protected final String TEXT_92 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; + protected final String TEXT_93 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_94 = " "; + protected final String TEXT_95 = "feature = ("; + protected final String TEXT_96 = ") "; + protected final String TEXT_97 = ".eINSTANCE.get"; + protected final String TEXT_98 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_99 = ".parseValue(feature, values["; + protected final String TEXT_100 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_101 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_102 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_103 = " "; + protected final String TEXT_104 = "values = new "; + protected final String TEXT_105 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_106 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_107 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_108 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_109 = NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_110 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_111 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; + protected final String TEXT_112 = NL + "\t\t\t\t});"; + protected final String TEXT_113 = NL; + protected final String TEXT_114 = "\t\tinstallEditPolicy("; + protected final String TEXT_115 = ".COMPONENT_ROLE, new "; + protected final String TEXT_116 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_117 = " createDeleteCommand("; + protected final String TEXT_118 = " deleteRequest) {" + NL + "\t\t\t\t"; + protected final String TEXT_119 = " editingDomain = "; + protected final String TEXT_120 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; + protected final String TEXT_121 = " cc = new "; + protected final String TEXT_122 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; + protected final String TEXT_123 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new "; + protected final String TEXT_124 = "(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand("; + protected final String TEXT_125 = " editingDomain) {"; + protected final String TEXT_126 = NL + "\t\t\t\t"; + protected final String TEXT_127 = " result = new "; + protected final String TEXT_128 = "();"; protected final String TEXT_129 = NL + "\t\t\t\tresult.append("; protected final String TEXT_130 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; protected final String TEXT_131 = ".eINSTANCE.get"; - protected final String TEXT_132 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_133 = ".UNSET_VALUE));"; - protected final String TEXT_134 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_135 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_136 = ".eINSTANCE.get"; - protected final String TEXT_137 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_132 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_133 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_134 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_135 = ".eINSTANCE.get"; + protected final String TEXT_136 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_137 = ".UNSET_VALUE));"; protected final String TEXT_138 = NL + "\t\t\t\tresult.append("; protected final String TEXT_139 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; protected final String TEXT_140 = ".eINSTANCE.get"; - protected final String TEXT_141 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_142 = ".UNSET_VALUE));"; - protected final String TEXT_143 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_144 = NL + "\t\t\t\treturn "; - protected final String TEXT_145 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_146 = ".eINSTANCE.get"; - protected final String TEXT_147 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; + protected final String TEXT_141 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_142 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_143 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_144 = ".eINSTANCE.get"; + protected final String TEXT_145 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_146 = ".UNSET_VALUE));"; + protected final String TEXT_147 = NL + "\t\t\t\treturn result;"; protected final String TEXT_148 = NL + "\t\t\t\treturn "; protected final String TEXT_149 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; protected final String TEXT_150 = ".eINSTANCE.get"; - protected final String TEXT_151 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_152 = ".UNSET_VALUE);"; - protected final String TEXT_153 = NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_154 = NL + "\t}" + NL; - protected final String TEXT_155 = NL; - protected final String TEXT_156 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_157 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_158 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t} else {" + NL + "\t\t\tsuper.performRequest(req);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_159 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; - protected final String TEXT_160 = "(this, "; - protected final String TEXT_161 = ".class, new "; - protected final String TEXT_162 = "() {" + NL + "\t\t\t\tpublic void relocate("; - protected final String TEXT_163 = " celleditor) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_164 = " rect = getLabel().getTextBounds();" + NL + "\t\t\t\t\tgetLabel().translateToAbsolute(rect);" + NL + "\t\t\t\t\tcelleditor.getControl().setBounds(rect.x, rect.y, rect.width, rect.height);" + NL + "\t\t\t\t}" + NL + "\t\t\t}) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelEditText());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL; - protected final String TEXT_165 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((View)getModel()).getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelSourceConnections() {" + NL + "\t\treturn ((View)getModel()).getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelTargetConnections() {" + NL + "\t\treturn ((View)getModel()).getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}"; - protected final String TEXT_166 = NL; - protected final String TEXT_167 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; - protected final String TEXT_168 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; - protected final String TEXT_169 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; - protected final String TEXT_170 = " element = "; - protected final String TEXT_171 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, VIEW_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelEditText() {" + NL + "\t\t"; - protected final String TEXT_172 = " element = "; - protected final String TEXT_173 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, EDIT_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String buildTextByPattern("; - protected final String TEXT_174 = " element, String pattern) {"; - protected final String TEXT_175 = NL + "\t\tif ("; - protected final String TEXT_176 = " == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; - protected final String TEXT_177 = NL + "\t\treturn "; - protected final String TEXT_178 = ".format(pattern, new Object[] {"; - protected final String TEXT_179 = NL + "\t\t\tnew "; - protected final String TEXT_180 = "("; - protected final String TEXT_181 = ")"; - protected final String TEXT_182 = NL + "\t\t});"; - protected final String TEXT_183 = NL + "\t\treturn "; - protected final String TEXT_184 = ".format(pattern, new Object[] {"; - protected final String TEXT_185 = NL + "\t\t\tnew "; - protected final String TEXT_186 = "("; - protected final String TEXT_187 = ")"; - protected final String TEXT_188 = ","; - protected final String TEXT_189 = NL + "\t\t});"; - protected final String TEXT_190 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; - protected final String TEXT_191 = NL + "\t}"; - protected final String TEXT_192 = NL; - protected final String TEXT_193 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_194 = NL + "\t\t"; - protected final String TEXT_195 = " style =" + NL + "\t\t\t("; - protected final String TEXT_196 = ") "; - protected final String TEXT_197 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_198 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_199 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = "; - protected final String TEXT_200 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_201 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_202 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_203 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_204 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new "; - protected final String TEXT_205 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}"; - protected final String TEXT_206 = "\t" + NL + "\t}"; - protected final String TEXT_207 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_208 = " createdFont;"; - protected final String TEXT_209 = "\t"; - protected final String TEXT_210 = NL; - protected final String TEXT_211 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; - protected final String TEXT_212 = " style = ("; - protected final String TEXT_213 = ") "; - protected final String TEXT_214 = ".getStyle("; - protected final String TEXT_215 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_216 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; - protected final String TEXT_217 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new "; - protected final String TEXT_218 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_219 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_220 = " getLabelIcon() {"; - protected final String TEXT_221 = NL + "\t\t"; - protected final String TEXT_222 = " imageDescriptor = "; - protected final String TEXT_223 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; - protected final String TEXT_224 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; - protected final String TEXT_225 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; - protected final String TEXT_226 = NL; - protected final String TEXT_227 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends "; - protected final String TEXT_228 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_229 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher(("; - protected final String TEXT_230 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_231 = NL; - protected final String TEXT_232 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_233 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_234 = " feature, "; - protected final String TEXT_235 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; - protected final String TEXT_236 = NL; - protected final String TEXT_237 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_238 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_239 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_240 = NL; - protected final String TEXT_241 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_242 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t\tRefresher labelRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t};"; - protected final String TEXT_243 = NL + "\t\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_244 = ".eINSTANCE.get"; - protected final String TEXT_245 = "(), labelRefresher);"; + protected final String TEXT_151 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; + protected final String TEXT_152 = NL + "\t\t\t\treturn "; + protected final String TEXT_153 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_154 = ".eINSTANCE.get"; + protected final String TEXT_155 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_156 = ".UNSET_VALUE);"; + protected final String TEXT_157 = NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_158 = NL + "\t}" + NL; + protected final String TEXT_159 = NL; + protected final String TEXT_160 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_161 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_162 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t} else {" + NL + "\t\t\tsuper.performRequest(req);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_163 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; + protected final String TEXT_164 = "(this, "; + protected final String TEXT_165 = ".class, new "; + protected final String TEXT_166 = "() {" + NL + "\t\t\t\tpublic void relocate("; + protected final String TEXT_167 = " celleditor) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_168 = " rect = getLabel().getTextBounds();" + NL + "\t\t\t\t\tgetLabel().translateToAbsolute(rect);" + NL + "\t\t\t\t\tcelleditor.getControl().setBounds(rect.x, rect.y, rect.width, rect.height);" + NL + "\t\t\t\t}" + NL + "\t\t\t}) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelEditText());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL; + protected final String TEXT_169 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((View)getModel()).getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelSourceConnections() {" + NL + "\t\treturn ((View)getModel()).getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelTargetConnections() {" + NL + "\t\treturn ((View)getModel()).getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}"; + protected final String TEXT_170 = NL; + protected final String TEXT_171 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; + protected final String TEXT_172 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; + protected final String TEXT_173 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; + protected final String TEXT_174 = " element = "; + protected final String TEXT_175 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, VIEW_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelEditText() {" + NL + "\t\t"; + protected final String TEXT_176 = " element = "; + protected final String TEXT_177 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, EDIT_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String buildTextByPattern("; + protected final String TEXT_178 = " element, String pattern) {"; + protected final String TEXT_179 = NL + "\t\tif ("; + protected final String TEXT_180 = " == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; + protected final String TEXT_181 = NL + "\t\treturn "; + protected final String TEXT_182 = ".format(pattern, new Object[] {"; + protected final String TEXT_183 = NL + "\t\t\tnew "; + protected final String TEXT_184 = "("; + protected final String TEXT_185 = ")"; + protected final String TEXT_186 = NL + "\t\t});"; + protected final String TEXT_187 = NL + "\t\treturn "; + protected final String TEXT_188 = ".format(pattern, new Object[] {"; + protected final String TEXT_189 = NL + "\t\t\tnew "; + protected final String TEXT_190 = "("; + protected final String TEXT_191 = ")"; + protected final String TEXT_192 = ","; + protected final String TEXT_193 = NL + "\t\t});"; + protected final String TEXT_194 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; + protected final String TEXT_195 = NL + "\t}"; + protected final String TEXT_196 = NL; + protected final String TEXT_197 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_198 = NL + "\t\t"; + protected final String TEXT_199 = " style =" + NL + "\t\t\t("; + protected final String TEXT_200 = ") "; + protected final String TEXT_201 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_202 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_203 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = "; + protected final String TEXT_204 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_205 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_206 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_207 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_208 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new "; + protected final String TEXT_209 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}"; + protected final String TEXT_210 = "\t" + NL + "\t}"; + protected final String TEXT_211 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_212 = " createdFont;"; + protected final String TEXT_213 = "\t"; + protected final String TEXT_214 = NL; + protected final String TEXT_215 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; + protected final String TEXT_216 = " style = ("; + protected final String TEXT_217 = ") "; + protected final String TEXT_218 = ".getStyle("; + protected final String TEXT_219 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_220 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; + protected final String TEXT_221 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new "; + protected final String TEXT_222 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_223 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_224 = " getLabelIcon() {"; + protected final String TEXT_225 = NL + "\t\t"; + protected final String TEXT_226 = " imageDescriptor = "; + protected final String TEXT_227 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; + protected final String TEXT_228 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; + protected final String TEXT_229 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; + protected final String TEXT_230 = NL; + protected final String TEXT_231 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_232 = " domainModelRefresher = new "; + protected final String TEXT_233 = "(this);" + NL; + protected final String TEXT_234 = NL; + protected final String TEXT_235 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_236 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_237 = " feature, "; + protected final String TEXT_238 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; + protected final String TEXT_239 = NL; + protected final String TEXT_240 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_241 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_242 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_243 = NL; + protected final String TEXT_244 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_245 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t\tRefresher labelRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t};"; protected final String TEXT_246 = NL + "\t\t\tstructuralFeatures2Refresher.put("; protected final String TEXT_247 = ".eINSTANCE.get"; protected final String TEXT_248 = "(), labelRefresher);"; - protected final String TEXT_249 = NL; - protected final String TEXT_250 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_251 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_252 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_253 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_254 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; - protected final String TEXT_255 = NL; - protected final String TEXT_256 = "\t\tRefresher fontColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFontColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_257 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; + protected final String TEXT_249 = NL + "\t\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_250 = ".eINSTANCE.get"; + protected final String TEXT_251 = "(), labelRefresher);"; + protected final String TEXT_252 = NL; + protected final String TEXT_253 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_254 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_255 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_256 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_257 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; protected final String TEXT_258 = NL; - protected final String TEXT_259 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_260 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_261 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_262 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_263 = " createLabel() {"; - protected final String TEXT_264 = NL + "\t\treturn new "; - protected final String TEXT_265 = "();"; - protected final String TEXT_266 = NL + "\t\treturn "; - protected final String TEXT_267 = ";"; - protected final String TEXT_268 = NL + "\t\treturn new "; - protected final String TEXT_269 = "();"; - protected final String TEXT_270 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_271 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_272 = " label = createLabel();"; - protected final String TEXT_273 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_274 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_275 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_276 = NL + NL + "\t/**"; - protected final String TEXT_277 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_278 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_279 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_280 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_281 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_282 = "("; - protected final String TEXT_283 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_284 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_285 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_286 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_287 = NL; - protected final String TEXT_288 = NL; - protected final String TEXT_289 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; - protected final String TEXT_290 = NL + "}"; + protected final String TEXT_259 = "\t\tRefresher fontColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFontColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_260 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; + protected final String TEXT_261 = NL; + protected final String TEXT_262 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_263 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_264 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_265 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_266 = " createLabel() {"; + protected final String TEXT_267 = NL + "\t\treturn new "; + protected final String TEXT_268 = "();"; + protected final String TEXT_269 = NL + "\t\treturn "; + protected final String TEXT_270 = ";"; + protected final String TEXT_271 = NL + "\t\treturn new "; + protected final String TEXT_272 = "();"; + protected final String TEXT_273 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_274 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_275 = " label = createLabel();"; + protected final String TEXT_276 = NL + "\t\tdefaultText = label.getText();"; + protected final String TEXT_277 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_278 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_279 = NL + NL + "\t/**"; + protected final String TEXT_280 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_281 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_282 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_283 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_284 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_285 = "("; + protected final String TEXT_286 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_287 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_288 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_289 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_290 = NL; protected final String TEXT_291 = NL; + protected final String TEXT_292 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; + protected final String TEXT_293 = NL + "}"; + protected final String TEXT_294 = NL; public String generate(Object argument) { @@ -423,34 +426,34 @@ importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_22); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); stringBuffer.append(TEXT_23); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_24); { GenCommonBase genCommonBase = genChildNode; - stringBuffer.append(TEXT_24); stringBuffer.append(TEXT_25); - stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_26); - } + stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_27); + } stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_29); if (!isReadOnly) { - stringBuffer.append(TEXT_29); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_30); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); + stringBuffer.append(TEXT_31); } - stringBuffer.append(TEXT_31); - stringBuffer.append(genChildNode.getEditPartClassName()); stringBuffer.append(TEXT_32); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); + stringBuffer.append(genChildNode.getEditPartClassName()); stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_34); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_35); stringBuffer.append(TEXT_36); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_38); @@ -458,6 +461,8 @@ if (!isReadOnly) { stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_40); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_41); String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()"; final String primaryView = "getDiagramNode()"; @@ -465,199 +470,205 @@ if (!isReadOnly) { if (!isReadOnly) { - stringBuffer.append(TEXT_41); stringBuffer.append(TEXT_42); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_43); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_44); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); stringBuffer.append(TEXT_45); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); + stringBuffer.append(TEXT_46); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_47); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_48); - stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + stringBuffer.append(TEXT_49); + stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); stringBuffer.append(TEXT_50); - stringBuffer.append(importManager.getImportedName("java.text.ParseException")); - stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + stringBuffer.append(TEXT_51); + stringBuffer.append(importManager.getImportedName("java.text.ParseException")); stringBuffer.append(TEXT_52); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_53); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_54); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_55); + stringBuffer.append(primaryView); + stringBuffer.append(TEXT_56); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_56); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_57); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_59); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_60); - stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_61); - stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_62); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); + stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_63); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); + stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_64); - stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_65); - stringBuffer.append(featureToSet.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_66); - stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); + stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_67); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); + stringBuffer.append(featureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_68); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); + stringBuffer.append(TEXT_69); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); + stringBuffer.append(TEXT_70); if (ecoreFeature.isMany()) { - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_73); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_75); stringBuffer.append(featureToSet.getAccessorName()); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_78); } else { - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_80); } - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_81); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_82); stringBuffer.append(metaFeatures.size()); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_85); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_89); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_92); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_93); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_94); } - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_97); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_95); - stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_98); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); + stringBuffer.append(TEXT_99); stringBuffer.append(i); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_101); if (nextEcoreFeature.isMany()) { - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_102); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_103); } - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_105); stringBuffer.append(nextFeatureToSet.getAccessorName()); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_108); } else { - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_110); } } - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_111); } - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_112); } - stringBuffer.append(TEXT_110); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_123); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_125); { TypeModelFacet facet = genNode.getModelFacet(); @@ -665,120 +676,120 @@ GenFeature childFeature = facet.getChildMetaFeature(); GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_128); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_131); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_132); } else { - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_134); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_135); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_137); } if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_140); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_141); } else { - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_144); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_146); } - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_147); } else { if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_150); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_151); } else { - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_154); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_156); } } - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_157); } /*restrict local vars used in component edit policy*/ - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_158); if (!isReadOnly) { - stringBuffer.append(TEXT_155); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_161); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_168); } - stringBuffer.append(TEXT_165); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_170); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ HashMap primitiveTypeToWrapperClassName = new HashMap(); @@ -822,91 +833,91 @@ if (labelModelFacet instanceof FeatureLabelModelFacet) { } } - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_171); stringBuffer.append(viewPattern); - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_172); stringBuffer.append(editPattern); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_174); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_176); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_178); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_179); myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_180); } - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_182); if (feature.isPrimitiveType()) { - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_183); stringBuffer.append(primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_184); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); if (feature.isPrimitiveType()) { - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_185); } - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_186); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_188); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); if (next.isPrimitiveType()) { - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_189); stringBuffer.append(primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_190); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); if (next.isPrimitiveType()) { - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_191); } if (it.hasNext()) { - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_192); } } - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_193); } else { - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_194); } - stringBuffer.append(TEXT_191); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_196); boolean isFixedFontSetInFigure; { @@ -914,149 +925,147 @@ boolean isFixedFontSetInFigure; isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_197); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_200); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_203); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_209); } - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_210); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_212); } - stringBuffer.append(TEXT_209); - stringBuffer.append(TEXT_210); - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_217); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_220); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_221); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_222); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_224); if (genChildNode.isLabelElementIcon()) { - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_227); } - stringBuffer.append(TEXT_224); - /*@ include file="adapters/propertySource.javajetinc"*/ - stringBuffer.append(TEXT_225); - stringBuffer.append(TEXT_226); - stringBuffer.append(TEXT_227); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); stringBuffer.append(TEXT_228); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + /*@ include file="adapters/propertySource.javajetinc"*/ stringBuffer.append(TEXT_229); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_230); stringBuffer.append(TEXT_231); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); stringBuffer.append(TEXT_232); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); stringBuffer.append(TEXT_233); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_234); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_235); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_236); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_237); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_238); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_239); stringBuffer.append(TEXT_240); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_241); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_244); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_245); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_246); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_247); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_248); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_249); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_250); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_251); } } - stringBuffer.append(TEXT_249); - stringBuffer.append(TEXT_250); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_251); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_252); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_253); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_254); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_255); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_256); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_259); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_260); final Viewmap viewmap = genChildNode.getViewmap(); - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_261); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -1085,64 +1094,64 @@ if (viewmap instanceof InnerClassViewmap) { if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_262); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_263); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_264); } else { - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_265); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_266); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_267); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_268); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_269); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_270); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_271); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_272); } - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_273); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_274); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_272); + stringBuffer.append(TEXT_275); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_273); + stringBuffer.append(TEXT_276); } else { - stringBuffer.append(TEXT_274); + stringBuffer.append(TEXT_277); } - stringBuffer.append(TEXT_275); + stringBuffer.append(TEXT_278); } /*not parent-assigned*/ - stringBuffer.append(TEXT_276); + stringBuffer.append(TEXT_279); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_277); + stringBuffer.append(TEXT_280); } - stringBuffer.append(TEXT_278); + stringBuffer.append(TEXT_281); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_279); + stringBuffer.append(TEXT_282); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_280); + stringBuffer.append(TEXT_283); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -1156,43 +1165,43 @@ if (viewmap instanceof ParentAssignedViewmap) { } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_281); + stringBuffer.append(TEXT_284); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_282); + stringBuffer.append(TEXT_285); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_283); + stringBuffer.append(TEXT_286); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_284); + stringBuffer.append(TEXT_287); } else { - stringBuffer.append(TEXT_285); + stringBuffer.append(TEXT_288); } - stringBuffer.append(TEXT_286); + stringBuffer.append(TEXT_289); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_287); + stringBuffer.append(TEXT_290); stringBuffer.append(classBody); - stringBuffer.append(TEXT_288); + stringBuffer.append(TEXT_291); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_289); + stringBuffer.append(TEXT_292); } } - stringBuffer.append(TEXT_290); + stringBuffer.append(TEXT_293); importManager.emitSortedImports(); - stringBuffer.append(TEXT_291); + stringBuffer.append(TEXT_294); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java index cbee5346d..3248113d4 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java @@ -39,273 +39,261 @@ public class CompartmentEditPartGenerator protected final String TEXT_20 = NL; protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; protected final String TEXT_22 = " extends "; - protected final String TEXT_23 = " implements IUpdatableEditPart {"; - protected final String TEXT_24 = NL; - protected final String TEXT_25 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_26 = ";"; - protected final String TEXT_27 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_28 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_29 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_30 = " getDiagramNode() {" + NL + "\t\treturn ("; - protected final String TEXT_31 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; - protected final String TEXT_32 = NL + "\t\tinstallEditPolicy("; - protected final String TEXT_33 = ".LAYOUT_ROLE, new "; - protected final String TEXT_34 = "() {" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final "; - protected final String TEXT_35 = " request, final EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t"; - protected final String TEXT_36 = " emfCommand = new "; - protected final String TEXT_37 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate "; - protected final String TEXT_38 = " moveDelta;" + NL + "\t\t\t\t\tprivate "; - protected final String TEXT_39 = " resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_40 = " original = new "; - protected final String TEXT_41 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_42 = " referenceFigure = (("; - protected final String TEXT_43 = ")child).getFigure();" + NL + "\t\t\t\t\t\treferenceFigure.translateToAbsolute(original);" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_44 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(transformed);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute("; - protected final String TEXT_45 = " move, "; - protected final String TEXT_46 = " resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_47 = ".getEditingDomain(node.getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn "; - protected final String TEXT_48 = ".INSTANCE;" + NL + "\t\t\t}"; - protected final String TEXT_49 = NL + "\t\tinstallEditPolicy("; - protected final String TEXT_50 = ".LAYOUT_ROLE, new "; - protected final String TEXT_51 = "() {" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_52 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_53 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_54 = ".INSTANCE;" + NL + "\t\t\t}"; - protected final String TEXT_55 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; - protected final String TEXT_56 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_57 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_58 = ".CreateRequestEx requestEx = ("; - protected final String TEXT_59 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_60 = " result = new "; - protected final String TEXT_61 = "();" + NL + "\t\t\t\t\tfor(int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_62 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_63 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_64 = "Command((View) getModel(), requestEx"; - protected final String TEXT_65 = ", " + NL + "\t\t\t\t\t\t\t\t("; - protected final String TEXT_66 = ")getConstraintFor(request)"; - protected final String TEXT_67 = "));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_68 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_69 = ".getEditingDomain(((View) getModel()).getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_70 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getTitleName() {" + NL + "\t\treturn \""; - protected final String TEXT_71 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_72 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_73 = " result = new "; - protected final String TEXT_74 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new "; - protected final String TEXT_75 = "());" + NL + "\t\t"; - protected final String TEXT_76 = " scrollPane = new "; - protected final String TEXT_77 = "();" + NL + "\t\tresult.add(scrollPane);"; - protected final String TEXT_78 = NL + "\t\t"; - protected final String TEXT_79 = " viewport = new "; - protected final String TEXT_80 = "();" + NL + "\t\tcontentPane = new "; - protected final String TEXT_81 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; - protected final String TEXT_82 = "());"; - protected final String TEXT_83 = NL + "\t\t"; - protected final String TEXT_84 = " viewport = new "; - protected final String TEXT_85 = "();" + NL + "\t\tcontentPane = new "; - protected final String TEXT_86 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; - protected final String TEXT_87 = "());"; - protected final String TEXT_88 = NL + "\t\tviewport.setContents(contentPane);" + NL + "\t\tscrollPane.setViewport(viewport);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IFigure contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_89 = " resolveSemanticElement() {" + NL + "\t\tView view = getDiagramNode();" + NL + "\t\treturn (view.getElement() instanceof "; - protected final String TEXT_90 = ") ? ("; - protected final String TEXT_91 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; - protected final String TEXT_92 = NL; - protected final String TEXT_93 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_94 = " domainModelEditDomain = "; - protected final String TEXT_95 = ".getEditingDomain("; - protected final String TEXT_96 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; - protected final String TEXT_97 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_98 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_99 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; - protected final String TEXT_100 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; - protected final String TEXT_101 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_102 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_103 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_104 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; - protected final String TEXT_105 = NL + "\t\t\tfilter = "; - protected final String TEXT_106 = ".createFeatureFilter("; - protected final String TEXT_107 = ".eINSTANCE.get"; - protected final String TEXT_108 = "());"; - protected final String TEXT_109 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_110 = ".createFeatureFilter("; - protected final String TEXT_111 = ".eINSTANCE.get"; - protected final String TEXT_112 = "()));"; - protected final String TEXT_113 = NL + "\t\t\tfilter = filter.and("; - protected final String TEXT_114 = ".createNotifierFilter("; - protected final String TEXT_115 = ".getElement()));"; - protected final String TEXT_116 = NL + "\t\t\tfilter = "; - protected final String TEXT_117 = ".createNotifierFilter("; - protected final String TEXT_118 = ".getElement());"; - protected final String TEXT_119 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; - protected final String TEXT_120 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_121 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_122 = " transactionAboutToCommit("; - protected final String TEXT_123 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_124 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; - protected final String TEXT_125 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_126 = " domainModelEditDomain = "; - protected final String TEXT_127 = ".getEditingDomain("; - protected final String TEXT_128 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_129 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_130 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; - protected final String TEXT_131 = " notationalChildren = "; - protected final String TEXT_132 = ".getChildren();" + NL + "\t\tfinal "; - protected final String TEXT_133 = " semanticToNotational = new "; - protected final String TEXT_134 = "();" + NL + "\t\tfor("; - protected final String TEXT_135 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_136 = " next = ("; - protected final String TEXT_137 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_138 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_139 = " parentView = "; - protected final String TEXT_140 = ";" + NL + "\t\t"; - protected final String TEXT_141 = " command = new "; - protected final String TEXT_142 = "();" + NL + "\t\tfor("; - protected final String TEXT_143 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_144 = " next = ("; - protected final String TEXT_145 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_146 = " currentView = ("; - protected final String TEXT_147 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; - protected final String TEXT_148 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != "; - protected final String TEXT_149 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; - protected final String TEXT_150 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_151 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_152 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_153 = " obsoleteView = ("; - protected final String TEXT_154 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_155 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_156 = " getCreateNotationalElementCommand("; - protected final String TEXT_157 = " parentView, "; - protected final String TEXT_158 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; - protected final String TEXT_159 = NL + "\t\tcase "; - protected final String TEXT_160 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; - protected final String TEXT_161 = ") {" + NL + "\t\t\t\treturn new Create"; - protected final String TEXT_162 = "NotationCommand(parentView, domainElement"; - protected final String TEXT_163 = ", new Rectangle(0, 0, 0, 0)"; - protected final String TEXT_164 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; - protected final String TEXT_165 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_166 = " getSemanticChildren() {"; - protected final String TEXT_167 = NL; - protected final String TEXT_168 = NL + "\treturn "; - protected final String TEXT_169 = ".EMPTY_LIST;"; - protected final String TEXT_170 = NL + "\t"; - protected final String TEXT_171 = " result = new "; - protected final String TEXT_172 = "();"; - protected final String TEXT_173 = NL + "\t"; - protected final String TEXT_174 = " viewObject = "; - protected final String TEXT_175 = ";" + NL + "\t"; - protected final String TEXT_176 = " modelObject = viewObject.getElement();" + NL + "\t"; - protected final String TEXT_177 = " nextValue;" + NL + "\tint nodeVID;"; - protected final String TEXT_178 = NL + "\tfor("; - protected final String TEXT_179 = " it = "; - protected final String TEXT_180 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_181 = ") it.next();"; - protected final String TEXT_182 = NL + "\tnextValue = ("; - protected final String TEXT_183 = ")"; - protected final String TEXT_184 = ";"; - protected final String TEXT_185 = NL + "\tnodeVID = "; - protected final String TEXT_186 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; - protected final String TEXT_187 = NL + "\tswitch (nodeVID) {"; - protected final String TEXT_188 = NL + "\tcase "; - protected final String TEXT_189 = ".VISUAL_ID: {"; - protected final String TEXT_190 = NL + "\tif ("; - protected final String TEXT_191 = ".VISUAL_ID == nodeVID) {"; - protected final String TEXT_192 = NL + "\t\tresult.add(nextValue);"; - protected final String TEXT_193 = NL + "\t\tbreak;" + NL + "\t\t}"; - protected final String TEXT_194 = NL + "\t\t}"; - protected final String TEXT_195 = NL + "\t}"; - protected final String TEXT_196 = NL + "\t}"; - protected final String TEXT_197 = NL + "\treturn result;"; - protected final String TEXT_198 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns "; - protected final String TEXT_199 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn "; - protected final String TEXT_200 = ";" + NL + "\t}"; - protected final String TEXT_201 = NL; + protected final String TEXT_23 = " implements "; + protected final String TEXT_24 = " {"; + protected final String TEXT_25 = NL; + protected final String TEXT_26 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_27 = ";"; + protected final String TEXT_28 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_29 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_30 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_31 = " getDiagramNode() {" + NL + "\t\treturn ("; + protected final String TEXT_32 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; + protected final String TEXT_33 = NL + "\t\tinstallEditPolicy("; + protected final String TEXT_34 = ".LAYOUT_ROLE, new "; + protected final String TEXT_35 = "() {" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final "; + protected final String TEXT_36 = " request, final EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t"; + protected final String TEXT_37 = " emfCommand = new "; + protected final String TEXT_38 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate "; + protected final String TEXT_39 = " moveDelta;" + NL + "\t\t\t\t\tprivate "; + protected final String TEXT_40 = " resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_41 = " original = new "; + protected final String TEXT_42 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_43 = " referenceFigure = (("; + protected final String TEXT_44 = ")child).getFigure();" + NL + "\t\t\t\t\t\treferenceFigure.translateToAbsolute(original);" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_45 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(transformed);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute("; + protected final String TEXT_46 = " move, "; + protected final String TEXT_47 = " resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new "; + protected final String TEXT_48 = "("; + protected final String TEXT_49 = ".getEditingDomain(node.getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn "; + protected final String TEXT_50 = ".INSTANCE;" + NL + "\t\t\t}"; + protected final String TEXT_51 = NL + "\t\tinstallEditPolicy("; + protected final String TEXT_52 = ".LAYOUT_ROLE, new "; + protected final String TEXT_53 = "() {" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_54 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_55 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_56 = ".INSTANCE;" + NL + "\t\t\t}"; + protected final String TEXT_57 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; + protected final String TEXT_58 = NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_59 = ") {" + NL + "\t\t\t\t\t"; + protected final String TEXT_60 = " requestEx = ("; + protected final String TEXT_61 = ") request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_62 = " result = new "; + protected final String TEXT_63 = "();" + NL + "\t\t\t\t\tfor(int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; + protected final String TEXT_64 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_65 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_66 = "Command((View) getModel(), requestEx"; + protected final String TEXT_67 = ", " + NL + "\t\t\t\t\t\t\t\t("; + protected final String TEXT_68 = ")getConstraintFor(request)"; + protected final String TEXT_69 = "));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_70 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new "; + protected final String TEXT_71 = "("; + protected final String TEXT_72 = ".getEditingDomain(((View) getModel()).getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_73 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getTitleName() {" + NL + "\t\treturn \""; + protected final String TEXT_74 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_75 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_76 = " result = new "; + protected final String TEXT_77 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new "; + protected final String TEXT_78 = "());" + NL + "\t\t"; + protected final String TEXT_79 = " scrollPane = new "; + protected final String TEXT_80 = "();" + NL + "\t\tresult.add(scrollPane);"; + protected final String TEXT_81 = NL + "\t\t"; + protected final String TEXT_82 = " viewport = new "; + protected final String TEXT_83 = "();" + NL + "\t\tcontentPane = new "; + protected final String TEXT_84 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; + protected final String TEXT_85 = "());"; + protected final String TEXT_86 = NL + "\t\t"; + protected final String TEXT_87 = " viewport = new "; + protected final String TEXT_88 = "();" + NL + "\t\tcontentPane = new "; + protected final String TEXT_89 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; + protected final String TEXT_90 = "());"; + protected final String TEXT_91 = NL + "\t\tviewport.setContents(contentPane);" + NL + "\t\tscrollPane.setViewport(viewport);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IFigure contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_92 = " resolveSemanticElement() {" + NL + "\t\tView view = getDiagramNode();" + NL + "\t\treturn (view.getElement() instanceof "; + protected final String TEXT_93 = ") ? ("; + protected final String TEXT_94 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; + protected final String TEXT_95 = NL; + protected final String TEXT_96 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\t"; + protected final String TEXT_97 = " refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_98 = " domainModelEditDomain = "; + protected final String TEXT_99 = ".getEditingDomain("; + protected final String TEXT_100 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_101 = " notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_102 = " getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; + protected final String TEXT_103 = " {"; + protected final String TEXT_104 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; + protected final String TEXT_105 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_106 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_107 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_108 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_109 = " createFilter() {"; + protected final String TEXT_110 = NL + "\t\t\t"; + protected final String TEXT_111 = " filter = "; + protected final String TEXT_112 = ".createFeatureFilter("; + protected final String TEXT_113 = ".eINSTANCE.get"; + protected final String TEXT_114 = "());"; + protected final String TEXT_115 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_116 = ".createFeatureFilter("; + protected final String TEXT_117 = ".eINSTANCE.get"; + protected final String TEXT_118 = "()));"; + protected final String TEXT_119 = NL + "\t\t\tfilter = filter.and("; + protected final String TEXT_120 = ".createNotifierFilter("; + protected final String TEXT_121 = ".getElement()));"; + protected final String TEXT_122 = NL + "\t\t\t"; + protected final String TEXT_123 = " filter = "; + protected final String TEXT_124 = ".createNotifierFilter("; + protected final String TEXT_125 = ".getElement());"; + protected final String TEXT_126 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; + protected final String TEXT_127 = NL + "\t\t\t"; + protected final String TEXT_128 = " filter = getConstrainedChildrenFilter();"; + protected final String TEXT_129 = NL + "\t\t\t"; + protected final String TEXT_130 = " filter = "; + protected final String TEXT_131 = ".NOT_TOUCH;"; + protected final String TEXT_132 = NL + "\t\t\treturn filter;"; + protected final String TEXT_133 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_134 = " getCreateNotationalElementCommand("; + protected final String TEXT_135 = " descriptor) {" + NL + "\t\t\t"; + protected final String TEXT_136 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {"; + protected final String TEXT_137 = NL + "\t\t\tcase "; + protected final String TEXT_138 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof "; + protected final String TEXT_139 = ") {" + NL + "\t\t\t\t\treturn new Create"; + protected final String TEXT_140 = "NotationCommand(getHost(), domainElement"; + protected final String TEXT_141 = ", new Rectangle(0, 0, 0, 0)"; + protected final String TEXT_142 = ");" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;"; + protected final String TEXT_143 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_144 = " getSemanticChildNodes() {"; + protected final String TEXT_145 = NL; + protected final String TEXT_146 = NL + "\treturn "; + protected final String TEXT_147 = ".EMPTY_LIST;"; + protected final String TEXT_148 = NL + "\t"; + protected final String TEXT_149 = " result = new "; + protected final String TEXT_150 = "();"; + protected final String TEXT_151 = NL + "\t"; + protected final String TEXT_152 = " viewObject = "; + protected final String TEXT_153 = ";" + NL + "\t"; + protected final String TEXT_154 = " modelObject = viewObject.getElement();" + NL + "\t"; + protected final String TEXT_155 = " nextValue;" + NL + "\tint nodeVID;"; + protected final String TEXT_156 = NL + "\tfor("; + protected final String TEXT_157 = " it = "; + protected final String TEXT_158 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_159 = ") it.next();"; + protected final String TEXT_160 = NL + "\tnextValue = ("; + protected final String TEXT_161 = ")"; + protected final String TEXT_162 = ";"; + protected final String TEXT_163 = NL + "\tnodeVID = "; + protected final String TEXT_164 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; + protected final String TEXT_165 = NL + "\tswitch (nodeVID) {"; + protected final String TEXT_166 = NL + "\tcase "; + protected final String TEXT_167 = ".VISUAL_ID: {"; + protected final String TEXT_168 = NL + "\tif ("; + protected final String TEXT_169 = ".VISUAL_ID == nodeVID) {"; + protected final String TEXT_170 = NL + "\t\tresult.add(new "; + protected final String TEXT_171 = "(nextValue, nodeVID));"; + protected final String TEXT_172 = NL + "\t\tbreak;" + NL + "\t\t}"; + protected final String TEXT_173 = NL + "\t\t}"; + protected final String TEXT_174 = NL + "\t}"; + protected final String TEXT_175 = NL + "\t}"; + protected final String TEXT_176 = NL + "\treturn result;"; + protected final String TEXT_177 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t\t * The generated code always returns "; + protected final String TEXT_178 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView("; + protected final String TEXT_179 = " descriptor) {" + NL + "\t\t\treturn "; + protected final String TEXT_180 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_181 = " getHost() {" + NL + "\t\t\treturn "; + protected final String TEXT_182 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; + protected final String TEXT_183 = " childRefresher = getNotationModelRefresher();" + NL + "\t\tif (!childRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_184 = " command = childRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_185 = " domainModelEditDomain = "; + protected final String TEXT_186 = ".getEditingDomain("; + protected final String TEXT_187 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new "; + protected final String TEXT_188 = "(domainModelEditDomain, command));" + NL + "\t}" + NL; + protected final String TEXT_189 = NL; + protected final String TEXT_190 = NL; + protected final String TEXT_191 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_192 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_193 = " feature, "; + protected final String TEXT_194 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; + protected final String TEXT_195 = NL; + protected final String TEXT_196 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_197 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_198 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_199 = NL; + protected final String TEXT_200 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_201 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL; protected final String TEXT_202 = NL; protected final String TEXT_203 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_204 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_205 = " feature, "; - protected final String TEXT_206 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; - protected final String TEXT_207 = NL; - protected final String TEXT_208 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_209 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_210 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_211 = NL; - protected final String TEXT_212 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_213 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL; - protected final String TEXT_214 = NL; - protected final String TEXT_215 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_216 = "static "; - protected final String TEXT_217 = "class Create"; - protected final String TEXT_218 = "NotationCommand extends "; - protected final String TEXT_219 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; - protected final String TEXT_220 = "NotationCommand("; - protected final String TEXT_221 = " parent, " + NL + "\t\t\t\t"; - protected final String TEXT_222 = " domainElement"; - protected final String TEXT_223 = ", "; - protected final String TEXT_224 = " constraint"; - protected final String TEXT_225 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; - protected final String TEXT_226 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; - protected final String TEXT_227 = ".decorateView(createdNode);"; - protected final String TEXT_228 = NL + "\t\t\t"; - protected final String TEXT_229 = " bounds = "; - protected final String TEXT_230 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);"; - protected final String TEXT_231 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; - protected final String TEXT_232 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; - protected final String TEXT_233 = "));"; - protected final String TEXT_234 = NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_235 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_236 = "static "; - protected final String TEXT_237 = "class Create"; - protected final String TEXT_238 = "Command extends "; - protected final String TEXT_239 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; - protected final String TEXT_240 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_241 = "Command("; - protected final String TEXT_242 = " parent, "; - protected final String TEXT_243 = ".CreateRequestEx request"; - protected final String TEXT_244 = ", "; - protected final String TEXT_245 = " constraint"; - protected final String TEXT_246 = ") {" + NL + "\t\t\t"; - protected final String TEXT_247 = " domainModelEditDomain = "; - protected final String TEXT_248 = ".getEditingDomain(parent.getDiagram().getElement());"; - protected final String TEXT_249 = NL + "\t\t\t"; - protected final String TEXT_250 = " createdDomainElement = "; - protected final String TEXT_251 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; - protected final String TEXT_252 = ".eINSTANCE.get"; - protected final String TEXT_253 = "());"; - protected final String TEXT_254 = NL + "\t\t\t"; - protected final String TEXT_255 = " createdDomainElement = "; - protected final String TEXT_256 = ".eINSTANCE.create"; - protected final String TEXT_257 = "();"; - protected final String TEXT_258 = NL + "\t\t\t"; - protected final String TEXT_259 = NL + "\t\t\t"; - protected final String TEXT_260 = "."; - protected final String TEXT_261 = ".initializeElement("; - protected final String TEXT_262 = "("; - protected final String TEXT_263 = ") "; - protected final String TEXT_264 = "createdDomainElement);"; - protected final String TEXT_265 = NL + "\t\t\t"; - protected final String TEXT_266 = " compoundCommand = new "; - protected final String TEXT_267 = "();" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_268 = ".create(domainModelEditDomain, "; - protected final String TEXT_269 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_270 = ".eINSTANCE.get"; - protected final String TEXT_271 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_272 = ".create(domainModelEditDomain, "; - protected final String TEXT_273 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_274 = ".eINSTANCE.get"; - protected final String TEXT_275 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; - protected final String TEXT_276 = NL + "\t\t\tthis.domainModelAddCommand = "; - protected final String TEXT_277 = ".create(domainModelEditDomain, "; - protected final String TEXT_278 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_279 = ".eINSTANCE.get"; - protected final String TEXT_280 = "(), createdDomainElement);"; - protected final String TEXT_281 = NL + "\t\t\tthis.notationAddCommand = new Create"; - protected final String TEXT_282 = "NotationCommand(parent, "; - protected final String TEXT_283 = "("; - protected final String TEXT_284 = ") "; - protected final String TEXT_285 = "createdDomainElement"; - protected final String TEXT_286 = ", constraint"; - protected final String TEXT_287 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_288 = NL + "}" + NL; - protected final String TEXT_289 = NL; + protected final String TEXT_204 = "static "; + protected final String TEXT_205 = "class Create"; + protected final String TEXT_206 = "NotationCommand extends "; + protected final String TEXT_207 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; + protected final String TEXT_208 = "NotationCommand("; + protected final String TEXT_209 = " parent, " + NL + "\t\t\t\t"; + protected final String TEXT_210 = " domainElement"; + protected final String TEXT_211 = ", "; + protected final String TEXT_212 = " constraint"; + protected final String TEXT_213 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; + protected final String TEXT_214 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; + protected final String TEXT_215 = ".decorateView(createdNode);"; + protected final String TEXT_216 = NL + "\t\t\t"; + protected final String TEXT_217 = " bounds = "; + protected final String TEXT_218 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);"; + protected final String TEXT_219 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; + protected final String TEXT_220 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; + protected final String TEXT_221 = "));"; + protected final String TEXT_222 = NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_223 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_224 = "static "; + protected final String TEXT_225 = "class Create"; + protected final String TEXT_226 = "Command extends "; + protected final String TEXT_227 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; + protected final String TEXT_228 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_229 = "Command("; + protected final String TEXT_230 = " parent, "; + protected final String TEXT_231 = " request"; + protected final String TEXT_232 = ", "; + protected final String TEXT_233 = " constraint"; + protected final String TEXT_234 = ") {" + NL + "\t\t\t"; + protected final String TEXT_235 = " domainModelEditDomain = "; + protected final String TEXT_236 = ".getEditingDomain(parent.getDiagram().getElement());"; + protected final String TEXT_237 = NL + "\t\t\t"; + protected final String TEXT_238 = " createdDomainElement = "; + protected final String TEXT_239 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; + protected final String TEXT_240 = ".eINSTANCE.get"; + protected final String TEXT_241 = "());"; + protected final String TEXT_242 = NL + "\t\t\t"; + protected final String TEXT_243 = " createdDomainElement = "; + protected final String TEXT_244 = ".eINSTANCE.create"; + protected final String TEXT_245 = "();"; + protected final String TEXT_246 = NL + "\t\t\t"; + protected final String TEXT_247 = NL + "\t\t\t"; + protected final String TEXT_248 = "."; + protected final String TEXT_249 = ".initializeElement("; + protected final String TEXT_250 = "("; + protected final String TEXT_251 = ") "; + protected final String TEXT_252 = "createdDomainElement);"; + protected final String TEXT_253 = NL + "\t\t\t"; + protected final String TEXT_254 = " compoundCommand = new "; + protected final String TEXT_255 = "();" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_256 = ".create(domainModelEditDomain, "; + protected final String TEXT_257 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_258 = ".eINSTANCE.get"; + protected final String TEXT_259 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_260 = ".create(domainModelEditDomain, "; + protected final String TEXT_261 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_262 = ".eINSTANCE.get"; + protected final String TEXT_263 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; + protected final String TEXT_264 = NL + "\t\t\tthis.domainModelAddCommand = "; + protected final String TEXT_265 = ".create(domainModelEditDomain, "; + protected final String TEXT_266 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_267 = ".eINSTANCE.get"; + protected final String TEXT_268 = "(), createdDomainElement);"; + protected final String TEXT_269 = NL + "\t\t\tthis.notationAddCommand = new Create"; + protected final String TEXT_270 = "NotationCommand(parent, "; + protected final String TEXT_271 = "("; + protected final String TEXT_272 = ") "; + protected final String TEXT_273 = "createdDomainElement"; + protected final String TEXT_274 = ", constraint"; + protected final String TEXT_275 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_276 = NL + "}" + NL; + protected final String TEXT_277 = NL; public String generate(Object argument) { @@ -416,169 +404,177 @@ importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_22); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); stringBuffer.append(TEXT_23); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_24); { GenCommonBase genCommonBase = genCompartment; - stringBuffer.append(TEXT_24); stringBuffer.append(TEXT_25); - stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_26); - } + stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_27); - stringBuffer.append(genCompartment.getEditPartClassName()); + } stringBuffer.append(TEXT_28); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(genCompartment.getEditPartClassName()); stringBuffer.append(TEXT_29); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_30); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_31); - if (!genCompartment.isListLayout()) { + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_32); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); + if (!genCompartment.isListLayout()) { stringBuffer.append(TEXT_33); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.XYLayoutEditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_34); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.XYLayoutEditPolicy")); stringBuffer.append(TEXT_35); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest")); stringBuffer.append(TEXT_36); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_37); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); stringBuffer.append(TEXT_38); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); stringBuffer.append(TEXT_39); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_41); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_42); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_43); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); stringBuffer.append(TEXT_44); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_45); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); stringBuffer.append(TEXT_46); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); stringBuffer.append(TEXT_47); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_48); - } else { + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_49); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_50); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); + } else { stringBuffer.append(TEXT_51); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_52); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); stringBuffer.append(TEXT_53); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_54); - } + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); stringBuffer.append(TEXT_55); - if (null != genDiagram.getPalette()) { -final Palette palette = genDiagram.getPalette(); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_56); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + } stringBuffer.append(TEXT_57); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + if (null != genDiagram.getPalette()) { +final Palette palette = genDiagram.getPalette(); stringBuffer.append(TEXT_58); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_59); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_60); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_61); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_62); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_63); for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { GenChildNode next = (GenChildNode)it.next(); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_65); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_66); if (!genCompartment.isListLayout()) { - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_68); } - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_69); } - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_70); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_72); }/*when there's palette*/ - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_73); stringBuffer.append(genCompartment.getTitle()); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_80); if (genCompartment.isListLayout()) { - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_85); } else { - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformViewport")); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_90); } - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_94); { String _getViewCode = "getDiagramNode()"; String _getDiagramCode = _getViewCode + ".getDiagram()"; boolean isListLayout = genCompartment.isListLayout(); - stringBuffer.append(TEXT_92); - stringBuffer.append(TEXT_93); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_94); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_95); - stringBuffer.append(_getDiagramCode); stringBuffer.append(TEXT_96); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); stringBuffer.append(TEXT_97); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_98); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_99); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_100); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); + stringBuffer.append(TEXT_101); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); + stringBuffer.append(TEXT_102); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); + stringBuffer.append(TEXT_103); boolean hasConstraintsInChildren = false; for (Iterator it = childNodes.iterator(); it.hasNext(); ) { @@ -593,17 +589,19 @@ for (Iterator it = childNodes.iterator(); it.hasNext(); ) { if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_104); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_105); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_107); } - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_108); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_109); { boolean hasDeclaredFilter = false; @@ -622,23 +620,25 @@ if (hasConstraintsInChildren) { if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_111); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_113); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_114); } else { - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_117); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_118); } } //for @@ -646,107 +646,61 @@ if (hasConstraintsInChildren) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_120); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_121); } else { + hasDeclaredFilter = true; - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_123); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_124); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_125); } -} //local declaration of hasDeclaredFilter -if (hasConstraintsInChildren) { + if (hasConstraintsInChildren) { + if (hasDeclaredFilter) { + hasDeclaredFilter = true; - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_126); -} + } else { - stringBuffer.append(TEXT_120); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_121); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_122); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_123); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_124); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_125); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_126); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_127); - stringBuffer.append(_getDiagramCode); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_128); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + + } + } + if (!hasDeclaredFilter) { + stringBuffer.append(TEXT_129); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_130); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_131); - stringBuffer.append(_getViewCode); + + } + stringBuffer.append(TEXT_132); - stringBuffer.append(importManager.getImportedName("java.util.Map")); + +} //local declaration of hasDeclaredFilter + stringBuffer.append(TEXT_133); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); stringBuffer.append(TEXT_134); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); stringBuffer.append(TEXT_135); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_136); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_137); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_138); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_139); - stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_140); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_141); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_142); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_143); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_144); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_145); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_146); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_147); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_148); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_149); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_150); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_151); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_152); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_153); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_154); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand")); - stringBuffer.append(TEXT_155); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_156); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_136); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); @@ -756,39 +710,39 @@ for (Iterator it = childNodes.iterator(); it.hasNext(); ) { } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_137); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_138); stringBuffer.append(childNodeInterfaceName); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_139); stringBuffer.append(nextNode.getDomainMetaClass().getName()); stringBuffer.append(nextNode.getVisualID()); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_140); if (!isListLayout) { - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_141); } - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_142); } - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_166); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_145); if (childNodes.size() == 0) { - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_147); } else { - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_150); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { @@ -806,15 +760,15 @@ if (childNodes.size() == 0) { Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_152); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_155); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { @@ -823,105 +777,125 @@ if (childNodes.size() == 0) { Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_157); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_158); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_159); } else { - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_161); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_162); } - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_164); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_165); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_167); } else { - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_169); } - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_170); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); + stringBuffer.append(TEXT_171); if (generateSwitch) { - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_172); } else { - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_173); } } if (generateSwitch) { - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_174); } if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_175); } } - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_176); } - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_177); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_178); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); + stringBuffer.append(TEXT_179); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_180); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_181); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_182); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher")); + stringBuffer.append(TEXT_183); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_184); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_185); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_186); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_187); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_188); } - stringBuffer.append(TEXT_201); - stringBuffer.append(TEXT_202); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_206); - stringBuffer.append(TEXT_207); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_210); - stringBuffer.append(TEXT_211); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_200); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_201); for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { GenChildNode next = (GenChildNode)it.next(); @@ -929,42 +903,42 @@ for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { boolean isListLayout = genCompartment.isListLayout(); String resolvedSemanticElement = "resolveSemanticElement()"; - stringBuffer.append(TEXT_214); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_203); if (isStatic) { - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_204); } - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_205); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_218); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_206); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand")); + stringBuffer.append(TEXT_207); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_210); if (!isListLayout) { - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_212); } - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_213); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_215); if (!isListLayout) { - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_218); int defaultWidth = 40; int defaultHeight = 40; @@ -974,152 +948,152 @@ for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { defaultHeight = defSizeAttrs.getHeight(); } - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_219); stringBuffer.append(defaultWidth); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_220); stringBuffer.append(defaultHeight); - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_221); } - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_222); if (genDiagram.getPalette() != null) { - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_223); if (isStatic) { - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_224); } - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_225); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_227); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_228); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_229); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_242); - stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_230); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); + stringBuffer.append(TEXT_231); if (!isListLayout) { - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_232); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_233); } - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_234); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_235); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_236); if (next.getDomainMetaClass().isMapEntry()) { /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_237); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_238); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_240); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_241); } else { - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_242); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_243); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_244); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_245); } - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_246); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_248); stringBuffer.append(next.getUniqueIdentifier()); - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_249); if (next.getDomainMetaClass().isExternalInterface()) { - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_250); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_251); } - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_252); TypeModelFacet facet = next.getModelFacet(); GenFeature childFeature = facet.getChildMetaFeature(); GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_253); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_254); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_255); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_256); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_257); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_258); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_272); + stringBuffer.append(TEXT_260); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_273); + stringBuffer.append(TEXT_261); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_274); + stringBuffer.append(TEXT_262); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_275); + stringBuffer.append(TEXT_263); } else { - stringBuffer.append(TEXT_276); + stringBuffer.append(TEXT_264); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_277); + stringBuffer.append(TEXT_265); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_278); + stringBuffer.append(TEXT_266); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_279); + stringBuffer.append(TEXT_267); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_280); + stringBuffer.append(TEXT_268); } - stringBuffer.append(TEXT_281); + stringBuffer.append(TEXT_269); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_282); + stringBuffer.append(TEXT_270); if (next.getDomainMetaClass().isExternalInterface()) { - stringBuffer.append(TEXT_283); + stringBuffer.append(TEXT_271); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_284); + stringBuffer.append(TEXT_272); } - stringBuffer.append(TEXT_285); + stringBuffer.append(TEXT_273); if(!isListLayout) { - stringBuffer.append(TEXT_286); + stringBuffer.append(TEXT_274); } - stringBuffer.append(TEXT_287); + stringBuffer.append(TEXT_275); } } - stringBuffer.append(TEXT_288); + stringBuffer.append(TEXT_276); importManager.emitSortedImports(); - stringBuffer.append(TEXT_289); + stringBuffer.append(TEXT_277); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java index cbb366d80..36f15c9e2 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java @@ -36,290 +36,290 @@ public class DiagramEditPartGenerator protected final String TEXT_17 = NL; protected final String TEXT_18 = NL; protected final String TEXT_19 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_20 = " extends AbstractGraphicalEditPart implements IUpdatableEditPart {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String MODEL_ID = \""; - protected final String TEXT_21 = "\";" + NL; - protected final String TEXT_22 = NL; - protected final String TEXT_23 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_24 = ";"; - protected final String TEXT_25 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_26 = "("; - protected final String TEXT_27 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_28 = " getDiagram() {" + NL + "\t\treturn ("; - protected final String TEXT_29 = ") getModel();" + NL + "\t}" + NL; - protected final String TEXT_30 = NL; - protected final String TEXT_31 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; - protected final String TEXT_32 = " view = ("; - protected final String TEXT_33 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; - protected final String TEXT_34 = " view = ("; - protected final String TEXT_35 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\tsuper.addNotify();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());" + NL + "\t\tinstallEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {" + NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; - protected final String TEXT_36 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_37 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_38 = ".CreateRequestEx requestEx = ("; - protected final String TEXT_39 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_40 = " result = new "; - protected final String TEXT_41 = "();" + NL + "\t\t\t\t\tfor(int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_42 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_43 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_44 = "Command(getDiagram(), requestEx, ("; - protected final String TEXT_45 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_46 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_47 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_48 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t"; - protected final String TEXT_49 = " emfCommand = new "; - protected final String TEXT_50 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta;" + NL + "\t\t\t\t\tprivate Dimension resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_51 = " original = new "; - protected final String TEXT_52 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_53 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute(Point move, Dimension resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_54 = ".getEditingDomain(getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn UnexecutableCommand.INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();"; - protected final String TEXT_55 = NL + "\t\tinstallLinkNotationModelRefresher();"; - protected final String TEXT_56 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure createFigure() {" + NL + "\t\tIFigure f = new FreeformLayer();" + NL + "\t\tf.setBorder(new MarginBorder(5));" + NL + "\t\tf.setLayoutManager(new FreeformLayout());" + NL + "\t\treturn f;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif ("; - protected final String TEXT_57 = ".class == key) {" + NL + "\t\t\treturn new "; - protected final String TEXT_58 = "(this);" + NL + "\t\t}"; - protected final String TEXT_59 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn getDiagram().getVisibleChildren();" + NL + "\t}" + NL; - protected final String TEXT_60 = NL; - protected final String TEXT_61 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_62 = "static "; - protected final String TEXT_63 = "class Create"; - protected final String TEXT_64 = "NotationCommand extends "; - protected final String TEXT_65 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; - protected final String TEXT_66 = "NotationCommand("; - protected final String TEXT_67 = " parent, " + NL + "\t\t\t\t"; - protected final String TEXT_68 = " domainElement"; - protected final String TEXT_69 = ", "; - protected final String TEXT_70 = " constraint"; - protected final String TEXT_71 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; - protected final String TEXT_72 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; - protected final String TEXT_73 = ".decorateView(createdNode);"; - protected final String TEXT_74 = NL + "\t\t\t"; - protected final String TEXT_75 = " bounds = "; - protected final String TEXT_76 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);"; - protected final String TEXT_77 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; - protected final String TEXT_78 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; - protected final String TEXT_79 = "));"; - protected final String TEXT_80 = NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_81 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_82 = "static "; - protected final String TEXT_83 = "class Create"; - protected final String TEXT_84 = "Command extends "; - protected final String TEXT_85 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; - protected final String TEXT_86 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_87 = "Command("; - protected final String TEXT_88 = " parent, "; - protected final String TEXT_89 = ".CreateRequestEx request"; - protected final String TEXT_90 = ", "; - protected final String TEXT_91 = " constraint"; - protected final String TEXT_92 = ") {" + NL + "\t\t\t"; - protected final String TEXT_93 = " domainModelEditDomain = "; - protected final String TEXT_94 = ".getEditingDomain(parent.getDiagram().getElement());"; - protected final String TEXT_95 = NL + "\t\t\t"; - protected final String TEXT_96 = " createdDomainElement = "; - protected final String TEXT_97 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; - protected final String TEXT_98 = ".eINSTANCE.get"; - protected final String TEXT_99 = "());"; - protected final String TEXT_100 = NL + "\t\t\t"; - protected final String TEXT_101 = " createdDomainElement = "; - protected final String TEXT_102 = ".eINSTANCE.create"; - protected final String TEXT_103 = "();"; - protected final String TEXT_104 = NL + "\t\t\t"; - protected final String TEXT_105 = NL + "\t\t\t"; - protected final String TEXT_106 = "."; - protected final String TEXT_107 = ".initializeElement("; - protected final String TEXT_108 = "("; - protected final String TEXT_109 = ") "; - protected final String TEXT_110 = "createdDomainElement);"; - protected final String TEXT_111 = NL + "\t\t\t"; - protected final String TEXT_112 = " compoundCommand = new "; - protected final String TEXT_113 = "();" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_114 = ".create(domainModelEditDomain, "; - protected final String TEXT_115 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_116 = ".eINSTANCE.get"; - protected final String TEXT_117 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_118 = ".create(domainModelEditDomain, "; - protected final String TEXT_119 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_120 = ".eINSTANCE.get"; - protected final String TEXT_121 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; - protected final String TEXT_122 = NL + "\t\t\tthis.domainModelAddCommand = "; - protected final String TEXT_123 = ".create(domainModelEditDomain, "; - protected final String TEXT_124 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_125 = ".eINSTANCE.get"; - protected final String TEXT_126 = "(), createdDomainElement);"; - protected final String TEXT_127 = NL + "\t\t\tthis.notationAddCommand = new Create"; - protected final String TEXT_128 = "NotationCommand(parent, "; - protected final String TEXT_129 = "("; - protected final String TEXT_130 = ") "; - protected final String TEXT_131 = "createdDomainElement"; - protected final String TEXT_132 = ", constraint"; - protected final String TEXT_133 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_134 = NL; - protected final String TEXT_135 = NL; - protected final String TEXT_136 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_137 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_138 = " feature, "; - protected final String TEXT_139 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; - protected final String TEXT_140 = NL; - protected final String TEXT_141 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_142 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_143 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends "; - protected final String TEXT_144 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_145 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_146 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor("; - protected final String TEXT_147 = " it = affectedEditParts.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\tIUpdatableEditPart next = (IUpdatableEditPart) it.next();" + NL + "\t\t\t\tIUpdatableEditPart.Refresher refresher = next.getRefresher(("; - protected final String TEXT_148 = ")msg.getFeature(), msg);" + NL + "\t\t\t\tif (refresher != null) {" + NL + "\t\t\t\t\trefresher.refresh();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_149 = "/*<IUpdatableEditPart>*/ findAffectedParts("; - protected final String TEXT_150 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof "; - protected final String TEXT_151 = ") {" + NL + "\t\t\t\t"; - protected final String TEXT_152 = " view = getView((EObject) notifier);" + NL + "\t\t\t\tif (view != null) {" + NL + "\t\t\t\t\tEditPart affectedEditPart = (EditPart) getViewer().getEditPartRegistry().get(view);" + NL + "\t\t\t\t\tif (affectedEditPart != null) {" + NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_153 = ".singleton(affectedEditPart);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn "; - protected final String TEXT_154 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_155 = " getView(EObject offspring) {" + NL + "\t\t\twhile (offspring != null && offspring instanceof View == false) {" + NL + "\t\t\t\toffspring = offspring.eContainer();" + NL + "\t\t\t}" + NL + "\t\t\treturn ("; - protected final String TEXT_156 = ") offspring;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tif (!getDiagram().eAdapters().contains(updateManager)) {" + NL + "\t\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\t}" + NL + "\t\tif (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {" + NL + "\t\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\t}" + NL + "\t\tinstallNotationModelRefresher();"; - protected final String TEXT_157 = NL + "\t\tinstallLinkNotationModelRefresher();"; - protected final String TEXT_158 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; - protected final String TEXT_159 = NL + "\t\tuninstallLinkNotationModelRefresher();"; - protected final String TEXT_160 = NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(updateManager);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; - protected final String TEXT_161 = NL; - protected final String TEXT_162 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_163 = " domainModelEditDomain = "; - protected final String TEXT_164 = ".getEditingDomain("; - protected final String TEXT_165 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; - protected final String TEXT_166 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_167 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_168 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; - protected final String TEXT_169 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; - protected final String TEXT_170 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_171 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_172 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_173 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; - protected final String TEXT_174 = NL + "\t\t\tfilter = "; - protected final String TEXT_175 = ".createFeatureFilter("; - protected final String TEXT_176 = ".eINSTANCE.get"; - protected final String TEXT_177 = "());"; - protected final String TEXT_178 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_179 = ".createFeatureFilter("; - protected final String TEXT_180 = ".eINSTANCE.get"; - protected final String TEXT_181 = "()));"; - protected final String TEXT_182 = NL + "\t\t\tfilter = filter.and("; - protected final String TEXT_183 = ".createNotifierFilter("; - protected final String TEXT_184 = ".getElement()));"; - protected final String TEXT_185 = NL + "\t\t\tfilter = "; - protected final String TEXT_186 = ".createNotifierFilter("; - protected final String TEXT_187 = ".getElement());"; - protected final String TEXT_188 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; - protected final String TEXT_189 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_190 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_191 = " transactionAboutToCommit("; - protected final String TEXT_192 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_193 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; - protected final String TEXT_194 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_195 = " domainModelEditDomain = "; - protected final String TEXT_196 = ".getEditingDomain("; - protected final String TEXT_197 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_198 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_199 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; - protected final String TEXT_200 = " notationalChildren = "; - protected final String TEXT_201 = ".getChildren();" + NL + "\t\tfinal "; - protected final String TEXT_202 = " semanticToNotational = new "; - protected final String TEXT_203 = "();" + NL + "\t\tfor("; - protected final String TEXT_204 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_205 = " next = ("; - protected final String TEXT_206 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_207 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_208 = " parentView = "; - protected final String TEXT_209 = ";" + NL + "\t\t"; - protected final String TEXT_210 = " command = new "; - protected final String TEXT_211 = "();" + NL + "\t\tfor("; - protected final String TEXT_212 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_213 = " next = ("; - protected final String TEXT_214 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_215 = " currentView = ("; - protected final String TEXT_216 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; - protected final String TEXT_217 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != "; - protected final String TEXT_218 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; - protected final String TEXT_219 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_220 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_221 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_222 = " obsoleteView = ("; - protected final String TEXT_223 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_224 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_225 = " getCreateNotationalElementCommand("; - protected final String TEXT_226 = " parentView, "; - protected final String TEXT_227 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; - protected final String TEXT_228 = NL + "\t\tcase "; - protected final String TEXT_229 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; - protected final String TEXT_230 = ") {" + NL + "\t\t\t\treturn new Create"; - protected final String TEXT_231 = "NotationCommand(parentView, domainElement"; - protected final String TEXT_232 = ", new Rectangle(0, 0, 0, 0)"; - protected final String TEXT_233 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; - protected final String TEXT_234 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_235 = " getSemanticChildren() {"; - protected final String TEXT_236 = NL; - protected final String TEXT_237 = NL + "\treturn "; - protected final String TEXT_238 = ".EMPTY_LIST;"; - protected final String TEXT_239 = NL + "\t"; - protected final String TEXT_240 = " result = new "; - protected final String TEXT_241 = "();"; - protected final String TEXT_242 = NL + "\t"; - protected final String TEXT_243 = " viewObject = "; - protected final String TEXT_244 = ";" + NL + "\t"; - protected final String TEXT_245 = " modelObject = viewObject.getElement();" + NL + "\t"; - protected final String TEXT_246 = " nextValue;" + NL + "\tint nodeVID;"; - protected final String TEXT_247 = NL + "\tfor("; - protected final String TEXT_248 = " it = "; - protected final String TEXT_249 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_250 = ") it.next();"; - protected final String TEXT_251 = NL + "\tnextValue = ("; - protected final String TEXT_252 = ")"; - protected final String TEXT_253 = ";"; - protected final String TEXT_254 = NL + "\tnodeVID = "; - protected final String TEXT_255 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; - protected final String TEXT_256 = NL + "\tswitch (nodeVID) {"; - protected final String TEXT_257 = NL + "\tcase "; - protected final String TEXT_258 = ".VISUAL_ID: {"; - protected final String TEXT_259 = NL + "\tif ("; - protected final String TEXT_260 = ".VISUAL_ID == nodeVID) {"; - protected final String TEXT_261 = NL + "\t\tresult.add(nextValue);"; - protected final String TEXT_262 = NL + "\t\tbreak;" + NL + "\t\t}"; - protected final String TEXT_263 = NL + "\t\t}"; - protected final String TEXT_264 = NL + "\t}"; - protected final String TEXT_265 = NL + "\t}"; - protected final String TEXT_266 = NL + "\treturn result;"; - protected final String TEXT_267 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns "; - protected final String TEXT_268 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn "; - protected final String TEXT_269 = ";" + NL + "\t}" + NL; - protected final String TEXT_270 = NL; - protected final String TEXT_271 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_272 = " domainModelEditDomain = "; - protected final String TEXT_273 = ".getEditingDomain("; - protected final String TEXT_274 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends "; - protected final String TEXT_275 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_276 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_277 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; - protected final String TEXT_278 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; - protected final String TEXT_279 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_280 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_281 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_282 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_283 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_284 = ".createEventTypeFilter("; - protected final String TEXT_285 = ".SET).or(" + NL + "\t\t\t\t"; - protected final String TEXT_286 = ".createEventTypeFilter("; - protected final String TEXT_287 = ".UNSET).or(" + NL + "\t\t\t\t"; - protected final String TEXT_288 = ".createEventTypeFilter("; - protected final String TEXT_289 = ".REMOVE).or(" + NL + "\t\t\t\t"; - protected final String TEXT_290 = ".createEventTypeFilter("; - protected final String TEXT_291 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; - protected final String TEXT_292 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; - protected final String TEXT_293 = NL; - protected final String TEXT_294 = NL + "\t\t\tfilter = "; - protected final String TEXT_295 = ".createFeatureFilter("; - protected final String TEXT_296 = ".eINSTANCE.get"; - protected final String TEXT_297 = "());"; - protected final String TEXT_298 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_299 = ".createFeatureFilter("; - protected final String TEXT_300 = ".eINSTANCE.get"; - protected final String TEXT_301 = "()));"; - protected final String TEXT_302 = NL; - protected final String TEXT_303 = NL + "\t\t\tfilter = "; + protected final String TEXT_20 = " extends AbstractGraphicalEditPart implements "; + protected final String TEXT_21 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String MODEL_ID = \""; + protected final String TEXT_22 = "\";" + NL; + protected final String TEXT_23 = NL; + protected final String TEXT_24 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_25 = ";"; + protected final String TEXT_26 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_27 = "("; + protected final String TEXT_28 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_29 = " getDiagram() {" + NL + "\t\treturn ("; + protected final String TEXT_30 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_31 = NL; + protected final String TEXT_32 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; + protected final String TEXT_33 = " view = ("; + protected final String TEXT_34 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; + protected final String TEXT_35 = " view = ("; + protected final String TEXT_36 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tgetDiagram().eAdapters().add(getUpdateManager());" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\tsuper.addNotify();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());" + NL + "\t\tinstallEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {" + NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; + protected final String TEXT_37 = NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_38 = ") {" + NL + "\t\t\t\t\t"; + protected final String TEXT_39 = " requestEx = ("; + protected final String TEXT_40 = ") request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_41 = " result = new "; + protected final String TEXT_42 = "();" + NL + "\t\t\t\t\tfor(int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; + protected final String TEXT_43 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_44 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_45 = "Command(getDiagram(), requestEx, ("; + protected final String TEXT_46 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_47 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new "; + protected final String TEXT_48 = "("; + protected final String TEXT_49 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_50 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t"; + protected final String TEXT_51 = " emfCommand = new "; + protected final String TEXT_52 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta;" + NL + "\t\t\t\t\tprivate Dimension resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_53 = " original = new "; + protected final String TEXT_54 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_55 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute(Point move, Dimension resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new "; + protected final String TEXT_56 = "("; + protected final String TEXT_57 = ".getEditingDomain(getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn UnexecutableCommand.INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();"; + protected final String TEXT_58 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_59 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure createFigure() {" + NL + "\t\tIFigure f = new FreeformLayer();" + NL + "\t\tf.setBorder(new MarginBorder(5));" + NL + "\t\tf.setLayoutManager(new FreeformLayout());" + NL + "\t\treturn f;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif ("; + protected final String TEXT_60 = ".class == key) {" + NL + "\t\t\treturn new "; + protected final String TEXT_61 = "(this);" + NL + "\t\t}"; + protected final String TEXT_62 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn getDiagram().getVisibleChildren();" + NL + "\t}" + NL; + protected final String TEXT_63 = NL; + protected final String TEXT_64 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_65 = "static "; + protected final String TEXT_66 = "class Create"; + protected final String TEXT_67 = "NotationCommand extends "; + protected final String TEXT_68 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; + protected final String TEXT_69 = "NotationCommand("; + protected final String TEXT_70 = " parent, " + NL + "\t\t\t\t"; + protected final String TEXT_71 = " domainElement"; + protected final String TEXT_72 = ", "; + protected final String TEXT_73 = " constraint"; + protected final String TEXT_74 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; + protected final String TEXT_75 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; + protected final String TEXT_76 = ".decorateView(createdNode);"; + protected final String TEXT_77 = NL + "\t\t\t"; + protected final String TEXT_78 = " bounds = "; + protected final String TEXT_79 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);"; + protected final String TEXT_80 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; + protected final String TEXT_81 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; + protected final String TEXT_82 = "));"; + protected final String TEXT_83 = NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_84 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_85 = "static "; + protected final String TEXT_86 = "class Create"; + protected final String TEXT_87 = "Command extends "; + protected final String TEXT_88 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; + protected final String TEXT_89 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_90 = "Command("; + protected final String TEXT_91 = " parent, "; + protected final String TEXT_92 = " request"; + protected final String TEXT_93 = ", "; + protected final String TEXT_94 = " constraint"; + protected final String TEXT_95 = ") {" + NL + "\t\t\t"; + protected final String TEXT_96 = " domainModelEditDomain = "; + protected final String TEXT_97 = ".getEditingDomain(parent.getDiagram().getElement());"; + protected final String TEXT_98 = NL + "\t\t\t"; + protected final String TEXT_99 = " createdDomainElement = "; + protected final String TEXT_100 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; + protected final String TEXT_101 = ".eINSTANCE.get"; + protected final String TEXT_102 = "());"; + protected final String TEXT_103 = NL + "\t\t\t"; + protected final String TEXT_104 = " createdDomainElement = "; + protected final String TEXT_105 = ".eINSTANCE.create"; + protected final String TEXT_106 = "();"; + protected final String TEXT_107 = NL + "\t\t\t"; + protected final String TEXT_108 = NL + "\t\t\t"; + protected final String TEXT_109 = "."; + protected final String TEXT_110 = ".initializeElement("; + protected final String TEXT_111 = "("; + protected final String TEXT_112 = ") "; + protected final String TEXT_113 = "createdDomainElement);"; + protected final String TEXT_114 = NL + "\t\t\t"; + protected final String TEXT_115 = " compoundCommand = new "; + protected final String TEXT_116 = "();" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_117 = ".create(domainModelEditDomain, "; + protected final String TEXT_118 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_119 = ".eINSTANCE.get"; + protected final String TEXT_120 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_121 = ".create(domainModelEditDomain, "; + protected final String TEXT_122 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_123 = ".eINSTANCE.get"; + protected final String TEXT_124 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; + protected final String TEXT_125 = NL + "\t\t\tthis.domainModelAddCommand = "; + protected final String TEXT_126 = ".create(domainModelEditDomain, "; + protected final String TEXT_127 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_128 = ".eINSTANCE.get"; + protected final String TEXT_129 = "(), createdDomainElement);"; + protected final String TEXT_130 = NL + "\t\t\tthis.notationAddCommand = new Create"; + protected final String TEXT_131 = "NotationCommand(parent, "; + protected final String TEXT_132 = "("; + protected final String TEXT_133 = ") "; + protected final String TEXT_134 = "createdDomainElement"; + protected final String TEXT_135 = ", constraint"; + protected final String TEXT_136 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_137 = NL; + protected final String TEXT_138 = NL; + protected final String TEXT_139 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_140 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_141 = " feature, "; + protected final String TEXT_142 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; + protected final String TEXT_143 = NL; + protected final String TEXT_144 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_145 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_146 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tif (!getDiagram().eAdapters().contains(getUpdateManager())) {" + NL + "\t\t\tgetDiagram().eAdapters().add(getUpdateManager());" + NL + "\t\t}" + NL + "\t\tif (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {" + NL + "\t\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\t}" + NL + "\t\tinstallNotationModelRefresher();"; + protected final String TEXT_147 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_148 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; + protected final String TEXT_149 = NL + "\t\tuninstallLinkNotationModelRefresher();"; + protected final String TEXT_150 = NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(getUpdateManager());" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; + protected final String TEXT_151 = NL; + protected final String TEXT_152 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\t"; + protected final String TEXT_153 = " refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_154 = " domainModelEditDomain = "; + protected final String TEXT_155 = ".getEditingDomain("; + protected final String TEXT_156 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_157 = " notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_158 = " getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; + protected final String TEXT_159 = " {"; + protected final String TEXT_160 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; + protected final String TEXT_161 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_162 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_163 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_164 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_165 = " createFilter() {"; + protected final String TEXT_166 = NL + "\t\t\t"; + protected final String TEXT_167 = " filter = "; + protected final String TEXT_168 = ".createFeatureFilter("; + protected final String TEXT_169 = ".eINSTANCE.get"; + protected final String TEXT_170 = "());"; + protected final String TEXT_171 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_172 = ".createFeatureFilter("; + protected final String TEXT_173 = ".eINSTANCE.get"; + protected final String TEXT_174 = "()));"; + protected final String TEXT_175 = NL + "\t\t\tfilter = filter.and("; + protected final String TEXT_176 = ".createNotifierFilter("; + protected final String TEXT_177 = ".getElement()));"; + protected final String TEXT_178 = NL + "\t\t\t"; + protected final String TEXT_179 = " filter = "; + protected final String TEXT_180 = ".createNotifierFilter("; + protected final String TEXT_181 = ".getElement());"; + protected final String TEXT_182 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; + protected final String TEXT_183 = NL + "\t\t\t"; + protected final String TEXT_184 = " filter = getConstrainedChildrenFilter();"; + protected final String TEXT_185 = NL + "\t\t\t"; + protected final String TEXT_186 = " filter = "; + protected final String TEXT_187 = ".NOT_TOUCH;"; + protected final String TEXT_188 = NL + "\t\t\treturn filter;"; + protected final String TEXT_189 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_190 = " getCreateNotationalElementCommand("; + protected final String TEXT_191 = " descriptor) {" + NL + "\t\t\t"; + protected final String TEXT_192 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {"; + protected final String TEXT_193 = NL + "\t\t\tcase "; + protected final String TEXT_194 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof "; + protected final String TEXT_195 = ") {" + NL + "\t\t\t\t\treturn new Create"; + protected final String TEXT_196 = "NotationCommand(getHost(), domainElement"; + protected final String TEXT_197 = ", new Rectangle(0, 0, 0, 0)"; + protected final String TEXT_198 = ");" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;"; + protected final String TEXT_199 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_200 = " getSemanticChildNodes() {"; + protected final String TEXT_201 = NL; + protected final String TEXT_202 = NL + "\treturn "; + protected final String TEXT_203 = ".EMPTY_LIST;"; + protected final String TEXT_204 = NL + "\t"; + protected final String TEXT_205 = " result = new "; + protected final String TEXT_206 = "();"; + protected final String TEXT_207 = NL + "\t"; + protected final String TEXT_208 = " viewObject = "; + protected final String TEXT_209 = ";" + NL + "\t"; + protected final String TEXT_210 = " modelObject = viewObject.getElement();" + NL + "\t"; + protected final String TEXT_211 = " nextValue;" + NL + "\tint nodeVID;"; + protected final String TEXT_212 = NL + "\tfor("; + protected final String TEXT_213 = " it = "; + protected final String TEXT_214 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_215 = ") it.next();"; + protected final String TEXT_216 = NL + "\tnextValue = ("; + protected final String TEXT_217 = ")"; + protected final String TEXT_218 = ";"; + protected final String TEXT_219 = NL + "\tnodeVID = "; + protected final String TEXT_220 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; + protected final String TEXT_221 = NL + "\tswitch (nodeVID) {"; + protected final String TEXT_222 = NL + "\tcase "; + protected final String TEXT_223 = ".VISUAL_ID: {"; + protected final String TEXT_224 = NL + "\tif ("; + protected final String TEXT_225 = ".VISUAL_ID == nodeVID) {"; + protected final String TEXT_226 = NL + "\t\tresult.add(new "; + protected final String TEXT_227 = "(nextValue, nodeVID));"; + protected final String TEXT_228 = NL + "\t\tbreak;" + NL + "\t\t}"; + protected final String TEXT_229 = NL + "\t\t}"; + protected final String TEXT_230 = NL + "\t}"; + protected final String TEXT_231 = NL + "\t}"; + protected final String TEXT_232 = NL + "\treturn result;"; + protected final String TEXT_233 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t\t * The generated code always returns "; + protected final String TEXT_234 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView("; + protected final String TEXT_235 = " descriptor) {" + NL + "\t\t\treturn "; + protected final String TEXT_236 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_237 = " getHost() {" + NL + "\t\t\treturn "; + protected final String TEXT_238 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; + protected final String TEXT_239 = " childRefresher = getNotationModelRefresher();" + NL + "\t\tif (!childRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_240 = " command = childRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_241 = " domainModelEditDomain = "; + protected final String TEXT_242 = ".getEditingDomain("; + protected final String TEXT_243 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new "; + protected final String TEXT_244 = "(domainModelEditDomain, command));" + NL + "\t}" + NL + NL; + protected final String TEXT_245 = NL; + protected final String TEXT_246 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_247 = " domainModelEditDomain = "; + protected final String TEXT_248 = ".getEditingDomain("; + protected final String TEXT_249 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * Service to find a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_250 = " viewService;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_251 = " getViewService() {" + NL + "\t\tif (viewService == null) {" + NL + "\t\t\tviewService = new "; + protected final String TEXT_252 = "(getViewer());" + NL + "\t\t}" + NL + "\t\treturn viewService;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher(getViewService());" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends "; + protected final String TEXT_253 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher("; + protected final String TEXT_254 = " viewService) {" + NL + "\t\t\tsuper(viewService);" + NL + "\t\t}"; + protected final String TEXT_255 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; + protected final String TEXT_256 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_257 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_258 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_259 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_260 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_261 = ".createEventTypeFilter("; + protected final String TEXT_262 = ".SET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_263 = ".createEventTypeFilter("; + protected final String TEXT_264 = ".UNSET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_265 = ".createEventTypeFilter("; + protected final String TEXT_266 = ".REMOVE).or(" + NL + "\t\t\t\t"; + protected final String TEXT_267 = ".createEventTypeFilter("; + protected final String TEXT_268 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; + protected final String TEXT_269 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_270 = " createFilter() {"; + protected final String TEXT_271 = NL; + protected final String TEXT_272 = NL + "\t\t\t"; + protected final String TEXT_273 = " filter = "; + protected final String TEXT_274 = ".createFeatureFilter("; + protected final String TEXT_275 = ".eINSTANCE.get"; + protected final String TEXT_276 = "());"; + protected final String TEXT_277 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_278 = ".createFeatureFilter("; + protected final String TEXT_279 = ".eINSTANCE.get"; + protected final String TEXT_280 = "()));"; + protected final String TEXT_281 = NL; + protected final String TEXT_282 = NL + "\t\t\t"; + protected final String TEXT_283 = " filter = "; + protected final String TEXT_284 = ".createFeatureFilter("; + protected final String TEXT_285 = ".eINSTANCE.get"; + protected final String TEXT_286 = "());"; + protected final String TEXT_287 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_288 = ".createFeatureFilter("; + protected final String TEXT_289 = ".eINSTANCE.get"; + protected final String TEXT_290 = "()));"; + protected final String TEXT_291 = NL; + protected final String TEXT_292 = NL + "\t\t\t"; + protected final String TEXT_293 = " filter = "; + protected final String TEXT_294 = ".createFeatureFilter("; + protected final String TEXT_295 = ".eINSTANCE.get"; + protected final String TEXT_296 = "());"; + protected final String TEXT_297 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_298 = ".createFeatureFilter("; + protected final String TEXT_299 = ".eINSTANCE.get"; + protected final String TEXT_300 = "()));"; + protected final String TEXT_301 = NL; + protected final String TEXT_302 = NL + "\t\t\t"; + protected final String TEXT_303 = " filter = "; protected final String TEXT_304 = ".createFeatureFilter("; protected final String TEXT_305 = ".eINSTANCE.get"; protected final String TEXT_306 = "());"; @@ -327,225 +327,138 @@ public class DiagramEditPartGenerator protected final String TEXT_308 = ".createFeatureFilter("; protected final String TEXT_309 = ".eINSTANCE.get"; protected final String TEXT_310 = "()));"; - protected final String TEXT_311 = NL; - protected final String TEXT_312 = NL + "\t\t\tfilter = "; - protected final String TEXT_313 = ".createFeatureFilter("; - protected final String TEXT_314 = ".eINSTANCE.get"; - protected final String TEXT_315 = "());"; - protected final String TEXT_316 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_317 = ".createFeatureFilter("; - protected final String TEXT_318 = ".eINSTANCE.get"; - protected final String TEXT_319 = "()));"; - protected final String TEXT_320 = NL; - protected final String TEXT_321 = NL + "\t\t\tfilter = "; - protected final String TEXT_322 = ".createFeatureFilter("; - protected final String TEXT_323 = ".eINSTANCE.get"; - protected final String TEXT_324 = "());"; - protected final String TEXT_325 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_326 = ".createFeatureFilter("; - protected final String TEXT_327 = ".eINSTANCE.get"; - protected final String TEXT_328 = "()));"; - protected final String TEXT_329 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; - protected final String TEXT_330 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();"; - protected final String TEXT_331 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; - protected final String TEXT_332 = NL + "\t\t\tfilter = createUncontainedLinksFilter();"; - protected final String TEXT_333 = NL + "\t\t\tfilter = "; - protected final String TEXT_334 = ".ANY.negated();"; - protected final String TEXT_335 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_336 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_337 = " transactionAboutToCommit("; - protected final String TEXT_338 = " event) {" + NL + "\t\t\treturn getRefreshLinkNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_339 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t"; - protected final String TEXT_340 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_341 = " domainModelEditDomain = "; - protected final String TEXT_342 = ".getEditingDomain("; - protected final String TEXT_343 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL; - protected final String TEXT_344 = NL; - protected final String TEXT_345 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_346 = " mySource;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_347 = " myDestination;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_348 = " myLinkElement;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate int myVisualID;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor("; - protected final String TEXT_349 = " source, "; - protected final String TEXT_350 = " destination, "; - protected final String TEXT_351 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor("; - protected final String TEXT_352 = " source, "; - protected final String TEXT_353 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_354 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_355 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_356 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_357 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_358 = "/*<LinkDescriptor>*/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t"; - protected final String TEXT_359 = "/*<Edge>*/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal "; - protected final String TEXT_360 = " semanticToNotationalTypeBasedLinks = new "; - protected final String TEXT_361 = "();" + NL + "\t\tfinal "; - protected final String TEXT_362 = "/*<EObject, List<Edge>>*/ semanticToNotationalFeatureBasedLinks = new "; - protected final String TEXT_363 = "();" + NL + "\t\tfor("; - protected final String TEXT_364 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_365 = " next = ("; - protected final String TEXT_366 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_367 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotationalTypeBasedLinks.put(nextSemantic, next);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; - protected final String TEXT_368 = " featureBasedLinksForSource = ("; - protected final String TEXT_369 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new "; - protected final String TEXT_370 = "();" + NL + "\t\t\t\t\tsemanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tfeatureBasedLinksForSource.add(next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_371 = " parentView = "; - protected final String TEXT_372 = ";" + NL + "\t\t"; - protected final String TEXT_373 = " command = new "; - protected final String TEXT_374 = "();" + NL + "\t\tfor("; - protected final String TEXT_375 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t"; - protected final String TEXT_376 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t"; - protected final String TEXT_377 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = ("; - protected final String TEXT_378 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; - protected final String TEXT_379 = " featureBasedLinksForSource = ("; - protected final String TEXT_380 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {" + NL + "\t\t\t\t\tcurrentEdge = null;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tcurrentEdge = ("; - protected final String TEXT_381 = ") featureBasedLinksForSource.remove(0);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tint linkVisualID = next.getVisualID();" + NL + "\t\t\tif (currentEdge == null) {" + NL + "\t\t\t\tif (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else {" + NL + "\t\t\t\tboolean changedSource = currentEdge.getSource().getElement() != next.getSource();" + NL + "\t\t\t\tboolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();" + NL + "\t\t\t\tboolean changedVID = linkVisualID != "; - protected final String TEXT_382 = ".getVisualID(currentEdge);" + NL + "\t\t\t\tif (!changedSource && !changedTarget) {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_383 = " notationalCommand = getCreateNotationalEdgeCommand(parentView, next);" + NL + "\t\t\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_384 = "(parentView, notationalCommand, currentEdge));" + NL + "\t\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_385 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_386 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_387 = " newSourceView = findView(next.getSource());" + NL + "\t\t\t\t\t\tif (changedSource && newSourceView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_388 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_389 = " newTargetView = findView(next.getDestination());" + NL + "\t\t\t\t\t\tif (changedTarget && newTargetView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_390 = "(currentEdge, newTargetView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_391 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_392 = " obsoleteView = ("; - protected final String TEXT_393 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_394 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_395 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_396 = " obsoleteViews = ("; - protected final String TEXT_397 = ") it.next();" + NL + "\t\t\tfor("; - protected final String TEXT_398 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t"; - protected final String TEXT_399 = " obsoleteView = ("; - protected final String TEXT_400 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_401 = "(parentView, obsoleteView));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_402 = " findView("; - protected final String TEXT_403 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_404 = " editPart = ("; - protected final String TEXT_405 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof "; - protected final String TEXT_406 = ") {" + NL + "\t\t\treturn ("; - protected final String TEXT_407 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_408 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t"; - protected final String TEXT_409 = " result = findNode(parentView, modelElement);" + NL + "\t\t\tif (result != null) {" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn findEdge(modelElement);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_410 = " findNode("; - protected final String TEXT_411 = " parentView, "; - protected final String TEXT_412 = " modelElement) {" + NL + "\t\tfor("; - protected final String TEXT_413 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_414 = " next = ("; - protected final String TEXT_415 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t"; - protected final String TEXT_416 = " result = findNode(next, modelElement);" + NL + "\t\t\t\tif (result != null) {" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational edge that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_417 = " findEdge("; - protected final String TEXT_418 = " modelElement) {" + NL + "\t\tfor("; - protected final String TEXT_419 = " it = "; - protected final String TEXT_420 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_421 = " next = ("; - protected final String TEXT_422 = ") it.next();" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_423 = " getCreateNotationalEdgeCommand("; - protected final String TEXT_424 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t"; - protected final String TEXT_425 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t"; - protected final String TEXT_426 = " targetView = findView(linkDescriptor.getDestination());" + NL + "\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_427 = " createdEdge = "; - protected final String TEXT_428 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {"; - protected final String TEXT_429 = NL + "\t\tcase "; - protected final String TEXT_430 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof "; - protected final String TEXT_431 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t"; - protected final String TEXT_432 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; - protected final String TEXT_433 = NL + "\t\tcase "; - protected final String TEXT_434 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() == null) {" + NL + "\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t"; - protected final String TEXT_435 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; - protected final String TEXT_436 = NL + "\t\t}" + NL + "\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn new "; - protected final String TEXT_437 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_438 = " getSemanticChildLinks() {"; - protected final String TEXT_439 = NL; - protected final String TEXT_440 = "\t"; - protected final String TEXT_441 = " result = new "; - protected final String TEXT_442 = "();"; - protected final String TEXT_443 = NL + "\t"; - protected final String TEXT_444 = " modelObject = "; - protected final String TEXT_445 = ".getElement();" + NL + "\t"; - protected final String TEXT_446 = " nextValue;"; - protected final String TEXT_447 = NL + "\tint linkVID;"; - protected final String TEXT_448 = NL + "\tfor("; - protected final String TEXT_449 = " it = "; - protected final String TEXT_450 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_451 = ") it.next();"; - protected final String TEXT_452 = NL + "\tnextValue = ("; - protected final String TEXT_453 = ")"; - protected final String TEXT_454 = ";"; - protected final String TEXT_455 = NL + "\tlinkVID = "; - protected final String TEXT_456 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; - protected final String TEXT_457 = NL + "\tswitch (linkVID) {"; - protected final String TEXT_458 = NL + "\tcase "; - protected final String TEXT_459 = ".VISUAL_ID: {"; - protected final String TEXT_460 = NL + "\tif ("; - protected final String TEXT_461 = ".VISUAL_ID == linkVID) {"; - protected final String TEXT_462 = NL + "\t\t"; - protected final String TEXT_463 = " source = ("; - protected final String TEXT_464 = ")"; - protected final String TEXT_465 = ";"; - protected final String TEXT_466 = NL + "\t\t"; - protected final String TEXT_467 = " source = "; - protected final String TEXT_468 = ".getElement();"; - protected final String TEXT_469 = NL + "\t\t"; - protected final String TEXT_470 = " target = ("; - protected final String TEXT_471 = ")"; - protected final String TEXT_472 = ";"; - protected final String TEXT_473 = NL + "\t\t"; - protected final String TEXT_474 = " target = "; - protected final String TEXT_475 = ".getElement();"; - protected final String TEXT_476 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new LinkDescriptor(source, target, nextValue, linkVID));" + NL + "\t\t}"; - protected final String TEXT_477 = NL + "\t\tbreak;" + NL + "\t}"; - protected final String TEXT_478 = NL + "\t}"; - protected final String TEXT_479 = NL + "\t}"; - protected final String TEXT_480 = NL + "\t}"; - protected final String TEXT_481 = NL + "\tfor("; - protected final String TEXT_482 = " it = "; - protected final String TEXT_483 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_484 = ") it.next();"; - protected final String TEXT_485 = NL + "\tnextValue = ("; - protected final String TEXT_486 = ")"; - protected final String TEXT_487 = ";"; - protected final String TEXT_488 = NL + "\tif (nextValue != null) {"; - protected final String TEXT_489 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, "; - protected final String TEXT_490 = ".VISUAL_ID));"; - protected final String TEXT_491 = NL + "\t}"; - protected final String TEXT_492 = NL + "\t}"; - protected final String TEXT_493 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_494 = " getNotationalChildLinks() {" + NL + "\t\t"; - protected final String TEXT_495 = " result = new "; - protected final String TEXT_496 = "();" + NL + "\t\t"; - protected final String TEXT_497 = " allLinks = "; - protected final String TEXT_498 = ".getEdges();" + NL + "\t\tfor("; - protected final String TEXT_499 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_500 = " next = ("; - protected final String TEXT_501 = ") it.next();"; - protected final String TEXT_502 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_503 = " source = next.getSource();" + NL + "\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_504 = " target = next.getTarget();" + NL + "\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}"; - protected final String TEXT_505 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == "; - protected final String TEXT_506 = ") {" + NL + "\t\t\t\t\tint linkVID = "; - protected final String TEXT_507 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; - protected final String TEXT_508 = NL + "\t\t\t\t\tcase "; - protected final String TEXT_509 = ".VISUAL_ID:"; - protected final String TEXT_510 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; - protected final String TEXT_511 = NL + "\t\t\t} else {"; - protected final String TEXT_512 = NL + "\t\t\t}"; - protected final String TEXT_513 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {"; - protected final String TEXT_514 = NL + "\t\t\t\tif (next.getElement().eContainer() == "; - protected final String TEXT_515 = ".getElement()) {" + NL + "\t\t\t\t\tint linkVID = "; - protected final String TEXT_516 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; - protected final String TEXT_517 = NL + "\t\t\t\t\tcase "; - protected final String TEXT_518 = ".VISUAL_ID:"; - protected final String TEXT_519 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}"; - protected final String TEXT_520 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t * The generated code always returns "; - protected final String TEXT_521 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateEdge(EObject domainElement) {" + NL + "\t\treturn "; - protected final String TEXT_522 = ";" + NL + "\t}"; - protected final String TEXT_523 = NL; - protected final String TEXT_524 = NL; - protected final String TEXT_525 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends "; - protected final String TEXT_526 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_527 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher(("; - protected final String TEXT_528 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdateManager updateManager = new UpdateManager();" + NL + "}"; - protected final String TEXT_529 = NL; + protected final String TEXT_311 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; + protected final String TEXT_312 = NL + "\t\t\t"; + protected final String TEXT_313 = " filter = getConstrainedChildLinksFilter();"; + protected final String TEXT_314 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; + protected final String TEXT_315 = NL + "\t\t\t"; + protected final String TEXT_316 = " filter = createUncontainedLinksFilter();"; + protected final String TEXT_317 = NL + "\t\t\t"; + protected final String TEXT_318 = " filter = "; + protected final String TEXT_319 = ".NOT_TOUCH;"; + protected final String TEXT_320 = NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t \t * @generated" + NL + "\t \t */" + NL + "\t\tprotected "; + protected final String TEXT_321 = " getCreateNotationalElementCommand("; + protected final String TEXT_322 = " descriptor) {" + NL + "\t\t\t"; + protected final String TEXT_323 = " linkDescriptor = ("; + protected final String TEXT_324 = ") descriptor;" + NL + "\t\t\t"; + protected final String TEXT_325 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t"; + protected final String TEXT_326 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_327 = " createdEdge = "; + protected final String TEXT_328 = ".eINSTANCE.createEdge();" + NL + "\t\t\tswitch (linkDescriptor.getVisualID()) {"; + protected final String TEXT_329 = NL + "\t\t\tcase "; + protected final String TEXT_330 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof "; + protected final String TEXT_331 = ") {" + NL + "\t\t\t\t\tcreatedEdge.setElement(linkDescriptor.getElement());" + NL + "\t\t\t\t\t"; + protected final String TEXT_332 = ".decorateView(createdEdge);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;"; + protected final String TEXT_333 = NL + "\t\t\tcase "; + protected final String TEXT_334 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t\t"; + protected final String TEXT_335 = ".decorateView(createdEdge);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;"; + protected final String TEXT_336 = NL + "\t\t\t}" + NL + "\t\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\treturn new "; + protected final String TEXT_337 = "(getHost().getDiagram(), createdEdge, sourceView, targetView);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_338 = " getSemanticChildLinks() {"; + protected final String TEXT_339 = NL; + protected final String TEXT_340 = "\t"; + protected final String TEXT_341 = " result = new "; + protected final String TEXT_342 = "();"; + protected final String TEXT_343 = NL + "\t"; + protected final String TEXT_344 = " modelObject = "; + protected final String TEXT_345 = ".getElement();" + NL + "\t"; + protected final String TEXT_346 = " nextValue;"; + protected final String TEXT_347 = NL + "\tint linkVID;"; + protected final String TEXT_348 = NL + "\tfor("; + protected final String TEXT_349 = " it = "; + protected final String TEXT_350 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_351 = ") it.next();"; + protected final String TEXT_352 = NL + "\tnextValue = ("; + protected final String TEXT_353 = ")"; + protected final String TEXT_354 = ";"; + protected final String TEXT_355 = NL + "\tlinkVID = "; + protected final String TEXT_356 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; + protected final String TEXT_357 = NL + "\tswitch (linkVID) {"; + protected final String TEXT_358 = NL + "\tcase "; + protected final String TEXT_359 = ".VISUAL_ID: {"; + protected final String TEXT_360 = NL + "\tif ("; + protected final String TEXT_361 = ".VISUAL_ID == linkVID) {"; + protected final String TEXT_362 = NL + "\t\t"; + protected final String TEXT_363 = " source = ("; + protected final String TEXT_364 = ")"; + protected final String TEXT_365 = ";"; + protected final String TEXT_366 = NL + "\t\t"; + protected final String TEXT_367 = " source = "; + protected final String TEXT_368 = ".getElement();"; + protected final String TEXT_369 = NL + "\t\t"; + protected final String TEXT_370 = " target = ("; + protected final String TEXT_371 = ")"; + protected final String TEXT_372 = ";"; + protected final String TEXT_373 = NL + "\t\t"; + protected final String TEXT_374 = " target = "; + protected final String TEXT_375 = ".getElement();"; + protected final String TEXT_376 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new "; + protected final String TEXT_377 = "(source, target, nextValue, linkVID));" + NL + "\t\t}"; + protected final String TEXT_378 = NL + "\t\tbreak;" + NL + "\t}"; + protected final String TEXT_379 = NL + "\t}"; + protected final String TEXT_380 = NL + "\t}"; + protected final String TEXT_381 = NL + "\t}"; + protected final String TEXT_382 = NL + "\tfor("; + protected final String TEXT_383 = " it = "; + protected final String TEXT_384 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_385 = ") it.next();"; + protected final String TEXT_386 = NL + "\tnextValue = ("; + protected final String TEXT_387 = ")"; + protected final String TEXT_388 = ";"; + protected final String TEXT_389 = NL + "\tif (nextValue != null) {"; + protected final String TEXT_390 = NL + "\t\tresult.add(new "; + protected final String TEXT_391 = "(modelObject, nextValue, null, "; + protected final String TEXT_392 = ".VISUAL_ID));"; + protected final String TEXT_393 = NL + "\t}"; + protected final String TEXT_394 = NL + "\t}"; + protected final String TEXT_395 = NL + "\treturn result;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_396 = " getNotationalChildLinks() {" + NL + "\t\t\t"; + protected final String TEXT_397 = " result = new "; + protected final String TEXT_398 = "();" + NL + "\t\t\t"; + protected final String TEXT_399 = " allLinks = "; + protected final String TEXT_400 = ".getEdges();" + NL + "\t\t\tfor("; + protected final String TEXT_401 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t"; + protected final String TEXT_402 = " next = ("; + protected final String TEXT_403 = ") it.next();"; + protected final String TEXT_404 = NL + "\t\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_405 = " source = next.getSource();" + NL + "\t\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_406 = " target = next.getTarget();" + NL + "\t\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}"; + protected final String TEXT_407 = NL + "\t\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\t\tif (next.getSource() == "; + protected final String TEXT_408 = ") {" + NL + "\t\t\t\t\t\tint linkVID = "; + protected final String TEXT_409 = ".getVisualID(next);" + NL + "\t\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_410 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_411 = ".VISUAL_ID:"; + protected final String TEXT_412 = NL + "\t\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}"; + protected final String TEXT_413 = NL + "\t\t\t\t} else {"; + protected final String TEXT_414 = NL + "\t\t\t\t}"; + protected final String TEXT_415 = NL + "\t\t\t\tif (next.isSetElement() && next.getElement() != null) {"; + protected final String TEXT_416 = NL + "\t\t\t\t\tif (next.getElement().eContainer() == "; + protected final String TEXT_417 = ".getElement()) {" + NL + "\t\t\t\t\t\tint linkVID = "; + protected final String TEXT_418 = ".getVisualID(next);" + NL + "\t\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_419 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_420 = ".VISUAL_ID:"; + protected final String TEXT_421 = NL + "\t\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; + protected final String TEXT_422 = NL + "\t\t\t}" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t\t * The generated code always returns "; + protected final String TEXT_423 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView("; + protected final String TEXT_424 = " descriptor) {" + NL + "\t\t\treturn "; + protected final String TEXT_425 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_426 = " getHost() {" + NL + "\t\t\treturn "; + protected final String TEXT_427 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t"; + protected final String TEXT_428 = " linkRefresher = getLinkNotationModelRefresher();" + NL + "\t\tif (!linkRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_429 = " command = linkRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_430 = " domainModelEditDomain = "; + protected final String TEXT_431 = ".getEditingDomain("; + protected final String TEXT_432 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new "; + protected final String TEXT_433 = "(domainModelEditDomain, command));" + NL + "\t}"; + protected final String TEXT_434 = NL; + protected final String TEXT_435 = NL; + protected final String TEXT_436 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_437 = " domainModelRefresher = new "; + protected final String TEXT_438 = "(this);" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_439 = " updateManager;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_440 = " getUpdateManager() {" + NL + "\t\tif (updateManager == null) {" + NL + "\t\t\tupdateManager = new "; + protected final String TEXT_441 = "(getViewer());" + NL + "\t\t}" + NL + "\t\treturn updateManager;" + NL + "\t}" + NL + "}"; + protected final String TEXT_442 = NL; public String generate(Object argument) { @@ -555,7 +468,6 @@ GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0]; final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc -importManager.registerInnerClass("LinkDescriptor"); //from linkNotationModelRefresher.jetinc List childNodes = genDiagram.getTopLevelNodes(); stringBuffer.append(TEXT_1); @@ -723,27 +635,27 @@ importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_19); stringBuffer.append(genDiagram.getEditPartClassName()); stringBuffer.append(TEXT_20); - stringBuffer.append(genDiagram.getEditorGen().getModelID()); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); stringBuffer.append(TEXT_21); + stringBuffer.append(genDiagram.getEditorGen().getModelID()); + stringBuffer.append(TEXT_22); { GenCommonBase genCommonBase = genDiagram; - stringBuffer.append(TEXT_22); stringBuffer.append(TEXT_23); - stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_24); - } + stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_25); - stringBuffer.append(genDiagram.getEditPartClassName()); + } stringBuffer.append(TEXT_26); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); + stringBuffer.append(genDiagram.getEditPartClassName()); stringBuffer.append(TEXT_27); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_28); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_29); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_30); stringBuffer.append(TEXT_31); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_32); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_33); @@ -751,66 +663,72 @@ GenCommonBase genCommonBase = genDiagram; stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_35); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_36); if (null != genDiagram.getPalette()) { final Palette palette = genDiagram.getPalette(); - stringBuffer.append(TEXT_36); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); stringBuffer.append(TEXT_37); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_38); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_39); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_41); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_42); for(Iterator it = childNodes.iterator(); it.hasNext(); ) { GenTopLevelNode next = (GenTopLevelNode)it.next(); - stringBuffer.append(TEXT_42); - stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_43); + stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_44); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_44); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_45); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(TEXT_46); } - stringBuffer.append(TEXT_46); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_47); - }/*when there's palette*/ + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_48); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_49); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); + }/*when there's palette*/ stringBuffer.append(TEXT_50); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_51); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_53); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_54); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(TEXT_55); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_56); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_57); //link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links //if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_58); //} - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper")); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid")); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_61); /*@ include file="adapters/propertySource.javajetinc"*/ - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_62); for(Iterator it = childNodes.iterator(); it.hasNext(); ) { GenTopLevelNode next = (GenTopLevelNode)it.next(); @@ -818,42 +736,42 @@ for(Iterator it = childNodes.iterator(); it.hasNext(); ) { boolean isListLayout = false; String resolvedSemanticElement = "parent.getElement()"; - stringBuffer.append(TEXT_60); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_64); if (isStatic) { - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_65); } - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_66); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_64); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_67); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand")); + stringBuffer.append(TEXT_68); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_71); if (!isListLayout) { - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_73); } - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_76); if (!isListLayout) { - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_79); int defaultWidth = 40; int defaultHeight = 40; @@ -863,208 +781,182 @@ for(Iterator it = childNodes.iterator(); it.hasNext(); ) { defaultHeight = defSizeAttrs.getHeight(); } - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_80); stringBuffer.append(defaultWidth); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_81); stringBuffer.append(defaultHeight); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_82); } - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_83); if (genDiagram.getPalette() != null) { - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_84); if (isStatic) { - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_85); } - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_86); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_88); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_89); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_88); - stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_91); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.requests.CreateRequestEx")); + stringBuffer.append(TEXT_92); if (!isListLayout) { - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_94); } - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_97); if (next.getDomainMetaClass().isMapEntry()) { /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_101); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_102); } else { - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_105); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_106); } - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_107); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_108); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_109); stringBuffer.append(next.getUniqueIdentifier()); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_110); if (next.getDomainMetaClass().isExternalInterface()) { - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_112); } - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_113); TypeModelFacet facet = next.getModelFacet(); GenFeature childFeature = facet.getChildMetaFeature(); GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_117); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_119); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_121); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_123); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_124); } else { - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_126); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_128); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_129); } - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_130); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_131); if (next.getDomainMetaClass().isExternalInterface()) { - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_133); } - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_134); if(!isListLayout) { - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_135); } - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_136); } } - stringBuffer.append(TEXT_134); - stringBuffer.append(TEXT_135); - stringBuffer.append(TEXT_136); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_137); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_138); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_139); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_140); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_141); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_142); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_143); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter")); stringBuffer.append(TEXT_144); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_145); - stringBuffer.append(importManager.getImportedName("java.util.Collection")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_146); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_147); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_148); - stringBuffer.append(importManager.getImportedName("java.util.Collection")); - stringBuffer.append(TEXT_149); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_150); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_151); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_152); - stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_153); - stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_154); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_155); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_156); //link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links //if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_147); //} - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_148); //link notation model refresher should always be installed/uninstalled for the diagram edit part, because it tracks the uncontained links //if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_149); //} - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_150); { String _getDiagramCode = "getDiagram()"; @@ -1072,20 +964,22 @@ String _getViewCode = "getDiagram()"; boolean isListLayout = false; final boolean _includeUncontainedLinks = true; - stringBuffer.append(TEXT_161); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_152); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_155); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_165); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); - stringBuffer.append(TEXT_166); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_167); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_156); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); + stringBuffer.append(TEXT_157); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); + stringBuffer.append(TEXT_158); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher")); + stringBuffer.append(TEXT_159); boolean hasConstraintsInChildren = false; for (Iterator it = childNodes.iterator(); it.hasNext(); ) { @@ -1100,17 +994,19 @@ for (Iterator it = childNodes.iterator(); it.hasNext(); ) { if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_160); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_161); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_163); } - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_164); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_165); { boolean hasDeclaredFilter = false; @@ -1129,23 +1025,25 @@ if (hasConstraintsInChildren) { if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_167); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_169); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_170); } else { - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_172); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_173); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_174); } } //for @@ -1153,107 +1051,61 @@ if (hasConstraintsInChildren) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_176); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_177); } else { + hasDeclaredFilter = true; - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_179); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_180); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_181); } -} //local declaration of hasDeclaredFilter -if (hasConstraintsInChildren) { + if (hasConstraintsInChildren) { + if (hasDeclaredFilter) { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_182); + + } else { + + stringBuffer.append(TEXT_183); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_184); + + } + } + if (!hasDeclaredFilter) { + + stringBuffer.append(TEXT_185); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_186); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_187); + + } stringBuffer.append(TEXT_188); -} +} //local declaration of hasDeclaredFilter stringBuffer.append(TEXT_189); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); stringBuffer.append(TEXT_190); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); stringBuffer.append(TEXT_191); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_192); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_193); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_194); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_195); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_196); - stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_197); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_198); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_199); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_200); - stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_201); - stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_202); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_203); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_204); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_205); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_207); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_208); - stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_209); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_210); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_211); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_212); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_213); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_214); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_215); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_216); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_217); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_218); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_219); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_220); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_221); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_222); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_223); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand")); - stringBuffer.append(TEXT_224); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_225); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_226); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_192); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); @@ -1263,39 +1115,39 @@ for (Iterator it = childNodes.iterator(); it.hasNext(); ) { } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_194); stringBuffer.append(childNodeInterfaceName); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_195); stringBuffer.append(nextNode.getDomainMetaClass().getName()); stringBuffer.append(nextNode.getVisualID()); - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_196); if (!isListLayout) { - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_197); } - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_198); } - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_235); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_201); if (childNodes.size() == 0) { - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_203); } else { - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_206); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { @@ -1313,15 +1165,15 @@ if (childNodes.size() == 0) { Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_208); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_211); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { @@ -1330,100 +1182,124 @@ if (childNodes.size() == 0) { Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_213); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true); - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_215); } else { - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_217); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false); - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_218); } - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_220); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_221); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_222); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_223); } else { - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_224); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_225); } - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_226); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); + stringBuffer.append(TEXT_227); if (generateSwitch) { - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_228); } else { - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_229); } } if (generateSwitch) { - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_230); } if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_231); } } - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_232); } - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_233); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_234); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); + stringBuffer.append(TEXT_235); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_269); - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_236); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_237); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_238); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher")); + stringBuffer.append(TEXT_239); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_240); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_241); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_242); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_243); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_245); if (myHelper.containsLinks() || _includeUncontainedLinks) { - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_246); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_272); + stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_273); + stringBuffer.append(TEXT_248); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_274); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); - stringBuffer.append(TEXT_275); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_276); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_277); + stringBuffer.append(TEXT_249); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")); + stringBuffer.append(TEXT_250); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")); + stringBuffer.append(TEXT_251); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.EditPartRegistryBasedViewService")); + stringBuffer.append(TEXT_252); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.OwnedLinksNotationModelRefresher")); + stringBuffer.append(TEXT_253); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")); + stringBuffer.append(TEXT_254); boolean hasConstraintsInContainedLinks = false; for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { @@ -1436,40 +1312,42 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { } if (hasConstraintsInContainedLinks) { - stringBuffer.append(TEXT_278); + stringBuffer.append(TEXT_255); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_279); + stringBuffer.append(TEXT_256); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_280); + stringBuffer.append(TEXT_257); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_281); + stringBuffer.append(TEXT_258); } if (_includeUncontainedLinks) { - stringBuffer.append(TEXT_282); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_283); + stringBuffer.append(TEXT_260); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_284); + stringBuffer.append(TEXT_261); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_285); + stringBuffer.append(TEXT_262); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_286); + stringBuffer.append(TEXT_263); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_287); + stringBuffer.append(TEXT_264); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_288); + stringBuffer.append(TEXT_265); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_289); + stringBuffer.append(TEXT_266); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_290); + stringBuffer.append(TEXT_267); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_291); + stringBuffer.append(TEXT_268); } - stringBuffer.append(TEXT_292); + stringBuffer.append(TEXT_269); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_270); { boolean hasDeclaredFilter = false; @@ -1482,7 +1360,7 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { } GenFeature _feature = modelFacet.getChildMetaFeature(); - stringBuffer.append(TEXT_293); + stringBuffer.append(TEXT_271); /* * input: @@ -1496,30 +1374,32 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_294); + stringBuffer.append(TEXT_272); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_295); + stringBuffer.append(TEXT_273); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_274); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_296); + stringBuffer.append(TEXT_275); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_297); + stringBuffer.append(TEXT_276); } else { - stringBuffer.append(TEXT_298); + stringBuffer.append(TEXT_277); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_299); + stringBuffer.append(TEXT_278); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_300); + stringBuffer.append(TEXT_279); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_301); + stringBuffer.append(TEXT_280); } _feature = modelFacet.getSourceMetaFeature(); - stringBuffer.append(TEXT_302); + stringBuffer.append(TEXT_281); /* * input: @@ -1533,30 +1413,32 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_303); + stringBuffer.append(TEXT_282); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_304); + stringBuffer.append(TEXT_283); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_284); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_305); + stringBuffer.append(TEXT_285); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_306); + stringBuffer.append(TEXT_286); } else { - stringBuffer.append(TEXT_307); + stringBuffer.append(TEXT_287); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_308); + stringBuffer.append(TEXT_288); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_309); + stringBuffer.append(TEXT_289); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_310); + stringBuffer.append(TEXT_290); } _feature = modelFacet.getTargetMetaFeature(); - stringBuffer.append(TEXT_311); + stringBuffer.append(TEXT_291); /* * input: @@ -1570,23 +1452,25 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_312); + stringBuffer.append(TEXT_292); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_313); + stringBuffer.append(TEXT_293); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_294); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_314); + stringBuffer.append(TEXT_295); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_315); + stringBuffer.append(TEXT_296); } else { - stringBuffer.append(TEXT_316); + stringBuffer.append(TEXT_297); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_317); + stringBuffer.append(TEXT_298); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_318); + stringBuffer.append(TEXT_299); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_319); + stringBuffer.append(TEXT_300); } @@ -1596,7 +1480,7 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { GenLink nextLink = (GenLink) it.next(); GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature(); - stringBuffer.append(TEXT_320); + stringBuffer.append(TEXT_301); /* * input: @@ -1610,23 +1494,25 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_321); + stringBuffer.append(TEXT_302); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_322); + stringBuffer.append(TEXT_303); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_304); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_323); + stringBuffer.append(TEXT_305); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_324); + stringBuffer.append(TEXT_306); } else { - stringBuffer.append(TEXT_325); + stringBuffer.append(TEXT_307); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_326); + stringBuffer.append(TEXT_308); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_327); + stringBuffer.append(TEXT_309); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_328); + stringBuffer.append(TEXT_310); } @@ -1635,222 +1521,59 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { if (hasConstraintsInContainedLinks) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_329); + stringBuffer.append(TEXT_311); } else { hasDeclaredFilter = true; - stringBuffer.append(TEXT_330); + stringBuffer.append(TEXT_312); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_313); } } if (_includeUncontainedLinks) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_331); + stringBuffer.append(TEXT_314); } else { hasDeclaredFilter = true; - stringBuffer.append(TEXT_332); + stringBuffer.append(TEXT_315); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_316); } } if (!hasDeclaredFilter) { - stringBuffer.append(TEXT_333); + stringBuffer.append(TEXT_317); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_334); + stringBuffer.append(TEXT_318); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_319); } } //local declaration of hasDeclaredFilter - stringBuffer.append(TEXT_335); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_336); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_337); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_338); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_339); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_340); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_341); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_342); - stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_343); - stringBuffer.append(TEXT_344); - /*inner class*/ - stringBuffer.append(TEXT_345); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_346); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_347); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_348); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_349); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_350); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_351); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_352); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_353); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_354); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_355); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_356); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_357); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_358); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_359); - stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_360); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_361); - stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_362); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_363); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_364); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_365); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_366); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_367); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_368); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_369); - stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_370); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_371); - stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_372); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_373); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_374); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_375); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_376); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_377); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_378); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_379); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_380); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_381); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_382); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_383); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_384); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_385); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_386); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_387); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")); - stringBuffer.append(TEXT_388); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_389); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")); - stringBuffer.append(TEXT_390); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_391); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_392); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_393); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_394); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_395); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_396); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_397); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_398); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_399); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_400); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_401); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_402); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_403); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_404); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_405); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_406); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_407); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_408); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_409); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_410); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_411); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_412); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_413); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_414); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_415); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_416); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_417); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_418); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_419); - stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_420); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_421); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_422); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_423); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_424); + stringBuffer.append(TEXT_320); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); + stringBuffer.append(TEXT_321); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); + stringBuffer.append(TEXT_322); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); + stringBuffer.append(TEXT_323); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); + stringBuffer.append(TEXT_324); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_425); + stringBuffer.append(TEXT_325); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_426); + stringBuffer.append(TEXT_326); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_427); + stringBuffer.append(TEXT_327); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_428); + stringBuffer.append(TEXT_328); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); @@ -1859,37 +1582,37 @@ if (myHelper.containsLinks() || _includeUncontainedLinks) { continue; } - stringBuffer.append(TEXT_429); + stringBuffer.append(TEXT_329); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_430); + stringBuffer.append(TEXT_330); stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_431); + stringBuffer.append(TEXT_331); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_432); + stringBuffer.append(TEXT_332); } for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_433); + stringBuffer.append(TEXT_333); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_434); + stringBuffer.append(TEXT_334); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_435); + stringBuffer.append(TEXT_335); } - stringBuffer.append(TEXT_436); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_437); + stringBuffer.append(TEXT_336); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand")); + stringBuffer.append(TEXT_337); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_438); - stringBuffer.append(TEXT_439); - stringBuffer.append(TEXT_440); + stringBuffer.append(TEXT_338); + stringBuffer.append(TEXT_339); + stringBuffer.append(TEXT_340); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_441); + stringBuffer.append(TEXT_341); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_442); + stringBuffer.append(TEXT_342); Map genFeature2genLinkMap = new LinkedHashMap(); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { @@ -1912,18 +1635,18 @@ for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) } if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { - stringBuffer.append(TEXT_443); + stringBuffer.append(TEXT_343); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_444); + stringBuffer.append(TEXT_344); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_445); + stringBuffer.append(TEXT_345); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_446); + stringBuffer.append(TEXT_346); } if (!genFeature2genLinkMap.isEmpty()) { - stringBuffer.append(TEXT_447); + stringBuffer.append(TEXT_347); } for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { @@ -1932,32 +1655,32 @@ for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.has Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_448); + stringBuffer.append(TEXT_348); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_449); + stringBuffer.append(TEXT_349); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); - stringBuffer.append(TEXT_450); + stringBuffer.append(TEXT_350); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_451); + stringBuffer.append(TEXT_351); } else { - stringBuffer.append(TEXT_452); + stringBuffer.append(TEXT_352); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_453); + stringBuffer.append(TEXT_353); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); - stringBuffer.append(TEXT_454); + stringBuffer.append(TEXT_354); } - stringBuffer.append(TEXT_455); + stringBuffer.append(TEXT_355); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_456); + stringBuffer.append(TEXT_356); boolean generateSwitch = genLinksCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_457); + stringBuffer.append(TEXT_357); } for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { @@ -1965,65 +1688,67 @@ for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.has TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); if (generateSwitch) { - stringBuffer.append(TEXT_458); + stringBuffer.append(TEXT_358); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_459); + stringBuffer.append(TEXT_359); } else { - stringBuffer.append(TEXT_460); + stringBuffer.append(TEXT_360); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_461); + stringBuffer.append(TEXT_361); } if (modelFacet.getSourceMetaFeature() != null) { - stringBuffer.append(TEXT_462); + stringBuffer.append(TEXT_362); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_463); + stringBuffer.append(TEXT_363); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_464); + stringBuffer.append(TEXT_364); myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false); - stringBuffer.append(TEXT_465); + stringBuffer.append(TEXT_365); } else { - stringBuffer.append(TEXT_466); + stringBuffer.append(TEXT_366); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_467); + stringBuffer.append(TEXT_367); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_468); + stringBuffer.append(TEXT_368); } if (modelFacet.getTargetMetaFeature() != null) { - stringBuffer.append(TEXT_469); + stringBuffer.append(TEXT_369); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_470); + stringBuffer.append(TEXT_370); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_471); + stringBuffer.append(TEXT_371); myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false); - stringBuffer.append(TEXT_472); + stringBuffer.append(TEXT_372); } else { - stringBuffer.append(TEXT_473); + stringBuffer.append(TEXT_373); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_474); + stringBuffer.append(TEXT_374); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_475); + stringBuffer.append(TEXT_375); } - stringBuffer.append(TEXT_476); + stringBuffer.append(TEXT_376); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); + stringBuffer.append(TEXT_377); if (generateSwitch) { - stringBuffer.append(TEXT_477); + stringBuffer.append(TEXT_378); } else { - stringBuffer.append(TEXT_478); + stringBuffer.append(TEXT_379); } @@ -2031,12 +1756,12 @@ for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.has } //iterate over genLinksCollection if (generateSwitch) { - stringBuffer.append(TEXT_479); + stringBuffer.append(TEXT_380); } if (metaFeature.isListType()) { - stringBuffer.append(TEXT_480); + stringBuffer.append(TEXT_381); } } @@ -2046,153 +1771,172 @@ for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entr Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_481); + stringBuffer.append(TEXT_382); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_482); + stringBuffer.append(TEXT_383); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); - stringBuffer.append(TEXT_483); + stringBuffer.append(TEXT_384); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_484); + stringBuffer.append(TEXT_385); } else { - stringBuffer.append(TEXT_485); + stringBuffer.append(TEXT_386); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_486); + stringBuffer.append(TEXT_387); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); - stringBuffer.append(TEXT_487); + stringBuffer.append(TEXT_388); } - stringBuffer.append(TEXT_488); + stringBuffer.append(TEXT_389); for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { GenLink nextLink = (GenLink) genLinksIterator.next(); - stringBuffer.append(TEXT_489); + stringBuffer.append(TEXT_390); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); + stringBuffer.append(TEXT_391); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_490); + stringBuffer.append(TEXT_392); } - stringBuffer.append(TEXT_491); + stringBuffer.append(TEXT_393); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_492); + stringBuffer.append(TEXT_394); } } - stringBuffer.append(TEXT_493); + stringBuffer.append(TEXT_395); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_494); + stringBuffer.append(TEXT_396); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_495); + stringBuffer.append(TEXT_397); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_496); + stringBuffer.append(TEXT_398); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_497); + stringBuffer.append(TEXT_399); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_498); + stringBuffer.append(TEXT_400); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_499); + stringBuffer.append(TEXT_401); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_500); + stringBuffer.append(TEXT_402); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_501); + stringBuffer.append(TEXT_403); if (_includeUncontainedLinks) { - stringBuffer.append(TEXT_502); + stringBuffer.append(TEXT_404); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_503); + stringBuffer.append(TEXT_405); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_504); + stringBuffer.append(TEXT_406); } - - if (myHelper.containsFeatureModelFacetLinks()) { - stringBuffer.append(TEXT_505); + stringBuffer.append(TEXT_407); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_506); + stringBuffer.append(TEXT_408); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_507); + stringBuffer.append(TEXT_409); for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_508); + stringBuffer.append(TEXT_410); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_509); + stringBuffer.append(TEXT_411); } - stringBuffer.append(TEXT_510); + stringBuffer.append(TEXT_412); if (myHelper.containsTypeModelFacetLinks()) { - stringBuffer.append(TEXT_511); + stringBuffer.append(TEXT_413); } else { - stringBuffer.append(TEXT_512); + stringBuffer.append(TEXT_414); } } - - - if (myHelper.containsTypeModelFacetLinks()) { if (!myHelper.containsFeatureModelFacetLinks()) { - stringBuffer.append(TEXT_513); + stringBuffer.append(TEXT_415); } - stringBuffer.append(TEXT_514); + stringBuffer.append(TEXT_416); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_515); + stringBuffer.append(TEXT_417); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_516); + stringBuffer.append(TEXT_418); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_517); + stringBuffer.append(TEXT_419); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_518); + stringBuffer.append(TEXT_420); } - stringBuffer.append(TEXT_519); + stringBuffer.append(TEXT_421); } - stringBuffer.append(TEXT_520); + stringBuffer.append(TEXT_422); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_521); + stringBuffer.append(TEXT_423); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); + stringBuffer.append(TEXT_424); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_522); + stringBuffer.append(TEXT_425); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_426); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_427); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher")); + stringBuffer.append(TEXT_428); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_429); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_430); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_431); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_432); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_433); } } - stringBuffer.append(TEXT_523); - stringBuffer.append(TEXT_524); - stringBuffer.append(TEXT_525); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); - stringBuffer.append(TEXT_526); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_527); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_528); + stringBuffer.append(TEXT_434); + stringBuffer.append(TEXT_435); + stringBuffer.append(TEXT_436); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); + stringBuffer.append(TEXT_437); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); + stringBuffer.append(TEXT_438); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")); + stringBuffer.append(TEXT_439); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")); + stringBuffer.append(TEXT_440); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")); + stringBuffer.append(TEXT_441); importManager.emitSortedImports(); - stringBuffer.append(TEXT_529); + stringBuffer.append(TEXT_442); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java index e825f9fe5..b404f0f5b 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java @@ -23,182 +23,183 @@ public class LinkEditPartGenerator protected final String TEXT_3 = NL + " */"; protected final String TEXT_4 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; protected final String TEXT_5 = " extends "; - protected final String TEXT_6 = " implements IUpdatableEditPart {"; - protected final String TEXT_7 = NL; - protected final String TEXT_8 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_9 = ";"; - protected final String TEXT_10 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_11 = "("; - protected final String TEXT_12 = " view) {" + NL + "\t\tassert view instanceof "; - protected final String TEXT_13 = ";" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_14 = " getDiagramEdge() {" + NL + "\t\treturn ("; - protected final String TEXT_15 = ") getModel();" + NL + "\t}" + NL; - protected final String TEXT_16 = NL; - protected final String TEXT_17 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; - protected final String TEXT_18 = " view = ("; - protected final String TEXT_19 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; - protected final String TEXT_20 = " view = ("; - protected final String TEXT_21 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!"; - protected final String TEXT_22 = NL; - protected final String TEXT_23 = "\t\tinstallEditPolicy("; - protected final String TEXT_24 = ".COMPONENT_ROLE, new "; - protected final String TEXT_25 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_26 = " createDeleteCommand("; - protected final String TEXT_27 = " deleteRequest) {" + NL + "\t\t\t\tfinal Edge edgeToRemove = getDiagramEdge();" + NL + "\t\t\t\tfinal View source = edgeToRemove.getSource();" + NL + "\t\t\t\tfinal View target = edgeToRemove.getTarget();" + NL + "\t\t\t\t"; - protected final String TEXT_28 = " editingDomain = "; - protected final String TEXT_29 = ".getEditingDomain(getDiagramEdge().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_30 = " cc = new "; - protected final String TEXT_31 = "();" + NL + "\t\t\t\tcc.append(createDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(new "; - protected final String TEXT_32 = "() {" + NL + "\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\tsource.getDiagram().insertEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(source);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(target);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\tsource.getDiagram().removeEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(null);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(null);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}"; - protected final String TEXT_33 = NL; - protected final String TEXT_34 = NL + "\t\t\tprivate "; - protected final String TEXT_35 = " createDomainModelRemoveCommand("; - protected final String TEXT_36 = " editingDomain) {"; - protected final String TEXT_37 = NL + "\t\t\t\t"; - protected final String TEXT_38 = " result = new "; - protected final String TEXT_39 = "();"; - protected final String TEXT_40 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_41 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_42 = ".getElement().eContainer(), "; - protected final String TEXT_43 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_44 = ".getElement()));"; - protected final String TEXT_45 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_46 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_47 = ".getElement().eContainer(), "; - protected final String TEXT_48 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_49 = ".UNSET_VALUE));"; - protected final String TEXT_50 = NL + "\t\t\t\treturn "; - protected final String TEXT_51 = ".INSTANCE;"; - protected final String TEXT_52 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_53 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_54 = ".getElement().eContainer(), "; - protected final String TEXT_55 = ".eINSTANCE.get"; - protected final String TEXT_56 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_57 = ".getElement()));"; - protected final String TEXT_58 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_59 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_60 = ".getElement().eContainer(), "; - protected final String TEXT_61 = ".eINSTANCE.get"; - protected final String TEXT_62 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_63 = ".UNSET_VALUE));"; - protected final String TEXT_64 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_65 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_66 = ".getElement(), "; - protected final String TEXT_67 = ".eINSTANCE.get"; - protected final String TEXT_68 = "(), "; - protected final String TEXT_69 = ".getSource().getElement()));"; - protected final String TEXT_70 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_71 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_72 = ".getElement(), "; - protected final String TEXT_73 = ".eINSTANCE.get"; - protected final String TEXT_74 = "(), "; - protected final String TEXT_75 = ".UNSET_VALUE));"; - protected final String TEXT_76 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_77 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_78 = ".getElement(), "; - protected final String TEXT_79 = ".eINSTANCE.get"; - protected final String TEXT_80 = "(), "; - protected final String TEXT_81 = ".getTarget().getElement()));"; - protected final String TEXT_82 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_83 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_84 = ".getElement(), "; - protected final String TEXT_85 = ".eINSTANCE.get"; - protected final String TEXT_86 = "(), "; - protected final String TEXT_87 = ".UNSET_VALUE));"; - protected final String TEXT_88 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_89 = NL + "\t\t\t\treturn "; - protected final String TEXT_90 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_91 = ".getSource().getElement(), "; - protected final String TEXT_92 = ".eINSTANCE.get"; - protected final String TEXT_93 = "(), "; - protected final String TEXT_94 = ".getTarget().getElement());"; - protected final String TEXT_95 = NL + "\t\t\t\treturn "; - protected final String TEXT_96 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_97 = ".getSource().getElement(), "; - protected final String TEXT_98 = ".eINSTANCE.get"; - protected final String TEXT_99 = "(), "; - protected final String TEXT_100 = ".UNSET_VALUE);"; - protected final String TEXT_101 = NL + "\t\t\t}"; - protected final String TEXT_102 = NL + "\t\t});" + NL + "\t\tinstallEditPolicy("; - protected final String TEXT_103 = ".CONNECTION_ENDPOINTS_ROLE, new "; - protected final String TEXT_104 = "());" + NL + "\t\tinstallEditPolicy("; - protected final String TEXT_105 = ".CONNECTION_BENDPOINTS_ROLE, new "; - protected final String TEXT_106 = "());" + NL + "\t}" + NL; - protected final String TEXT_107 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_108 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor("; - protected final String TEXT_109 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_110 = " nextChild = ("; - protected final String TEXT_111 = ")it.next();" + NL + "\t\t\tif ("; - protected final String TEXT_112 = ".getVisualID(nextChild) == "; - protected final String TEXT_113 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (EditPart) getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_114 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_115 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; - protected final String TEXT_116 = " labelToEdit;" + NL + "\t\t\tif (req instanceof "; - protected final String TEXT_117 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart(("; - protected final String TEXT_118 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_119 = " getLabelEditPart("; - protected final String TEXT_120 = " req) {" + NL + "\t\t"; - protected final String TEXT_121 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; - protected final String TEXT_122 = " view = ("; - protected final String TEXT_123 = ") result.getModel();" + NL + "\t\t\tif (getDiagramEdge().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; - protected final String TEXT_124 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; - protected final String TEXT_125 = NL + "\t\t\t\tcase "; - protected final String TEXT_126 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; - protected final String TEXT_127 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; - protected final String TEXT_128 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((Edge)getModel()).getChildren();" + NL + "\t}" + NL; - protected final String TEXT_129 = NL; - protected final String TEXT_130 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_131 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_132 = " feature, "; - protected final String TEXT_133 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + NL; - protected final String TEXT_134 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; - protected final String TEXT_135 = NL; - protected final String TEXT_136 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends "; - protected final String TEXT_137 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_138 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher(("; - protected final String TEXT_139 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_140 = NL; - protected final String TEXT_141 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher("; - protected final String TEXT_142 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher("; - protected final String TEXT_143 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher("; - protected final String TEXT_144 = " feature) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\tRefresher refresher = (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t\tif (refresher instanceof CompositeRefresher) {" + NL + "\t\t\treturn (CompositeRefresher) refresher;" + NL + "\t\t}" + NL + "\t\tCompositeRefresher result = new CompositeRefresher();" + NL + "\t\tif (refresher != null) {" + NL + "\t\t\tresult.addRefresher(refresher);" + NL + "\t\t}" + NL + "\t\tstructuralFeatures2Refresher.put(feature, result);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; - protected final String TEXT_145 = NL; - protected final String TEXT_146 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_147 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_148 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_149 = NL; - protected final String TEXT_150 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_151 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; - protected final String TEXT_152 = NL; - protected final String TEXT_153 = "\t\tRefresher bendpointsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBendpoints();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_154 = ".eINSTANCE.getEdge_Bendpoints(), bendpointsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_155 = ".eINSTANCE.getRelativeBendpoints_Points(), bendpointsRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t\trefreshBendpoints();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBendpoints() {" + NL + "\t\t"; - protected final String TEXT_156 = " bendpoints = ("; - protected final String TEXT_157 = ") getDiagramEdge().getBendpoints();" + NL + "\t\tif (bendpoints == null) {" + NL + "\t\t\tgetConnectionFigure().setRoutingConstraint("; - protected final String TEXT_158 = ".EMPTY_LIST);" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_159 = " modelConstraint = bendpoints.getPoints();" + NL + "\t\t"; - protected final String TEXT_160 = " figureConstraint = new "; - protected final String TEXT_161 = "();" + NL + "\t\tfor (int i = 0; i < modelConstraint.size(); i++) {" + NL + "\t\t\t"; - protected final String TEXT_162 = " wbp = ("; - protected final String TEXT_163 = ") modelConstraint.get(i);" + NL + "\t\t\t"; - protected final String TEXT_164 = " rbp = new "; - protected final String TEXT_165 = "(getConnectionFigure());" + NL + "\t\t\trbp.setRelativeDimensions(new "; - protected final String TEXT_166 = "(wbp.getSourceX(), wbp.getSourceY()), new "; - protected final String TEXT_167 = "(wbp.getTargetX(), wbp.getTargetY()));" + NL + "\t\t\trbp.setWeight((i + 1) / ((float) modelConstraint.size() + 1));" + NL + "\t\t\tfigureConstraint.add(rbp);" + NL + "\t\t}" + NL + "\t\tgetConnectionFigure().setRoutingConstraint(figureConstraint);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tsuper.addNotify();" + NL + "\t\tgetConnectionFigure().setConnectionRouter(new "; - protected final String TEXT_168 = "());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove <i>generated</i> tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_169 = " createFigure() {"; - protected final String TEXT_170 = NL + "\t\treturn new "; - protected final String TEXT_171 = "();"; - protected final String TEXT_172 = NL + "\t\treturn "; - protected final String TEXT_173 = ";"; - protected final String TEXT_174 = NL + " \t\treturn new "; - protected final String TEXT_175 = "();"; - protected final String TEXT_176 = NL + "\t}" + NL; - protected final String TEXT_177 = NL; + protected final String TEXT_6 = " implements "; + protected final String TEXT_7 = " {"; + protected final String TEXT_8 = NL; + protected final String TEXT_9 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_10 = ";"; + protected final String TEXT_11 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_12 = "("; + protected final String TEXT_13 = " view) {" + NL + "\t\tassert view instanceof "; + protected final String TEXT_14 = ";" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_15 = " getDiagramEdge() {" + NL + "\t\treturn ("; + protected final String TEXT_16 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_17 = NL; + protected final String TEXT_18 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; + protected final String TEXT_19 = " view = ("; + protected final String TEXT_20 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; + protected final String TEXT_21 = " view = ("; + protected final String TEXT_22 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!"; + protected final String TEXT_23 = NL; + protected final String TEXT_24 = "\t\tinstallEditPolicy("; + protected final String TEXT_25 = ".COMPONENT_ROLE, new "; + protected final String TEXT_26 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_27 = " createDeleteCommand("; + protected final String TEXT_28 = " deleteRequest) {" + NL + "\t\t\t\tfinal Edge edgeToRemove = getDiagramEdge();" + NL + "\t\t\t\tfinal View source = edgeToRemove.getSource();" + NL + "\t\t\t\tfinal View target = edgeToRemove.getTarget();" + NL + "\t\t\t\t"; + protected final String TEXT_29 = " editingDomain = "; + protected final String TEXT_30 = ".getEditingDomain(getDiagramEdge().getDiagram().getElement());" + NL + "\t\t\t\t"; + protected final String TEXT_31 = " cc = new "; + protected final String TEXT_32 = "();" + NL + "\t\t\t\tcc.append(createDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(new "; + protected final String TEXT_33 = "() {" + NL + "\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\tsource.getDiagram().insertEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(source);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(target);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\tsource.getDiagram().removeEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(null);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(null);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t\t\t\treturn new "; + protected final String TEXT_34 = "(editingDomain, cc);" + NL + "\t\t\t}"; + protected final String TEXT_35 = NL; + protected final String TEXT_36 = NL + "\t\t\tprivate "; + protected final String TEXT_37 = " createDomainModelRemoveCommand("; + protected final String TEXT_38 = " editingDomain) {"; + protected final String TEXT_39 = NL + "\t\t\t\t"; + protected final String TEXT_40 = " result = new "; + protected final String TEXT_41 = "();"; + protected final String TEXT_42 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_43 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_44 = ".getElement().eContainer(), "; + protected final String TEXT_45 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_46 = ".getElement()));"; + protected final String TEXT_47 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_48 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_49 = ".getElement().eContainer(), "; + protected final String TEXT_50 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_51 = ".UNSET_VALUE));"; + protected final String TEXT_52 = NL + "\t\t\t\treturn "; + protected final String TEXT_53 = ".INSTANCE;"; + protected final String TEXT_54 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_55 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_56 = ".getElement().eContainer(), "; + protected final String TEXT_57 = ".eINSTANCE.get"; + protected final String TEXT_58 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_59 = ".getElement()));"; + protected final String TEXT_60 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_61 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_62 = ".getElement().eContainer(), "; + protected final String TEXT_63 = ".eINSTANCE.get"; + protected final String TEXT_64 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_65 = ".UNSET_VALUE));"; + protected final String TEXT_66 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_67 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_68 = ".getElement(), "; + protected final String TEXT_69 = ".eINSTANCE.get"; + protected final String TEXT_70 = "(), "; + protected final String TEXT_71 = ".getSource().getElement()));"; + protected final String TEXT_72 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_73 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_74 = ".getElement(), "; + protected final String TEXT_75 = ".eINSTANCE.get"; + protected final String TEXT_76 = "(), "; + protected final String TEXT_77 = ".UNSET_VALUE));"; + protected final String TEXT_78 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_79 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_80 = ".getElement(), "; + protected final String TEXT_81 = ".eINSTANCE.get"; + protected final String TEXT_82 = "(), "; + protected final String TEXT_83 = ".getTarget().getElement()));"; + protected final String TEXT_84 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_85 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_86 = ".getElement(), "; + protected final String TEXT_87 = ".eINSTANCE.get"; + protected final String TEXT_88 = "(), "; + protected final String TEXT_89 = ".UNSET_VALUE));"; + protected final String TEXT_90 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_91 = NL + "\t\t\t\treturn "; + protected final String TEXT_92 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_93 = ".getSource().getElement(), "; + protected final String TEXT_94 = ".eINSTANCE.get"; + protected final String TEXT_95 = "(), "; + protected final String TEXT_96 = ".getTarget().getElement());"; + protected final String TEXT_97 = NL + "\t\t\t\treturn "; + protected final String TEXT_98 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_99 = ".getSource().getElement(), "; + protected final String TEXT_100 = ".eINSTANCE.get"; + protected final String TEXT_101 = "(), "; + protected final String TEXT_102 = ".UNSET_VALUE);"; + protected final String TEXT_103 = NL + "\t\t\t}"; + protected final String TEXT_104 = NL + "\t\t});" + NL + "\t\tinstallEditPolicy("; + protected final String TEXT_105 = ".CONNECTION_ENDPOINTS_ROLE, new "; + protected final String TEXT_106 = "());" + NL + "\t\tinstallEditPolicy("; + protected final String TEXT_107 = ".CONNECTION_BENDPOINTS_ROLE, new "; + protected final String TEXT_108 = "());" + NL + "\t}" + NL; + protected final String TEXT_109 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_110 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor("; + protected final String TEXT_111 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_112 = " nextChild = ("; + protected final String TEXT_113 = ")it.next();" + NL + "\t\t\tif ("; + protected final String TEXT_114 = ".getVisualID(nextChild) == "; + protected final String TEXT_115 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (EditPart) getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_116 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_117 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; + protected final String TEXT_118 = " labelToEdit;" + NL + "\t\t\tif (req instanceof "; + protected final String TEXT_119 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart(("; + protected final String TEXT_120 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_121 = " getLabelEditPart("; + protected final String TEXT_122 = " req) {" + NL + "\t\t"; + protected final String TEXT_123 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; + protected final String TEXT_124 = " view = ("; + protected final String TEXT_125 = ") result.getModel();" + NL + "\t\t\tif (getDiagramEdge().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; + protected final String TEXT_126 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; + protected final String TEXT_127 = NL + "\t\t\t\tcase "; + protected final String TEXT_128 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; + protected final String TEXT_129 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; + protected final String TEXT_130 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((Edge)getModel()).getChildren();" + NL + "\t}" + NL; + protected final String TEXT_131 = NL; + protected final String TEXT_132 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_133 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_134 = " feature, "; + protected final String TEXT_135 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + NL; + protected final String TEXT_136 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; + protected final String TEXT_137 = NL; + protected final String TEXT_138 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_139 = " domainModelRefresher = new "; + protected final String TEXT_140 = "(this);" + NL; + protected final String TEXT_141 = NL; + protected final String TEXT_142 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher("; + protected final String TEXT_143 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher("; + protected final String TEXT_144 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher("; + protected final String TEXT_145 = " feature) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\tRefresher refresher = (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t\tif (refresher instanceof CompositeRefresher) {" + NL + "\t\t\treturn (CompositeRefresher) refresher;" + NL + "\t\t}" + NL + "\t\tCompositeRefresher result = new CompositeRefresher();" + NL + "\t\tif (refresher != null) {" + NL + "\t\t\tresult.addRefresher(refresher);" + NL + "\t\t}" + NL + "\t\tstructuralFeatures2Refresher.put(feature, result);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; + protected final String TEXT_146 = NL; + protected final String TEXT_147 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_148 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_149 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_150 = NL; + protected final String TEXT_151 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_152 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; + protected final String TEXT_153 = NL; + protected final String TEXT_154 = "\t\tRefresher bendpointsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBendpoints();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_155 = ".eINSTANCE.getEdge_Bendpoints(), bendpointsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_156 = ".eINSTANCE.getRelativeBendpoints_Points(), bendpointsRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t\trefreshBendpoints();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBendpoints() {" + NL + "\t\t"; + protected final String TEXT_157 = " bendpoints = ("; + protected final String TEXT_158 = ") getDiagramEdge().getBendpoints();" + NL + "\t\tif (bendpoints == null) {" + NL + "\t\t\tgetConnectionFigure().setRoutingConstraint("; + protected final String TEXT_159 = ".EMPTY_LIST);" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_160 = " modelConstraint = bendpoints.getPoints();" + NL + "\t\t"; + protected final String TEXT_161 = " figureConstraint = new "; + protected final String TEXT_162 = "();" + NL + "\t\tfor (int i = 0; i < modelConstraint.size(); i++) {" + NL + "\t\t\t"; + protected final String TEXT_163 = " wbp = ("; + protected final String TEXT_164 = ") modelConstraint.get(i);" + NL + "\t\t\t"; + protected final String TEXT_165 = " rbp = new "; + protected final String TEXT_166 = "(getConnectionFigure());" + NL + "\t\t\trbp.setRelativeDimensions(new "; + protected final String TEXT_167 = "(wbp.getSourceX(), wbp.getSourceY()), new "; + protected final String TEXT_168 = "(wbp.getTargetX(), wbp.getTargetY()));" + NL + "\t\t\trbp.setWeight((i + 1) / ((float) modelConstraint.size() + 1));" + NL + "\t\t\tfigureConstraint.add(rbp);" + NL + "\t\t}" + NL + "\t\tgetConnectionFigure().setRoutingConstraint(figureConstraint);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tsuper.addNotify();" + NL + "\t\tgetConnectionFigure().setConnectionRouter(new "; + protected final String TEXT_169 = "());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove <i>generated</i> tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_170 = " createFigure() {"; + protected final String TEXT_171 = NL + "\t\treturn new "; + protected final String TEXT_172 = "();"; + protected final String TEXT_173 = NL + "\t\treturn "; + protected final String TEXT_174 = ";"; + protected final String TEXT_175 = NL + " \t\treturn new "; + protected final String TEXT_176 = "();"; + protected final String TEXT_177 = NL + "\t}" + NL; protected final String TEXT_178 = NL; - protected final String TEXT_179 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; - protected final String TEXT_180 = NL + "}"; - protected final String TEXT_181 = NL; + protected final String TEXT_179 = NL; + protected final String TEXT_180 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; + protected final String TEXT_181 = NL + "}"; + protected final String TEXT_182 = NL; public String generate(Object argument) { @@ -227,27 +228,27 @@ importManager.markImportLocation(stringBuffer); stringBuffer.append(TEXT_5); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractConnectionEditPart")); stringBuffer.append(TEXT_6); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_7); { GenCommonBase genCommonBase = genLink; - stringBuffer.append(TEXT_7); stringBuffer.append(TEXT_8); - stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_9); - } + stringBuffer.append(genCommonBase.getVisualID()); stringBuffer.append(TEXT_10); - stringBuffer.append(genLink.getEditPartClassName()); + } stringBuffer.append(TEXT_11); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(genLink.getEditPartClassName()); stringBuffer.append(TEXT_12); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_13); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); stringBuffer.append(TEXT_14); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); stringBuffer.append(TEXT_15); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); stringBuffer.append(TEXT_16); stringBuffer.append(TEXT_17); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_18); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_19); @@ -255,39 +256,43 @@ GenCommonBase genCommonBase = genLink; stringBuffer.append(TEXT_20); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_21); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_22); stringBuffer.append(TEXT_23); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_24); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_25); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); stringBuffer.append(TEXT_26); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_27); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); stringBuffer.append(TEXT_28); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_29); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_30); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_31); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_32); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); + stringBuffer.append(TEXT_33); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_34); { String _edge = "getDiagramEdge()"; - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_35); //input: _edge : String - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_38); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -314,188 +319,188 @@ GenCommonBase genCommonBase = genLink; } } - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_41); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_40); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_41); - stringBuffer.append(_edge); stringBuffer.append(TEXT_42); - stringBuffer.append(_edge); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_43); stringBuffer.append(_edge); stringBuffer.append(TEXT_44); + stringBuffer.append(_edge); + stringBuffer.append(TEXT_45); + stringBuffer.append(_edge); + stringBuffer.append(TEXT_46); } else { - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_48); stringBuffer.append(_edge); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_49); stringBuffer.append(_edge); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_51); } } else { - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_53); } if (removeChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_55); stringBuffer.append(_edge); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_57); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_58); stringBuffer.append(_edge); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_59); } else { - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_61); stringBuffer.append(_edge); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_63); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_65); } } if (removeSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_67); stringBuffer.append(_edge); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_69); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_70); stringBuffer.append(_edge); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_71); } else { - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_73); stringBuffer.append(_edge); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_75); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_77); } } if (removeTarget) { if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_79); stringBuffer.append(_edge); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_81); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_82); stringBuffer.append(_edge); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_83); } else { - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_85); stringBuffer.append(_edge); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_87); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_89); } } - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_90); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_92); stringBuffer.append(_edge); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_94); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_95); stringBuffer.append(_edge); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_96); } else { - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_98); stringBuffer.append(_edge); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_100); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_102); } } - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_103); } //local declarations - stringBuffer.append(TEXT_102); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_103); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")); stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_105); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + ".BendpointEditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")); stringBuffer.append(TEXT_106); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); + stringBuffer.append(TEXT_107); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.BendpointEditPolicy")); + stringBuffer.append(TEXT_108); GenLinkLabel primaryLabel = null; for(Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) { @@ -507,41 +512,41 @@ for(Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) { } if (primaryLabel != null) { - stringBuffer.append(TEXT_107); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_108); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_109); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_110); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_111); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_112); - stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_113); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_114); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); + stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_115); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_116); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); stringBuffer.append(TEXT_117); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_118); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_121); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_122); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_123); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_124); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_125); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_126); for (Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) { GenLinkLabel genLabel = (GenLinkLabel) it.next(); @@ -549,93 +554,91 @@ if (primaryLabel != null) { continue; } - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_128); } - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_129); } //if (primaryLabel != null, i.e., there are editable labels) - stringBuffer.append(TEXT_128); - stringBuffer.append(TEXT_129); stringBuffer.append(TEXT_130); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_131); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_132); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_133); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_134); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(TEXT_135); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { //Otherwise, there's no element associated with the element - stringBuffer.append(TEXT_134); - stringBuffer.append(TEXT_135); stringBuffer.append(TEXT_136); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); stringBuffer.append(TEXT_137); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_138); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); stringBuffer.append(TEXT_139); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter")); + stringBuffer.append(TEXT_140); } - stringBuffer.append(TEXT_140); stringBuffer.append(TEXT_141); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_144); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_145); stringBuffer.append(TEXT_146); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_148); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_149); stringBuffer.append(TEXT_150); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_151); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_152); stringBuffer.append(TEXT_153); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_155); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")); stringBuffer.append(TEXT_157); - stringBuffer.append(importManager.getImportedName("java.util.Collections")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")); stringBuffer.append(TEXT_158); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_160); - stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_161); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")); + stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")); stringBuffer.append(TEXT_163); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")); stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint")); stringBuffer.append(TEXT_165); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint")); stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); stringBuffer.append(TEXT_167); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BendpointConnectionRouter")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); stringBuffer.append(TEXT_168); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BendpointConnectionRouter")); stringBuffer.append(TEXT_169); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(TEXT_170); Viewmap viewmap = genLink.getViewmap(); if (viewmap instanceof FigureViewmap) { @@ -645,41 +648,41 @@ if (viewmap instanceof FigureViewmap) { figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection"; } - stringBuffer.append(TEXT_170); - stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); stringBuffer.append(TEXT_171); + stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); + stringBuffer.append(TEXT_172); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_172); - stringBuffer.append(((SnippetViewmap) viewmap).getBody()); stringBuffer.append(TEXT_173); + stringBuffer.append(((SnippetViewmap) viewmap).getBody()); + stringBuffer.append(TEXT_174); } // instanceof SnippetViewmap else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_174); - stringBuffer.append(((InnerClassViewmap) viewmap).getClassName()); stringBuffer.append(TEXT_175); - } + stringBuffer.append(((InnerClassViewmap) viewmap).getClassName()); stringBuffer.append(TEXT_176); + } + stringBuffer.append(TEXT_177); if (genLink.getViewmap() instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody(); - stringBuffer.append(TEXT_177); - stringBuffer.append(classBody); stringBuffer.append(TEXT_178); + stringBuffer.append(classBody); + stringBuffer.append(TEXT_179); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_180); } } - stringBuffer.append(TEXT_180); - importManager.emitSortedImports(); stringBuffer.append(TEXT_181); + importManager.emitSortedImports(); + stringBuffer.append(TEXT_182); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java index 1ac40132d..b611a1de2 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java @@ -69,215 +69,223 @@ public class LinkLabelEditPartGenerator protected final String TEXT_49 = ".getDiagram().getElement());"; protected final String TEXT_50 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; protected final String TEXT_51 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_52 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_53 = " createDomainModelCommand("; - protected final String TEXT_54 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_55 = " element = "; - protected final String TEXT_56 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_57 = " feature = ("; - protected final String TEXT_58 = ") "; - protected final String TEXT_59 = ".eINSTANCE.get"; - protected final String TEXT_60 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; - protected final String TEXT_61 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_62 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_63 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_64 = " result = new "; - protected final String TEXT_65 = "();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_66 = " values = new "; - protected final String TEXT_67 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_68 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_69 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_70 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; - protected final String TEXT_71 = NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_72 = ".create(editingDomain, element, feature, valueToSet);"; - protected final String TEXT_73 = NL + "\t\t\t\t\t}"; - protected final String TEXT_74 = NL + "\t\t\t\t\t\tif (parseResult.length != "; - protected final String TEXT_75 = ") {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_76 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_77 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_78 = " createDomainModelCommand("; - protected final String TEXT_79 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_80 = " element = "; - protected final String TEXT_81 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_82 = " result = new "; - protected final String TEXT_83 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; - protected final String TEXT_84 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_85 = " "; - protected final String TEXT_86 = "feature = ("; - protected final String TEXT_87 = ") "; - protected final String TEXT_88 = ".eINSTANCE.get"; - protected final String TEXT_89 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; - protected final String TEXT_90 = ".parseValue(feature, values["; - protected final String TEXT_91 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_92 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_93 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_94 = " "; - protected final String TEXT_95 = "values = new "; - protected final String TEXT_96 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_97 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_98 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_99 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_100 = NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_52 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);" + NL + "\t\t\t\t\t\treturn new "; + protected final String TEXT_53 = "(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; + protected final String TEXT_54 = " createDomainModelCommand("; + protected final String TEXT_55 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_56 = " element = "; + protected final String TEXT_57 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_58 = " feature = ("; + protected final String TEXT_59 = ") "; + protected final String TEXT_60 = ".eINSTANCE.get"; + protected final String TEXT_61 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_62 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_63 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_64 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_65 = " result = new "; + protected final String TEXT_66 = "();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_67 = " values = new "; + protected final String TEXT_68 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_69 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_70 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_71 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; + protected final String TEXT_72 = NL + "\t\t\t\t\t\treturn "; + protected final String TEXT_73 = ".create(editingDomain, element, feature, valueToSet);"; + protected final String TEXT_74 = NL + "\t\t\t\t\t}"; + protected final String TEXT_75 = NL + "\t\t\t\t\t\tif (parseResult.length != "; + protected final String TEXT_76 = ") {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_77 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_78 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult);" + NL + "\t\t\t\t\t\treturn new "; + protected final String TEXT_79 = "(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; + protected final String TEXT_80 = " createDomainModelCommand("; + protected final String TEXT_81 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_82 = " element = "; + protected final String TEXT_83 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_84 = " result = new "; + protected final String TEXT_85 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; + protected final String TEXT_86 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_87 = " "; + protected final String TEXT_88 = "feature = ("; + protected final String TEXT_89 = ") "; + protected final String TEXT_90 = ".eINSTANCE.get"; + protected final String TEXT_91 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_92 = ".parseValue(feature, values["; + protected final String TEXT_93 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_94 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_95 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_96 = " "; + protected final String TEXT_97 = "values = new "; + protected final String TEXT_98 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_99 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_100 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; protected final String TEXT_101 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_102 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; - protected final String TEXT_103 = NL + "\t\t\t\t});"; - protected final String TEXT_104 = NL + "\t}" + NL; - protected final String TEXT_105 = NL; - protected final String TEXT_106 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_107 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_108 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t} else {" + NL + "\t\t\tsuper.performRequest(req);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_109 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; - protected final String TEXT_110 = "(this, "; - protected final String TEXT_111 = ".class, new "; - protected final String TEXT_112 = "() {" + NL + "\t\t\t\tpublic void relocate("; - protected final String TEXT_113 = " celleditor) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_114 = " rect = getLabel().getTextBounds();" + NL + "\t\t\t\t\tgetLabel().translateToAbsolute(rect);" + NL + "\t\t\t\t\tcelleditor.getControl().setBounds(rect.x, rect.y, rect.width, rect.height);" + NL + "\t\t\t\t}" + NL + "\t\t\t}) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelEditText());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL; - protected final String TEXT_115 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshBounds();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\tNode node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof Location;" + NL + "\t\tfinal Location location = (Location) node.getLayoutConstraint();" + NL + "\t\t"; - protected final String TEXT_116 = " parent = getUpdatableParent();" + NL + "\t\t"; - protected final String TEXT_117 = " connection = ("; - protected final String TEXT_118 = ") parent.getFigure();"; - protected final String TEXT_119 = NL + "\t\t(("; - protected final String TEXT_120 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new "; - protected final String TEXT_121 = "(connection, "; - protected final String TEXT_122 = "."; - protected final String TEXT_123 = ") {" + NL + "\t\t\t\t\tprotected "; - protected final String TEXT_124 = " getReferencePoint() {" + NL + "\t\t\t\t\t\treturn super.getReferencePoint().translate(location.getX(), location.getY());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL; - protected final String TEXT_125 = NL; - protected final String TEXT_126 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; - protected final String TEXT_127 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; - protected final String TEXT_128 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; - protected final String TEXT_129 = " element = "; - protected final String TEXT_130 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, VIEW_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelEditText() {" + NL + "\t\t"; + protected final String TEXT_102 = NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_103 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_104 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; + protected final String TEXT_105 = NL + "\t\t\t\t});"; + protected final String TEXT_106 = NL + "\t}" + NL; + protected final String TEXT_107 = NL; + protected final String TEXT_108 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_109 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_110 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t} else {" + NL + "\t\t\tsuper.performRequest(req);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_111 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; + protected final String TEXT_112 = "(this, "; + protected final String TEXT_113 = ".class, new "; + protected final String TEXT_114 = "() {" + NL + "\t\t\t\tpublic void relocate("; + protected final String TEXT_115 = " celleditor) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_116 = " rect = getLabel().getTextBounds();" + NL + "\t\t\t\t\tgetLabel().translateToAbsolute(rect);" + NL + "\t\t\t\t\tcelleditor.getControl().setBounds(rect.x, rect.y, rect.width, rect.height);" + NL + "\t\t\t\t}" + NL + "\t\t\t}) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelEditText());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL; + protected final String TEXT_117 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshBounds();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\tNode node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof Location;" + NL + "\t\tfinal Location location = (Location) node.getLayoutConstraint();" + NL + "\t\t"; + protected final String TEXT_118 = " parent = getUpdatableParent();" + NL + "\t\t"; + protected final String TEXT_119 = " connection = ("; + protected final String TEXT_120 = ") parent.getFigure();"; + protected final String TEXT_121 = NL + "\t\t(("; + protected final String TEXT_122 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new "; + protected final String TEXT_123 = "(connection, "; + protected final String TEXT_124 = "."; + protected final String TEXT_125 = ") {" + NL + "\t\t\t\t\tprotected "; + protected final String TEXT_126 = " getReferencePoint() {" + NL + "\t\t\t\t\t\treturn super.getReferencePoint().translate(location.getX(), location.getY());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL; + protected final String TEXT_127 = NL; + protected final String TEXT_128 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; + protected final String TEXT_129 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; + protected final String TEXT_130 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; protected final String TEXT_131 = " element = "; - protected final String TEXT_132 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, EDIT_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String buildTextByPattern("; - protected final String TEXT_133 = " element, String pattern) {"; - protected final String TEXT_134 = NL + "\t\tif ("; - protected final String TEXT_135 = " == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; - protected final String TEXT_136 = NL + "\t\treturn "; - protected final String TEXT_137 = ".format(pattern, new Object[] {"; - protected final String TEXT_138 = NL + "\t\t\tnew "; - protected final String TEXT_139 = "("; - protected final String TEXT_140 = ")"; - protected final String TEXT_141 = NL + "\t\t});"; - protected final String TEXT_142 = NL + "\t\treturn "; - protected final String TEXT_143 = ".format(pattern, new Object[] {"; - protected final String TEXT_144 = NL + "\t\t\tnew "; - protected final String TEXT_145 = "("; - protected final String TEXT_146 = ")"; - protected final String TEXT_147 = ","; - protected final String TEXT_148 = NL + "\t\t});"; - protected final String TEXT_149 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; - protected final String TEXT_150 = NL + "\t}"; - protected final String TEXT_151 = NL; - protected final String TEXT_152 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_153 = NL + "\t\t"; - protected final String TEXT_154 = " style =" + NL + "\t\t\t("; - protected final String TEXT_155 = ") "; - protected final String TEXT_156 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_157 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_158 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = "; - protected final String TEXT_159 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_160 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_161 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_162 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_163 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new "; - protected final String TEXT_164 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}"; - protected final String TEXT_165 = "\t" + NL + "\t}"; - protected final String TEXT_166 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_167 = " createdFont;"; - protected final String TEXT_168 = "\t"; - protected final String TEXT_169 = NL; - protected final String TEXT_170 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; - protected final String TEXT_171 = " style = ("; - protected final String TEXT_172 = ") "; - protected final String TEXT_173 = ".getStyle("; - protected final String TEXT_174 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_175 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; - protected final String TEXT_176 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new "; - protected final String TEXT_177 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_178 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_179 = " getLabelIcon() {"; - protected final String TEXT_180 = NL + "\t\t"; - protected final String TEXT_181 = " imageDescriptor = "; - protected final String TEXT_182 = ".getInstance().getItemImageDescriptor(resolveSemanticElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; - protected final String TEXT_183 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_184 = " resolveSemanticElement() {" + NL + "\t\t"; - protected final String TEXT_185 = " parent = getUpdatableParent();" + NL + "\t\tif (parent == null || parent.getModel() instanceof "; - protected final String TEXT_186 = " == false) {" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_187 = NL + "\t\t"; - protected final String TEXT_188 = " view = ("; - protected final String TEXT_189 = ") parent.getModel();" + NL + "\t\treturn ("; - protected final String TEXT_190 = ") view.getElement();"; - protected final String TEXT_191 = NL + "\t\t"; - protected final String TEXT_192 = " target = (("; - protected final String TEXT_193 = ") parent.getModel()).getTarget();" + NL + "\t\treturn (target != null && target.getElement() instanceof "; - protected final String TEXT_194 = ") ? ("; - protected final String TEXT_195 = ") target.getElement() : null;"; - protected final String TEXT_196 = NL + "\t\treturn null;"; - protected final String TEXT_197 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_198 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; - protected final String TEXT_199 = ") {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_200 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t"; - protected final String TEXT_201 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_202 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_203 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_204 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_205 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_206 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_207 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_208 = ".eINSTANCE.get"; - protected final String TEXT_209 = "(), labelRefresher);"; - protected final String TEXT_210 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_211 = ".eINSTANCE.get"; - protected final String TEXT_212 = "(), labelRefresher);"; - protected final String TEXT_213 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t"; - protected final String TEXT_214 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_215 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_216 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_217 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_218 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_219 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_220 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_221 = ".eINSTANCE.get"; - protected final String TEXT_222 = "(), labelRefresher);"; - protected final String TEXT_223 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_224 = ".eINSTANCE.get"; - protected final String TEXT_225 = "(), labelRefresher);"; - protected final String TEXT_226 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};" + NL; - protected final String TEXT_227 = NL; - protected final String TEXT_228 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_229 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_230 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_231 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_232 = " createLabel() {"; - protected final String TEXT_233 = NL + "\t\treturn new "; - protected final String TEXT_234 = "();"; - protected final String TEXT_235 = NL + "\t\treturn "; - protected final String TEXT_236 = ";"; - protected final String TEXT_237 = NL + "\t\treturn new "; - protected final String TEXT_238 = "();"; - protected final String TEXT_239 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_240 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_241 = " label = createLabel();"; - protected final String TEXT_242 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_243 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_244 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_245 = NL + NL + "\t/**"; - protected final String TEXT_246 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_247 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_248 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_249 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_250 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_251 = "("; - protected final String TEXT_252 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_253 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_254 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_255 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_256 = NL; - protected final String TEXT_257 = NL; - protected final String TEXT_258 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; - protected final String TEXT_259 = NL + "}"; - protected final String TEXT_260 = NL; + protected final String TEXT_132 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, VIEW_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelEditText() {" + NL + "\t\t"; + protected final String TEXT_133 = " element = "; + protected final String TEXT_134 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, EDIT_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String buildTextByPattern("; + protected final String TEXT_135 = " element, String pattern) {"; + protected final String TEXT_136 = NL + "\t\tif ("; + protected final String TEXT_137 = " == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; + protected final String TEXT_138 = NL + "\t\treturn "; + protected final String TEXT_139 = ".format(pattern, new Object[] {"; + protected final String TEXT_140 = NL + "\t\t\tnew "; + protected final String TEXT_141 = "("; + protected final String TEXT_142 = ")"; + protected final String TEXT_143 = NL + "\t\t});"; + protected final String TEXT_144 = NL + "\t\treturn "; + protected final String TEXT_145 = ".format(pattern, new Object[] {"; + protected final String TEXT_146 = NL + "\t\t\tnew "; + protected final String TEXT_147 = "("; + protected final String TEXT_148 = ")"; + protected final String TEXT_149 = ","; + protected final String TEXT_150 = NL + "\t\t});"; + protected final String TEXT_151 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; + protected final String TEXT_152 = NL + "\t}"; + protected final String TEXT_153 = NL; + protected final String TEXT_154 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_155 = NL + "\t\t"; + protected final String TEXT_156 = " style =" + NL + "\t\t\t("; + protected final String TEXT_157 = ") "; + protected final String TEXT_158 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_159 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_160 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = "; + protected final String TEXT_161 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_162 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_163 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_164 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_165 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new "; + protected final String TEXT_166 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}"; + protected final String TEXT_167 = "\t" + NL + "\t}"; + protected final String TEXT_168 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_169 = " createdFont;"; + protected final String TEXT_170 = "\t"; + protected final String TEXT_171 = NL; + protected final String TEXT_172 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; + protected final String TEXT_173 = " style = ("; + protected final String TEXT_174 = ") "; + protected final String TEXT_175 = ".getStyle("; + protected final String TEXT_176 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_177 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; + protected final String TEXT_178 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new "; + protected final String TEXT_179 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_180 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_181 = " getLabelIcon() {"; + protected final String TEXT_182 = NL + "\t\t"; + protected final String TEXT_183 = " imageDescriptor = "; + protected final String TEXT_184 = ".getInstance().getItemImageDescriptor(resolveSemanticElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; + protected final String TEXT_185 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_186 = " resolveSemanticElement() {" + NL + "\t\t"; + protected final String TEXT_187 = " parent = getUpdatableParent();" + NL + "\t\tif (parent == null || parent.getModel() instanceof "; + protected final String TEXT_188 = " == false) {" + NL + "\t\t\treturn null;" + NL + "\t\t}"; + protected final String TEXT_189 = NL + "\t\t"; + protected final String TEXT_190 = " view = ("; + protected final String TEXT_191 = ") parent.getModel();" + NL + "\t\treturn ("; + protected final String TEXT_192 = ") view.getElement();"; + protected final String TEXT_193 = NL + "\t\t"; + protected final String TEXT_194 = " target = (("; + protected final String TEXT_195 = ") parent.getModel()).getTarget();" + NL + "\t\treturn (target != null && target.getElement() instanceof "; + protected final String TEXT_196 = ") ? ("; + protected final String TEXT_197 = ") target.getElement() : null;"; + protected final String TEXT_198 = NL + "\t\treturn null;"; + protected final String TEXT_199 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_200 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; + protected final String TEXT_201 = ") {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_202 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t"; + protected final String TEXT_203 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_204 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_205 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_206 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_207 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_208 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_209 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_210 = ".eINSTANCE.get"; + protected final String TEXT_211 = "(), labelRefresher);"; + protected final String TEXT_212 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_213 = ".eINSTANCE.get"; + protected final String TEXT_214 = "(), labelRefresher);"; + protected final String TEXT_215 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t"; + protected final String TEXT_216 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_217 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_218 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_219 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_220 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_221 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_222 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_223 = ".eINSTANCE.get"; + protected final String TEXT_224 = "(), labelRefresher);"; + protected final String TEXT_225 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_226 = ".eINSTANCE.get"; + protected final String TEXT_227 = "(), labelRefresher);"; + protected final String TEXT_228 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_229 = ".Refresher labelRefresher = new "; + protected final String TEXT_230 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_231 = ".Refresher fontColorRefresher = new "; + protected final String TEXT_232 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_233 = ".Refresher fontRefresher = new "; + protected final String TEXT_234 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};" + NL; + protected final String TEXT_235 = NL; + protected final String TEXT_236 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_237 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_238 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_239 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_240 = " createLabel() {"; + protected final String TEXT_241 = NL + "\t\treturn new "; + protected final String TEXT_242 = "();"; + protected final String TEXT_243 = NL + "\t\treturn "; + protected final String TEXT_244 = ";"; + protected final String TEXT_245 = NL + "\t\treturn new "; + protected final String TEXT_246 = "();"; + protected final String TEXT_247 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_248 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_249 = " label = createLabel();"; + protected final String TEXT_250 = NL + "\t\tdefaultText = label.getText();"; + protected final String TEXT_251 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_252 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_253 = NL + NL + "\t/**"; + protected final String TEXT_254 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_255 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_256 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_257 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_258 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_259 = "("; + protected final String TEXT_260 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_261 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_262 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_263 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_264 = NL; + protected final String TEXT_265 = NL; + protected final String TEXT_266 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; + protected final String TEXT_267 = NL + "}"; + protected final String TEXT_268 = NL; public String generate(Object argument) { @@ -469,171 +477,175 @@ if (labelModelFacet instanceof FeatureLabelModelFacet) { stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_52); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_53); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_54); - stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_55); - stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_56); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); + stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_58); - stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_59); - stringBuffer.append(featureToSet.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_60); - stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); + stringBuffer.append(featureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_61); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_62); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); + stringBuffer.append(TEXT_63); if (ecoreFeature.isMany()) { - stringBuffer.append(TEXT_63); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_65); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_66); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); stringBuffer.append(TEXT_67); - stringBuffer.append(featureToSet.getAccessorName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); stringBuffer.append(TEXT_68); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); + stringBuffer.append(featureToSet.getAccessorName()); stringBuffer.append(TEXT_69); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_70); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); + stringBuffer.append(TEXT_71); } else { - stringBuffer.append(TEXT_71); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_72); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); + stringBuffer.append(TEXT_73); } - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_74); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); - stringBuffer.append(TEXT_74); - stringBuffer.append(metaFeatures.size()); stringBuffer.append(TEXT_75); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + stringBuffer.append(metaFeatures.size()); stringBuffer.append(TEXT_76); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_78); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); stringBuffer.append(TEXT_79); - stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_80); - stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_81); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_82); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_83); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_84); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_85); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_84); - if (i == 0) { - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_85); - } stringBuffer.append(TEXT_86); + if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_87); - stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); + } stringBuffer.append(TEXT_88); - stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); stringBuffer.append(TEXT_89); - stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); + stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_90); - stringBuffer.append(i); + stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); stringBuffer.append(TEXT_91); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.ParserUtil")); stringBuffer.append(TEXT_92); + stringBuffer.append(i); + stringBuffer.append(TEXT_93); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); + stringBuffer.append(TEXT_94); if (nextEcoreFeature.isMany()) { - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_95); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_96); } - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_98); stringBuffer.append(nextFeatureToSet.getAccessorName()); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_101); } else { - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_103); } } - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_104); } - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_105); } - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_106); if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) { - stringBuffer.append(TEXT_105); - stringBuffer.append(TEXT_106); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_107); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); stringBuffer.append(TEXT_108); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_109); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); stringBuffer.append(TEXT_110); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_111); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); stringBuffer.append(TEXT_112); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); stringBuffer.append(TEXT_113); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); stringBuffer.append(TEXT_114); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); + stringBuffer.append(TEXT_115); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(TEXT_116); } - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection")); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_120); final String alignment; LinkLabelAlignment genAlignment = genLabel.getAlignment(); @@ -656,18 +668,18 @@ if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanc } } - stringBuffer.append(TEXT_119); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_120); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator")); stringBuffer.append(TEXT_121); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); stringBuffer.append(TEXT_122); - stringBuffer.append(alignment); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator")); stringBuffer.append(TEXT_123); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator")); stringBuffer.append(TEXT_124); + stringBuffer.append(alignment); stringBuffer.append(TEXT_125); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); + stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_127); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ HashMap primitiveTypeToWrapperClassName = new HashMap(); @@ -711,14 +723,10 @@ if (labelModelFacet instanceof FeatureLabelModelFacet) { } } - stringBuffer.append(TEXT_126); - stringBuffer.append(viewPattern); - stringBuffer.append(TEXT_127); - stringBuffer.append(editPattern); stringBuffer.append(TEXT_128); - stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); + stringBuffer.append(viewPattern); stringBuffer.append(TEXT_129); - stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(editPattern); stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_131); @@ -726,76 +734,80 @@ if (labelModelFacet instanceof FeatureLabelModelFacet) { stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_133); + stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(TEXT_134); + stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); + stringBuffer.append(TEXT_135); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_136); myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_137); } - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_139); if (feature.isPrimitiveType()) { - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_140); stringBuffer.append(primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_141); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); if (feature.isPrimitiveType()) { - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_142); } - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_143); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_145); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); if (next.isPrimitiveType()) { - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_146); stringBuffer.append(primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_147); } myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); if (next.isPrimitiveType()) { - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_148); } if (it.hasNext()) { - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_149); } } - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_150); } else { - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_151); } - stringBuffer.append(TEXT_150); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_153); boolean isFixedFontSetInFigure; { @@ -803,126 +815,122 @@ boolean isFixedFontSetInFigure; isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_154); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_153); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_154); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_155); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_156); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_157); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(primaryView); stringBuffer.append(TEXT_158); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_159); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_161); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_162); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_164); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); + stringBuffer.append(TEXT_165); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(TEXT_166); } - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_167); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_169); } - stringBuffer.append(TEXT_168); - stringBuffer.append(TEXT_169); stringBuffer.append(TEXT_170); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_171); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_172); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_173); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_174); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(primaryView); stringBuffer.append(TEXT_175); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_178); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_179); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_180); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); + stringBuffer.append(TEXT_181); if (genLabel.isElementIcon()) { - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_184); } - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_185); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_186); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_188); if (genHost.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_192); } else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) { - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_197); } else { - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_198); } - stringBuffer.append(TEXT_197); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_198); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_200); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_201); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_202); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_203); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_204); @@ -930,36 +938,36 @@ if (genHost.getModelFacet() instanceof TypeLinkModelFacet) { stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_206); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_207); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_208); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_210); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_211); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_213); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_214); } } - stringBuffer.append(TEXT_213); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_214); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_215); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_217); @@ -967,35 +975,51 @@ if (labelModelFacet instanceof FeatureLabelModelFacet) { stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_219); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_220); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_221); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_222); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_223); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_224); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_226); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_227); } } - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_228); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_229); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_230); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_231); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_232); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_233); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")); + stringBuffer.append(TEXT_234); final Viewmap viewmap = genLabel.getViewmap(); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_235); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -1024,64 +1048,64 @@ if (viewmap instanceof InnerClassViewmap) { if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_236); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_237); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_238); } else { - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_239); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_240); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_241); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_242); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_243); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_244); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_245); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_246); } - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_248); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_249); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_250); } else { - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_251); } - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_252); } /*not parent-assigned*/ - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_253); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_254); } - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_255); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_256); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_257); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -1095,43 +1119,43 @@ if (viewmap instanceof ParentAssignedViewmap) { } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_258); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_260); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_261); } else { - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_262); } - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_263); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_264); stringBuffer.append(classBody); - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_265); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_266); } } - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_267); importManager.emitSortedImports(); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_268); return stringBuffer.toString(); } } diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java index e330ebecf..6aa019c53 100644 --- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java +++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java @@ -43,1142 +43,1085 @@ public class NodeEditPartGenerator protected final String TEXT_22 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; protected final String TEXT_23 = " extends "; protected final String TEXT_24 = " implements "; - protected final String TEXT_25 = ", IUpdatableEditPart {"; - protected final String TEXT_26 = NL; - protected final String TEXT_27 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_28 = ";"; - protected final String TEXT_29 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_30 = " contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_31 = " primaryShape;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_32 = "("; - protected final String TEXT_33 = " model) {" + NL + "\t\tassert model instanceof "; - protected final String TEXT_34 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL; - protected final String TEXT_35 = NL; - protected final String TEXT_36 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; - protected final String TEXT_37 = " view = ("; - protected final String TEXT_38 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; - protected final String TEXT_39 = " view = ("; - protected final String TEXT_40 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; - protected final String TEXT_41 = NL; - protected final String TEXT_42 = "\t\tinstallEditPolicy("; - protected final String TEXT_43 = ".COMPONENT_ROLE, new "; - protected final String TEXT_44 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_45 = " createDeleteCommand("; - protected final String TEXT_46 = " deleteRequest) {" + NL + "\t\t\t\t"; - protected final String TEXT_47 = " editingDomain = "; - protected final String TEXT_48 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_49 = " cc = new "; - protected final String TEXT_50 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; - protected final String TEXT_51 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand("; - protected final String TEXT_52 = " editingDomain) {"; - protected final String TEXT_53 = NL + "\t\t\t\t"; - protected final String TEXT_54 = " result = new "; - protected final String TEXT_55 = "();"; - protected final String TEXT_56 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_58 = ".eINSTANCE.get"; - protected final String TEXT_59 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_60 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_61 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_62 = ".eINSTANCE.get"; - protected final String TEXT_63 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_64 = ".UNSET_VALUE));"; - protected final String TEXT_65 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_66 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_67 = ".eINSTANCE.get"; - protected final String TEXT_68 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_69 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_70 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_71 = ".eINSTANCE.get"; - protected final String TEXT_72 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_73 = ".UNSET_VALUE));"; - protected final String TEXT_74 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_75 = NL + "\t\t\t\treturn "; - protected final String TEXT_76 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_77 = ".eINSTANCE.get"; - protected final String TEXT_78 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; - protected final String TEXT_79 = NL + "\t\t\t\treturn "; - protected final String TEXT_80 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_81 = ".eINSTANCE.get"; - protected final String TEXT_82 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_83 = ".UNSET_VALUE);"; - protected final String TEXT_84 = NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_85 = NL + "\t\tinstallEditPolicy("; - protected final String TEXT_86 = ".LAYOUT_ROLE, new "; - protected final String TEXT_87 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_88 = " getCreateCommand("; - protected final String TEXT_89 = " request) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_90 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_91 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_92 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_93 = " createChangeConstraintCommand("; - protected final String TEXT_94 = " child, Object constraint) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_95 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_96 = " createChildEditPolicy("; - protected final String TEXT_97 = " child) {" + NL + "\t\t\t\treturn new "; - protected final String TEXT_98 = "() {" + NL + "\t\t\t\t\tpublic "; - protected final String TEXT_99 = " getTargetEditPart("; - protected final String TEXT_100 = " request) {" + NL + "\t\t\t\t\t\tif ("; - protected final String TEXT_101 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_102 = ".this;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn super.getTargetEditPart(request);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallEditPolicy("; - protected final String TEXT_103 = ".GRAPHICAL_NODE_ROLE, new "; - protected final String TEXT_104 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_105 = " getReconnectTargetCommand("; - protected final String TEXT_106 = " request) {"; - protected final String TEXT_107 = " " + NL + "\t\t\t\treturn "; - protected final String TEXT_108 = ".INSTANCE;"; - protected final String TEXT_109 = NL + "\t\t\t\t"; - protected final String TEXT_110 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; - protected final String TEXT_111 = " == false) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_112 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_113 = " edge = ("; - protected final String TEXT_114 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; - protected final String TEXT_115 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; - protected final String TEXT_116 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_117 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_118 = " result = null;" + NL + "\t\t\t\tint visualID = "; - protected final String TEXT_119 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; - protected final String TEXT_120 = NL + "\t\t\t\tcase "; - protected final String TEXT_121 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; - protected final String TEXT_122 = "TargetCommand(request);" + NL + "\t\t\t\t\tbreak;"; - protected final String TEXT_123 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_124 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_125 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; - protected final String TEXT_126 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_127 = " getReconnectSourceCommand("; - protected final String TEXT_128 = " request) {"; - protected final String TEXT_129 = " " + NL + "\t\t\t\treturn "; - protected final String TEXT_130 = ".INSTANCE;"; - protected final String TEXT_131 = NL + "\t\t\t\t"; - protected final String TEXT_132 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; - protected final String TEXT_133 = " == false) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_134 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_135 = " edge = ("; - protected final String TEXT_136 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; - protected final String TEXT_137 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; - protected final String TEXT_138 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_139 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_140 = " result = null;" + NL + "\t\t\t\tint visualID = "; - protected final String TEXT_141 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; - protected final String TEXT_142 = NL + "\t\t\t\tcase "; - protected final String TEXT_143 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; - protected final String TEXT_144 = "SourceCommand(request);" + NL + "\t\t\t\t\tbreak;"; - protected final String TEXT_145 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_146 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_147 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; - protected final String TEXT_148 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_149 = " getConnectionCreateCommand("; - protected final String TEXT_150 = " request) {"; - protected final String TEXT_151 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_152 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_153 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_154 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_155 = " result = new "; - protected final String TEXT_156 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_157 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_158 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_159 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_160 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1 || !result.canExecute()) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\t//returning an unexecutable command does not change cursor to \"No\"." + NL + "\t\t\t\t\t\treturn null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_161 = " wrappedResult = new WrappingCommand("; - protected final String TEXT_162 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t\trequest.setStartCommand(wrappedResult);" + NL + "\t\t\t\t\treturn wrappedResult;" + NL + "\t\t\t\t}"; - protected final String TEXT_163 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_164 = " getConnectionCompleteCommand("; - protected final String TEXT_165 = " request) {"; - protected final String TEXT_166 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_167 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_168 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_169 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_170 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_171 = " result = new "; - protected final String TEXT_172 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_173 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_174 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_175 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_176 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_177 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_178 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_179 = NL + "\t\t\t\treturn "; - protected final String TEXT_180 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_181 = NL + "\t\tinstallLinkNotationModelRefresher();"; - protected final String TEXT_182 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_183 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_184 = " invisibleRectangle = new "; - protected final String TEXT_185 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; - protected final String TEXT_186 = "());" + NL + "\t\t"; - protected final String TEXT_187 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; - protected final String TEXT_188 = " decorationShape = createDecorationPane();" + NL + "\t\tif (decorationShape != null) {" + NL + "\t\t\tinvisibleRectangle.add(decorationShape);" + NL + "\t\t}" + NL + "" + NL + "\t\treturn invisibleRectangle;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_189 = " createNodeShape() {"; - protected final String TEXT_190 = NL + "\t\tprimaryShape = new "; - protected final String TEXT_191 = "()"; - protected final String TEXT_192 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_193 = ";"; - protected final String TEXT_194 = NL + "\t\tprimaryShape = "; - protected final String TEXT_195 = ";"; - protected final String TEXT_196 = NL + "\t\t"; - protected final String TEXT_197 = " figure = new "; - protected final String TEXT_198 = "();"; - protected final String TEXT_199 = NL + " \t\tfigure.setUseLocalCoordinates(true);"; - protected final String TEXT_200 = NL + " \t\tprimaryShape = figure;"; - protected final String TEXT_201 = NL + "\t\treturn primaryShape;" + NL + "\t}"; - protected final String TEXT_202 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_203 = " getPrimaryShape() {" + NL + "\t\treturn ("; - protected final String TEXT_204 = ") primaryShape;" + NL + "\t}"; - protected final String TEXT_205 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_206 = " createDecorationPane() {" + NL + "\t\t"; - protected final String TEXT_207 = " view = ("; - protected final String TEXT_208 = ") getModel();" + NL + "\t\t"; - protected final String TEXT_209 = " annotation = view.getEAnnotation(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\tif (annotation == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t"; - protected final String TEXT_210 = " decorationPane = new "; - protected final String TEXT_211 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; - protected final String TEXT_212 = "());" + NL + "" + NL + "\t\t"; - protected final String TEXT_213 = " imageFigure = new "; - protected final String TEXT_214 = "("; - protected final String TEXT_215 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; - protected final String TEXT_216 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; - protected final String TEXT_217 = ".BOTTOM);" + NL + " \t\treturn decorationPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Default implementation treats passed figure as content pane." + NL + "\t * Respects layout one may have set for generated figure." + NL + "\t * @param nodeShape instance of generated figure class" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_218 = " setupContentPane("; - protected final String TEXT_219 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; - protected final String TEXT_220 = NL + "\t\t\t"; - protected final String TEXT_221 = " layout = new "; - protected final String TEXT_222 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; - protected final String TEXT_223 = NL + "\t\tnodeShape.setLayoutManager(new "; - protected final String TEXT_224 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; - protected final String TEXT_225 = " figure) {" + NL + "\t\t\t\tObject result = constraints.get(figure);" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\tresult = new "; - protected final String TEXT_226 = "(0, 0, -1, -1);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_227 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" |