### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.codegen.lite Index: templates/providers/LinkViewFactory.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/providers/LinkViewFactory.javajet,v retrieving revision 1.1 diff -u -r1.1 LinkViewFactory.javajet --- templates/providers/LinkViewFactory.javajet 13 Apr 2006 21:20:16 -0000 1.1 +++ templates/providers/LinkViewFactory.javajet 1 Aug 2006 13:55:37 -0000 @@ -41,7 +41,6 @@ private static void create<%=label.getVisualID()%>Label(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view) { <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> label = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createNode(); view.getPersistedChildren().add(label); - label.setElement(null); <%=importManager.getImportedName(label.getNotationViewFactoryQualifiedClassName())%>.decorateView(label); } <% Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java,v retrieving revision 1.9 diff -u -r1.9 LinkEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java 4 Jul 2006 15:44:10 -0000 1.9 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java 1 Aug 2006 13:55:34 -0000 @@ -32,167 +32,173 @@ 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 + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!"; + protected final String TEXT_15 = ") getModel();" + NL + "\t}" + NL; protected final String TEXT_16 = NL; - protected final String TEXT_17 = "\t\tinstallEditPolicy("; - protected final String TEXT_18 = ".COMPONENT_ROLE, new "; - protected final String TEXT_19 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_20 = " createDeleteCommand("; - protected final String TEXT_21 = " 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_22 = " editingDomain = "; - protected final String TEXT_23 = ".getEditingDomain(getDiagramEdge().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_24 = " cc = new "; - protected final String TEXT_25 = "();" + NL + "\t\t\t\tcc.append(createDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(new "; - protected final String TEXT_26 = "() {" + 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_27 = NL; - protected final String TEXT_28 = NL + "\t\t\tprivate "; - protected final String TEXT_29 = " createDomainModelRemoveCommand("; - protected final String TEXT_30 = " editingDomain) {"; - protected final String TEXT_31 = NL + "\t\t\t\t"; - protected final String TEXT_32 = " result = new "; - protected final String TEXT_33 = "();"; - protected final String TEXT_34 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_35 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_36 = ".getElement().eContainer(), "; - protected final String TEXT_37 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_38 = ".getElement()));"; - protected final String TEXT_39 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_40 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_41 = ".getElement().eContainer(), "; - protected final String TEXT_42 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_43 = ".UNSET_VALUE));"; - protected final String TEXT_44 = NL + "\t\t\t\treturn "; - protected final String TEXT_45 = ".INSTANCE;"; - protected final String TEXT_46 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_48 = ".getElement().eContainer(), "; - protected final String TEXT_49 = ".eINSTANCE.get"; - protected final String TEXT_50 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_51 = ".getElement()));"; + 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 = ".UNSET_VALUE));"; + 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(), "; + protected final String TEXT_60 = ".getElement().eContainer(), "; protected final String TEXT_61 = ".eINSTANCE.get"; - protected final String TEXT_62 = "(), "; - protected final String TEXT_63 = ".getSource().getElement()));"; + 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 = ".UNSET_VALUE));"; + 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 = ".getTarget().getElement()));"; + 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 = ".UNSET_VALUE));"; - protected final String TEXT_82 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_83 = NL + "\t\t\t\treturn "; - protected final String TEXT_84 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_85 = ".getSource().getElement(), "; - protected final String TEXT_86 = ".eINSTANCE.get"; - protected final String TEXT_87 = "(), "; - protected final String TEXT_88 = ".getTarget().getElement());"; + 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 = ".UNSET_VALUE);"; - protected final String TEXT_95 = NL + "\t\t\t}"; - protected final String TEXT_96 = NL + "\t\t});" + NL + "\t\tinstallEditPolicy("; - protected final String TEXT_97 = ".CONNECTION_ENDPOINTS_ROLE, new "; - protected final String TEXT_98 = "());" + NL + "\t\tinstallEditPolicy("; - protected final String TEXT_99 = ".CONNECTION_BENDPOINTS_ROLE, new "; - protected final String TEXT_100 = "());" + NL + "\t}" + NL; - protected final String TEXT_101 = 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_102 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor("; - protected final String TEXT_103 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_104 = " nextChild = ("; - protected final String TEXT_105 = ")it.next();" + NL + "\t\t\tif ("; - protected final String TEXT_106 = ".getVisualID(nextChild) == "; - protected final String TEXT_107 = ".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_108 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_109 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; - protected final String TEXT_110 = " labelToEdit;" + NL + "\t\t\tif (req instanceof "; - protected final String TEXT_111 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart(("; - protected final String TEXT_112 = ")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_113 = " getLabelEditPart("; - protected final String TEXT_114 = " req) {" + NL + "\t\t"; - protected final String TEXT_115 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; - protected final String TEXT_116 = " view = ("; - protected final String TEXT_117 = ") result.getModel();" + NL + "\t\t\tif (getDiagramEdge().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; - protected final String TEXT_118 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; - protected final String TEXT_119 = NL + "\t\t\t\tcase "; - protected final String TEXT_120 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; - protected final String TEXT_121 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; - protected final String TEXT_122 = 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_123 = NL; - protected final String TEXT_124 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_125 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_126 = " feature, "; - protected final String TEXT_127 = " 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_128 = 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_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 DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends "; - protected final String TEXT_131 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_132 = " 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_133 = ") 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_134 = NL; - protected final String TEXT_135 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher("; - protected final String TEXT_136 = " 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_137 = " 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_138 = " 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_139 = NL; - protected final String TEXT_140 = "\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_141 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_142 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_143 = NL; - protected final String TEXT_144 = "\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_145 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; - protected final String TEXT_146 = NL; - protected final String TEXT_147 = "\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_148 = ".eINSTANCE.getEdge_Bendpoints(), bendpointsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_149 = ".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_150 = " bendpoints = ("; - protected final String TEXT_151 = ") getDiagramEdge().getBendpoints();" + NL + "\t\tif (bendpoints == null) {" + NL + "\t\t\tgetConnectionFigure().setRoutingConstraint("; - protected final String TEXT_152 = ".EMPTY_LIST);" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_153 = " modelConstraint = bendpoints.getPoints();" + NL + "\t\t"; - protected final String TEXT_154 = " figureConstraint = new "; - protected final String TEXT_155 = "();" + NL + "\t\tfor (int i = 0; i < modelConstraint.size(); i++) {" + NL + "\t\t\t"; - protected final String TEXT_156 = " wbp = ("; - protected final String TEXT_157 = ") modelConstraint.get(i);" + NL + "\t\t\t"; - protected final String TEXT_158 = " rbp = new "; - protected final String TEXT_159 = "(getConnectionFigure());" + NL + "\t\t\trbp.setRelativeDimensions(new "; - protected final String TEXT_160 = "(wbp.getSourceX(), wbp.getSourceY()), new "; - protected final String TEXT_161 = "(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_162 = "());" + 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 generated tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_163 = " createFigure() {"; - protected final String TEXT_164 = NL + "\t\treturn new "; - protected final String TEXT_165 = "();"; - protected final String TEXT_166 = NL + "\t\treturn "; - protected final String TEXT_167 = ";"; - protected final String TEXT_168 = NL + " \t\treturn new "; - protected final String TEXT_169 = "();"; - protected final String TEXT_170 = NL + "\t}" + NL; - protected final String TEXT_171 = NL; - protected final String TEXT_172 = NL; - protected final String TEXT_173 = 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_174 = NL + "}"; - protected final String TEXT_175 = 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 generated 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_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; public String generate(Object argument) { @@ -241,37 +247,47 @@ stringBuffer.append(TEXT_15); stringBuffer.append(TEXT_16); stringBuffer.append(TEXT_17); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_18); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_19); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_20); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_21); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_22); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_23); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_24); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); stringBuffer.append(TEXT_25); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_26); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); + stringBuffer.append(TEXT_27); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_28); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_29); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + 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(TEXT_32); { String _edge = "getDiagramEdge()"; - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_33); //input: _edge : String - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_35); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_36); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -298,188 +314,188 @@ } } - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_39); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_41); stringBuffer.append(_edge); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_42); stringBuffer.append(_edge); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_43); stringBuffer.append(_edge); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_44); } else { - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_46); stringBuffer.append(_edge); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_47); stringBuffer.append(_edge); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_49); } } else { - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_51); } if (removeChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_53); stringBuffer.append(_edge); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_55); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_56); stringBuffer.append(_edge); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_57); } else { - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_59); stringBuffer.append(_edge); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_61); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_63); } } if (removeSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_65); stringBuffer.append(_edge); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_67); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_68); stringBuffer.append(_edge); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_69); } else { - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_71); stringBuffer.append(_edge); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_73); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_75); } } if (removeTarget) { if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_77); stringBuffer.append(_edge); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_79); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_80); stringBuffer.append(_edge); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_81); } else { - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_83); stringBuffer.append(_edge); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_85); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_87); } } - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_88); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_90); stringBuffer.append(_edge); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_92); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_93); stringBuffer.append(_edge); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_94); } else { - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_96); stringBuffer.append(_edge); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_98); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_100); } } - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_101); } //local declarations - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_105); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + ".BendpointEditPolicy")); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_106); GenLinkLabel primaryLabel = null; for(Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) { @@ -491,41 +507,41 @@ } if (primaryLabel != null) { - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_108); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_124); for (Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) { GenLinkLabel genLabel = (GenLinkLabel) it.next(); @@ -533,93 +549,93 @@ continue; } - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_126); } - stringBuffer.append(TEXT_121); - -} //if (primaryLabel != null, i.e., there are editable labels) - - stringBuffer.append(TEXT_122); - stringBuffer.append(TEXT_123); - stringBuffer.append(TEXT_124); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_125); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_126); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_127); -if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - //Otherwise, there's no element associated with the element +} //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("org.eclipse.emf.common.notify.impl.AdapterImpl")); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_131); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_132); 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(TEXT_133); -} +if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + //Otherwise, there's no element associated with the element stringBuffer.append(TEXT_134); stringBuffer.append(TEXT_135); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_136); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); stringBuffer.append(TEXT_137); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + 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(TEXT_139); + +} + stringBuffer.append(TEXT_140); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_141); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + 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.gmf.runtime.notation.NotationPackage")); 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(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")); stringBuffer.append(TEXT_150); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_151); - stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_152); - stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_153); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_154); - stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_155); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")); stringBuffer.append(TEXT_156); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")); stringBuffer.append(TEXT_157); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint")); + stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_158); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_159); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_160); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); + stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); stringBuffer.append(TEXT_161); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BendpointConnectionRouter")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")); stringBuffer.append(TEXT_162); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + 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(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(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(TEXT_168); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(TEXT_169); Viewmap viewmap = genLink.getViewmap(); if (viewmap instanceof FigureViewmap) { @@ -629,41 +645,41 @@ figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection"; } - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_171); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_172); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_173); } // instanceof SnippetViewmap else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_174); stringBuffer.append(((InnerClassViewmap) viewmap).getClassName()); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_175); } - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_176); if (genLink.getViewmap() instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody(); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_177); stringBuffer.append(classBody); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_178); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_179); } } - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_180); importManager.emitSortedImports(); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_181); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java,v retrieving revision 1.7 diff -u -r1.7 NodeLabelEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java 3 Jul 2006 18:10:52 -0000 1.7 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java 1 Aug 2006 13:55:36 -0000 @@ -170,71 +170,73 @@ protected final String TEXT_150 = " imageDescriptor = "; protected final String TEXT_151 = ".getInstance().getItemImageDescriptor(element);" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; protected final String TEXT_152 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_153 = " resolveSemanticElement() {" + NL + "\t\tfor(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tView view = (View)editPart.getModel();" + NL + "\t\t\tif (view != null && view.getElement() != null) {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_154 = ") view.getElement();" + 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_155 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; - protected final String TEXT_156 = ") {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_157 = ") 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_158 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_159 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_160 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_162 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_164 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_165 = ".eINSTANCE.get"; - protected final String TEXT_166 = "(), labelRefresher);"; - protected final String TEXT_167 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_168 = ".eINSTANCE.get"; - protected final String TEXT_169 = "(), labelRefresher);"; - protected final String TEXT_170 = 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_171 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_172 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_175 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_177 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_178 = ".eINSTANCE.get"; - protected final String TEXT_179 = "(), labelRefresher);"; - protected final String TEXT_180 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_181 = ".eINSTANCE.get"; - protected final String TEXT_182 = "(), labelRefresher);"; - protected final String TEXT_183 = 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};"; - protected final String TEXT_184 = NL; - protected final String TEXT_185 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_186 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_187 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_188 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_189 = " createLabel() {"; - protected final String TEXT_190 = NL + "\t\treturn new "; - protected final String TEXT_191 = "();"; - protected final String TEXT_192 = NL + "\t\treturn "; - protected final String TEXT_193 = ";"; - protected final String TEXT_194 = NL + "\t\treturn new "; - protected final String TEXT_195 = "();"; - protected final String TEXT_196 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_197 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_198 = " label = createLabel();"; - protected final String TEXT_199 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_200 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_201 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_202 = NL + NL + "\t/**"; - protected final String TEXT_203 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_204 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_205 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_206 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_207 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_208 = "("; - protected final String TEXT_209 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_210 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_211 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_212 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_213 = NL; - protected final String TEXT_214 = NL; - protected final String TEXT_215 = 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_216 = NL + "}"; - protected final String TEXT_217 = NL; + protected final String TEXT_153 = " resolveSemanticElement() {" + NL + "\t\tView view = (View) getModel();" + NL + "\t\treturn (view.getElement() instanceof "; + protected final String TEXT_154 = ") ? ("; + protected final String TEXT_155 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_156 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; + protected final String TEXT_157 = ") {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_158 = ") 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_159 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_160 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_162 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_164 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_165 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_166 = ".eINSTANCE.get"; + protected final String TEXT_167 = "(), labelRefresher);"; + protected final String TEXT_168 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_169 = ".eINSTANCE.get"; + protected final String TEXT_170 = "(), labelRefresher);"; + protected final String TEXT_171 = 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_172 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_175 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_177 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_178 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_179 = ".eINSTANCE.get"; + protected final String TEXT_180 = "(), labelRefresher);"; + protected final String TEXT_181 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_182 = ".eINSTANCE.get"; + protected final String TEXT_183 = "(), labelRefresher);"; + protected final String TEXT_184 = 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};"; + protected final String TEXT_185 = NL; + protected final String TEXT_186 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_187 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_188 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_189 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_190 = " createLabel() {"; + protected final String TEXT_191 = NL + "\t\treturn new "; + protected final String TEXT_192 = "();"; + protected final String TEXT_193 = NL + "\t\treturn "; + protected final String TEXT_194 = ";"; + protected final String TEXT_195 = NL + "\t\treturn new "; + protected final String TEXT_196 = "();"; + protected final String TEXT_197 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_198 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_199 = " label = createLabel();"; + protected final String TEXT_200 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment("; + protected final String TEXT_201 = ".LEFT);"; + protected final String TEXT_202 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_203 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_204 = NL + NL + "\t/**"; + protected final String TEXT_205 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_206 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_207 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_208 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_209 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_210 = "("; + protected final String TEXT_211 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_212 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_213 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_214 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_215 = NL; + protected final String TEXT_216 = NL; + protected final String TEXT_217 = 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_218 = NL + "}"; + protected final String TEXT_219 = NL; public String generate(Object argument) { @@ -695,7 +697,7 @@ stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_154); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_156); @@ -703,7 +705,7 @@ stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_158); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_160); @@ -713,34 +715,34 @@ stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_163); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_164); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_164); - stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_165); - stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_166); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_167); } 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_167); - stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_168); - stringBuffer.append(next.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_169); + stringBuffer.append(next.getFeatureAccessorName()); + stringBuffer.append(TEXT_170); } } - stringBuffer.append(TEXT_170); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_171); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_172); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_173); @@ -750,35 +752,37 @@ stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_176); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_177); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_177); - stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_178); - stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_179); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_180); } 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_180); - stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_181); - stringBuffer.append(next.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_182); + stringBuffer.append(next.getFeatureAccessorName()); + stringBuffer.append(TEXT_183); } } - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_184); final Viewmap viewmap = genLabel.getViewmap(); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_185); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -807,64 +811,66 @@ if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_185); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_186); - stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_187); - } else { + stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); stringBuffer.append(TEXT_188); - stringBuffer.append(figureImportedName); + } else { stringBuffer.append(TEXT_189); + stringBuffer.append(figureImportedName); + stringBuffer.append(TEXT_190); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_190); - stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_191); + stringBuffer.append(figureImportedName); + stringBuffer.append(TEXT_192); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_192); - stringBuffer.append(((SnippetViewmap) viewmap).getBody()); stringBuffer.append(TEXT_193); + stringBuffer.append(((SnippetViewmap) viewmap).getBody()); + stringBuffer.append(TEXT_194); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_194); - stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_195); - } + stringBuffer.append(figureImportedName); stringBuffer.append(TEXT_196); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + } stringBuffer.append(TEXT_197); - stringBuffer.append(figureImportedName); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_198); + stringBuffer.append(figureImportedName); + stringBuffer.append(TEXT_199); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_200); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); + stringBuffer.append(TEXT_201); } else { - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_202); } - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_203); } /*not parent-assigned*/ - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_204); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_205); } - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_208); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -878,43 +884,43 @@ } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_209); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_211); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_212); } else { - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_213); } - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_214); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_215); stringBuffer.append(classBody); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_216); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_217); } } - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_218); importManager.emitSortedImports(); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_219); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java,v retrieving revision 1.5 diff -u -r1.5 CompartmentEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java 19 Jun 2006 19:14:13 -0000 1.5 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java 1 Aug 2006 13:55:33 -0000 @@ -88,202 +88,203 @@ protected final String TEXT_69 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; protected final String TEXT_70 = "());"; protected final String TEXT_71 = 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_72 = " resolveSemanticElement() {" + NL + "\t\tfor(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tView view = (View)editPart.getModel();" + NL + "\t\t\tif (view != null && view.getElement() != null) {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_73 = ") view.getElement();" + 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\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_74 = NL; - protected final String TEXT_75 = "\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_76 = " domainModelEditDomain = "; - protected final String TEXT_77 = ".getEditingDomain("; - protected final String TEXT_78 = ".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_79 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_80 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_81 = " 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_82 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; - protected final String TEXT_83 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

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_84 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_85 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_86 = 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_87 = NL + "\t\t\tfilter = "; - protected final String TEXT_88 = ".createFeatureFilter("; - protected final String TEXT_89 = ".eINSTANCE.get"; - protected final String TEXT_90 = "());"; - protected final String TEXT_91 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_92 = ".createFeatureFilter("; - protected final String TEXT_93 = ".eINSTANCE.get"; - protected final String TEXT_94 = "()));"; - protected final String TEXT_95 = NL + "\t\t\tfilter = filter.and("; - protected final String TEXT_96 = ".createNotifierFilter("; - protected final String TEXT_97 = "));"; - protected final String TEXT_98 = NL + "\t\t\tfilter = "; - protected final String TEXT_99 = ".createNotifierFilter("; - protected final String TEXT_100 = ");"; - protected final String TEXT_101 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; - protected final String TEXT_102 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_103 = " 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_104 = " transactionAboutToCommit("; - protected final String TEXT_105 = " 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_106 = " 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_107 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_108 = " domainModelEditDomain = "; - protected final String TEXT_109 = ".getEditingDomain("; - protected final String TEXT_110 = ".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_111 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_112 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; - protected final String TEXT_113 = " notationalChildren = "; - protected final String TEXT_114 = ".getChildren();" + NL + "\t\tfinal "; - protected final String TEXT_115 = " semanticToNotational = new "; - protected final String TEXT_116 = "();" + NL + "\t\tfor("; - protected final String TEXT_117 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_118 = " next = ("; - protected final String TEXT_119 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_120 = " 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_121 = " parentView = "; - protected final String TEXT_122 = ";" + NL + "\t\t"; - protected final String TEXT_123 = " command = new "; - protected final String TEXT_124 = "();" + NL + "\t\tfor("; - protected final String TEXT_125 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_126 = " next = ("; - protected final String TEXT_127 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_128 = " currentView = ("; - protected final String TEXT_129 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; - protected final String TEXT_130 = ".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_131 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; - protected final String TEXT_132 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_133 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_134 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_135 = " obsoleteView = ("; - protected final String TEXT_136 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_137 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; - protected final String TEXT_138 = " getCreateNotationalElementCommand("; - protected final String TEXT_139 = " parentView, "; - protected final String TEXT_140 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; - protected final String TEXT_141 = NL + "\t\tcase "; - protected final String TEXT_142 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; - protected final String TEXT_143 = ") {" + NL + "\t\t\t\treturn new Create"; - protected final String TEXT_144 = "NotationCommand(parentView, domainElement"; - protected final String TEXT_145 = ", new Rectangle(0, 0, 0, 0)"; - protected final String TEXT_146 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; - protected final String TEXT_147 = 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_148 = " getSemanticChildren() {"; - protected final String TEXT_149 = NL; - protected final String TEXT_150 = NL + "\treturn "; - protected final String TEXT_151 = ".EMPTY_LIST;"; - protected final String TEXT_152 = NL + "\t"; - protected final String TEXT_153 = " result = new "; - protected final String TEXT_154 = "();"; - protected final String TEXT_155 = NL + "\t"; - protected final String TEXT_156 = " viewObject = "; - protected final String TEXT_157 = ";" + NL + "\t"; - protected final String TEXT_158 = " modelObject = "; - protected final String TEXT_159 = ";" + NL + "\t"; - protected final String TEXT_160 = " nextValue;" + NL + "\tint nodeVID;"; - protected final String TEXT_161 = NL + "\tfor("; - protected final String TEXT_162 = " it = (("; - protected final String TEXT_163 = ")modelObject)."; - protected final String TEXT_164 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_165 = ") it.next();"; - protected final String TEXT_166 = NL + "\tnextValue = (("; - protected final String TEXT_167 = ")modelObject)."; - protected final String TEXT_168 = "();"; - protected final String TEXT_169 = NL + "\tnodeVID = "; - protected final String TEXT_170 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; - protected final String TEXT_171 = NL + "\tswitch (nodeVID) {"; - protected final String TEXT_172 = NL + "\tcase "; - protected final String TEXT_173 = ".VISUAL_ID: {"; - protected final String TEXT_174 = NL + "\tif ("; - protected final String TEXT_175 = ".VISUAL_ID == nodeVID) {"; - protected final String TEXT_176 = NL + "\t\tresult.add(nextValue);"; - protected final String TEXT_177 = NL + "\t\tbreak;" + NL + "\t\t}"; - protected final String TEXT_178 = NL + "\t\t}"; - protected final String TEXT_179 = NL + "\t}"; + protected final String TEXT_72 = " resolveSemanticElement() {" + NL + "\t\tView view = getDiagramNode();" + NL + "\t\treturn (view.getElement() instanceof "; + protected final String TEXT_73 = ") ? ("; + protected final String TEXT_74 = ") 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_75 = NL; + protected final String TEXT_76 = "\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_77 = " domainModelEditDomain = "; + protected final String TEXT_78 = ".getEditingDomain("; + protected final String TEXT_79 = ".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_80 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_81 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_82 = " 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_83 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; + protected final String TEXT_84 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

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_85 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_86 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_87 = 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_88 = NL + "\t\t\tfilter = "; + protected final String TEXT_89 = ".createFeatureFilter("; + protected final String TEXT_90 = ".eINSTANCE.get"; + protected final String TEXT_91 = "());"; + protected final String TEXT_92 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_93 = ".createFeatureFilter("; + protected final String TEXT_94 = ".eINSTANCE.get"; + protected final String TEXT_95 = "()));"; + protected final String TEXT_96 = NL + "\t\t\tfilter = filter.and("; + protected final String TEXT_97 = ".createNotifierFilter("; + protected final String TEXT_98 = "));"; + protected final String TEXT_99 = NL + "\t\t\tfilter = "; + protected final String TEXT_100 = ".createNotifierFilter("; + protected final String TEXT_101 = ");"; + protected final String TEXT_102 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; + protected final String TEXT_103 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_104 = " 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_105 = " transactionAboutToCommit("; + protected final String TEXT_106 = " 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_107 = " 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_108 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_109 = " domainModelEditDomain = "; + protected final String TEXT_110 = ".getEditingDomain("; + protected final String TEXT_111 = ".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_112 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_113 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; + protected final String TEXT_114 = " notationalChildren = "; + protected final String TEXT_115 = ".getChildren();" + NL + "\t\tfinal "; + protected final String TEXT_116 = " semanticToNotational = new "; + protected final String TEXT_117 = "();" + NL + "\t\tfor("; + protected final String TEXT_118 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_119 = " next = ("; + protected final String TEXT_120 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_121 = " 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_122 = " parentView = "; + protected final String TEXT_123 = ";" + NL + "\t\t"; + protected final String TEXT_124 = " command = new "; + protected final String TEXT_125 = "();" + NL + "\t\tfor("; + protected final String TEXT_126 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_127 = " next = ("; + protected final String TEXT_128 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_129 = " currentView = ("; + protected final String TEXT_130 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; + protected final String TEXT_131 = ".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_132 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; + protected final String TEXT_133 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_134 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_135 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_136 = " obsoleteView = ("; + protected final String TEXT_137 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_138 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; + protected final String TEXT_139 = " getCreateNotationalElementCommand("; + protected final String TEXT_140 = " parentView, "; + protected final String TEXT_141 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; + protected final String TEXT_142 = NL + "\t\tcase "; + protected final String TEXT_143 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; + protected final String TEXT_144 = ") {" + NL + "\t\t\t\treturn new Create"; + protected final String TEXT_145 = "NotationCommand(parentView, domainElement"; + protected final String TEXT_146 = ", new Rectangle(0, 0, 0, 0)"; + protected final String TEXT_147 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; + protected final String TEXT_148 = 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_149 = " getSemanticChildren() {"; + protected final String TEXT_150 = NL; + protected final String TEXT_151 = NL + "\treturn "; + protected final String TEXT_152 = ".EMPTY_LIST;"; + protected final String TEXT_153 = NL + "\t"; + protected final String TEXT_154 = " result = new "; + protected final String TEXT_155 = "();"; + protected final String TEXT_156 = NL + "\t"; + protected final String TEXT_157 = " viewObject = "; + protected final String TEXT_158 = ";" + NL + "\t"; + protected final String TEXT_159 = " modelObject = "; + protected final String TEXT_160 = ";" + NL + "\t"; + protected final String TEXT_161 = " nextValue;" + NL + "\tint nodeVID;"; + protected final String TEXT_162 = NL + "\tfor("; + protected final String TEXT_163 = " it = (("; + protected final String TEXT_164 = ")modelObject)."; + protected final String TEXT_165 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_166 = ") it.next();"; + protected final String TEXT_167 = NL + "\tnextValue = (("; + protected final String TEXT_168 = ")modelObject)."; + protected final String TEXT_169 = "();"; + protected final String TEXT_170 = NL + "\tnodeVID = "; + protected final String TEXT_171 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; + protected final String TEXT_172 = NL + "\tswitch (nodeVID) {"; + protected final String TEXT_173 = NL + "\tcase "; + protected final String TEXT_174 = ".VISUAL_ID: {"; + protected final String TEXT_175 = NL + "\tif ("; + protected final String TEXT_176 = ".VISUAL_ID == nodeVID) {"; + protected final String TEXT_177 = NL + "\t\tresult.add(nextValue);"; + protected final String TEXT_178 = NL + "\t\tbreak;" + NL + "\t\t}"; + protected final String TEXT_179 = NL + "\t\t}"; protected final String TEXT_180 = NL + "\t}"; - protected final String TEXT_181 = NL + "\treturn result;"; - protected final String TEXT_182 = 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_183 = ". " + 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_184 = ";" + NL + "\t}"; - protected final String TEXT_185 = NL; + protected final String TEXT_181 = NL + "\t}"; + protected final String TEXT_182 = NL + "\treturn result;"; + protected final String TEXT_183 = 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_184 = ". " + 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_185 = ";" + NL + "\t}"; protected final String TEXT_186 = NL; - protected final String TEXT_187 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_188 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_189 = " feature, "; - protected final String TEXT_190 = " 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_191 = NL; - protected final String TEXT_192 = "\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_193 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_194 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_195 = NL; - protected final String TEXT_196 = "\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_197 = ".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_198 = NL; - protected final String TEXT_199 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_200 = "static "; - protected final String TEXT_201 = "class Create"; - protected final String TEXT_202 = "NotationCommand extends "; - protected final String TEXT_203 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; - protected final String TEXT_204 = "NotationCommand("; - protected final String TEXT_205 = " parent, " + NL + "\t\t\t\t"; - protected final String TEXT_206 = " domainElement"; - protected final String TEXT_207 = ", "; - protected final String TEXT_208 = " constraint"; - protected final String TEXT_209 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; - protected final String TEXT_210 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; - protected final String TEXT_211 = ".decorateView(createdNode);"; - protected final String TEXT_212 = NL + "\t\t\t"; - protected final String TEXT_213 = " bounds = "; - protected final String TEXT_214 = ".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_215 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; - protected final String TEXT_216 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; - protected final String TEXT_217 = "));"; - protected final String TEXT_218 = NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_219 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_220 = "static "; - protected final String TEXT_221 = "class Create"; - protected final String TEXT_222 = "Command extends "; - protected final String TEXT_223 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; - protected final String TEXT_224 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_225 = "Command("; - protected final String TEXT_226 = " parent, "; - protected final String TEXT_227 = ".CreateRequestEx request"; - protected final String TEXT_228 = ", "; - protected final String TEXT_229 = " constraint"; - protected final String TEXT_230 = ") {" + NL + "\t\t\t"; - protected final String TEXT_231 = " domainModelEditDomain = "; - protected final String TEXT_232 = ".getEditingDomain(parent.getDiagram().getElement());"; - protected final String TEXT_233 = NL + "\t\t\t"; - protected final String TEXT_234 = " createdDomainElement = "; - protected final String TEXT_235 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; - protected final String TEXT_236 = ".eINSTANCE.get"; - protected final String TEXT_237 = "());"; - protected final String TEXT_238 = NL + "\t\t\t"; - protected final String TEXT_239 = " createdDomainElement = "; - protected final String TEXT_240 = ".eINSTANCE.create"; - protected final String TEXT_241 = "();"; - protected final String TEXT_242 = NL + "\t\t\t"; + protected final String TEXT_187 = NL; + protected final String TEXT_188 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_189 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_190 = " feature, "; + protected final String TEXT_191 = " 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_192 = NL; + protected final String TEXT_193 = "\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_194 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_195 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_196 = NL; + protected final String TEXT_197 = "\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_198 = ".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_199 = NL; + protected final String TEXT_200 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_201 = "static "; + protected final String TEXT_202 = "class Create"; + protected final String TEXT_203 = "NotationCommand extends "; + protected final String TEXT_204 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; + protected final String TEXT_205 = "NotationCommand("; + protected final String TEXT_206 = " parent, " + NL + "\t\t\t\t"; + protected final String TEXT_207 = " domainElement"; + protected final String TEXT_208 = ", "; + protected final String TEXT_209 = " constraint"; + protected final String TEXT_210 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; + protected final String TEXT_211 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; + protected final String TEXT_212 = ".decorateView(createdNode);"; + protected final String TEXT_213 = NL + "\t\t\t"; + protected final String TEXT_214 = " bounds = "; + protected final String TEXT_215 = ".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_216 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; + protected final String TEXT_217 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; + protected final String TEXT_218 = "));"; + protected final String TEXT_219 = NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_220 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_221 = "static "; + protected final String TEXT_222 = "class Create"; + protected final String TEXT_223 = "Command extends "; + protected final String TEXT_224 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; + protected final String TEXT_225 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_226 = "Command("; + protected final String TEXT_227 = " parent, "; + protected final String TEXT_228 = ".CreateRequestEx request"; + protected final String TEXT_229 = ", "; + protected final String TEXT_230 = " constraint"; + protected final String TEXT_231 = ") {" + NL + "\t\t\t"; + protected final String TEXT_232 = " domainModelEditDomain = "; + protected final String TEXT_233 = ".getEditingDomain(parent.getDiagram().getElement());"; + protected final String TEXT_234 = NL + "\t\t\t"; + protected final String TEXT_235 = " createdDomainElement = "; + protected final String TEXT_236 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; + protected final String TEXT_237 = ".eINSTANCE.get"; + protected final String TEXT_238 = "());"; + protected final String TEXT_239 = NL + "\t\t\t"; + protected final String TEXT_240 = " createdDomainElement = "; + protected final String TEXT_241 = ".eINSTANCE.create"; + protected final String TEXT_242 = "();"; protected final String TEXT_243 = NL + "\t\t\t"; - protected final String TEXT_244 = "."; - protected final String TEXT_245 = ".initializeElement(createdDomainElement);"; - protected final String TEXT_246 = NL + "\t\t\t"; - protected final String TEXT_247 = " compoundCommand = new "; - protected final String TEXT_248 = "();" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_249 = ".create(domainModelEditDomain, "; - protected final String TEXT_250 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_251 = ".eINSTANCE.get"; - protected final String TEXT_252 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_253 = ".create(domainModelEditDomain, "; - protected final String TEXT_254 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_255 = ".eINSTANCE.get"; - protected final String TEXT_256 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; - protected final String TEXT_257 = NL + "\t\t\tthis.domainModelAddCommand = "; - protected final String TEXT_258 = ".create(domainModelEditDomain, "; - protected final String TEXT_259 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_260 = ".eINSTANCE.get"; - protected final String TEXT_261 = "(), createdDomainElement);"; - protected final String TEXT_262 = NL + "\t\t\tthis.notationAddCommand = new Create"; - protected final String TEXT_263 = "NotationCommand(parent, createdDomainElement"; - protected final String TEXT_264 = ", constraint"; - protected final String TEXT_265 = ");" + 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_266 = NL + "}" + NL; - protected final String TEXT_267 = NL; + protected final String TEXT_244 = NL + "\t\t\t"; + protected final String TEXT_245 = "."; + protected final String TEXT_246 = ".initializeElement(createdDomainElement);"; + protected final String TEXT_247 = NL + "\t\t\t"; + protected final String TEXT_248 = " compoundCommand = new "; + protected final String TEXT_249 = "();" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_250 = ".create(domainModelEditDomain, "; + protected final String TEXT_251 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_252 = ".eINSTANCE.get"; + protected final String TEXT_253 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_254 = ".create(domainModelEditDomain, "; + protected final String TEXT_255 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_256 = ".eINSTANCE.get"; + protected final String TEXT_257 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; + protected final String TEXT_258 = NL + "\t\t\tthis.domainModelAddCommand = "; + protected final String TEXT_259 = ".create(domainModelEditDomain, "; + protected final String TEXT_260 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_261 = ".eINSTANCE.get"; + protected final String TEXT_262 = "(), createdDomainElement);"; + protected final String TEXT_263 = NL + "\t\t\tthis.notationAddCommand = new Create"; + protected final String TEXT_264 = "NotationCommand(parent, createdDomainElement"; + protected final String TEXT_265 = ", constraint"; + protected final String TEXT_266 = ");" + 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_267 = NL + "}" + NL; + protected final String TEXT_268 = NL; public String generate(Object argument) { @@ -460,6 +461,8 @@ stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_73); + stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_74); { String _getViewCode = "getDiagramNode()"; @@ -467,20 +470,20 @@ String _getSemanticElementCode = "resolveSemanticElement()"; boolean isListLayout = genCompartment.isListLayout(); - stringBuffer.append(TEXT_74); stringBuffer.append(TEXT_75); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_76); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_77); - stringBuffer.append(_getDiagramCode); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_78); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); + stringBuffer.append(_getDiagramCode); stringBuffer.append(TEXT_79); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); stringBuffer.append(TEXT_80); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_81); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_82); boolean hasConstraintsInChildren = false; for (Iterator it = childNodes.iterator(); it.hasNext(); ) { @@ -495,158 +498,160 @@ if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_82); - stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); stringBuffer.append(TEXT_83); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_85); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_86); } - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_87); -boolean hasDeclaredFilter = false; -Set genChildFeatures = new LinkedHashSet(); -for (Iterator it = childNodes.iterator(); it.hasNext(); ) { - GenNode nextNode = (GenNode) it.next(); - TypeModelFacet typeModelFacet = nextNode.getModelFacet(); - if (typeModelFacet == null) { - continue; - } - GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature(); - if (genChildFeatures.contains(childMetaFeature)) { - continue; - } - genChildFeatures.add(childMetaFeature); - if (!hasDeclaredFilter) { - hasDeclaredFilter = true; +{ + boolean hasDeclaredFilter = false; + Set genChildFeatures = new LinkedHashSet(); + for (Iterator it = childNodes.iterator(); it.hasNext(); ) { + GenNode nextNode = (GenNode) it.next(); + TypeModelFacet typeModelFacet = nextNode.getModelFacet(); + if (typeModelFacet == null) { + continue; + } + GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature(); + if (genChildFeatures.contains(childMetaFeature)) { + continue; + } + genChildFeatures.add(childMetaFeature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; - stringBuffer.append(TEXT_87); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_88); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_89); - stringBuffer.append(childMetaFeature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_90); + stringBuffer.append(childMetaFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_91); - } else { + } else { - stringBuffer.append(TEXT_91); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_92); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_93); - stringBuffer.append(childMetaFeature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_94); + stringBuffer.append(childMetaFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_95); - } -} //for + } + } //for -if (hasDeclaredFilter) { + if (hasDeclaredFilter) { - stringBuffer.append(TEXT_95); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_96); - stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_97); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_98); -} else { + } else { - stringBuffer.append(TEXT_98); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_99); - stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_100); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_101); -} + } +} //local declaration of hasDeclaredFilter if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_102); } - stringBuffer.append(TEXT_102); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_103); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_104); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_105); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); stringBuffer.append(TEXT_106); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_107); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_108); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_109); - stringBuffer.append(_getDiagramCode); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_110); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(_getDiagramCode); stringBuffer.append(TEXT_111); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_113); - stringBuffer.append(_getViewCode); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_114); - stringBuffer.append(importManager.getImportedName("java.util.Map")); + stringBuffer.append(_getViewCode); stringBuffer.append(TEXT_115); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(importManager.getImportedName("java.util.Map")); stringBuffer.append(TEXT_116); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_117); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_119); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_120); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_121); - stringBuffer.append(_getViewCode); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_122); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(_getViewCode); stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_124); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_125); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_127); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_128); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_129); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_131); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_132); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); stringBuffer.append(TEXT_133); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); stringBuffer.append(TEXT_134); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_136); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_137); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand")); stringBuffer.append(TEXT_138); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); stringBuffer.append(TEXT_139); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_140); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_141); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); @@ -656,39 +661,39 @@ } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); - stringBuffer.append(TEXT_141); - stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_142); - stringBuffer.append(childNodeInterfaceName); + stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_143); + stringBuffer.append(childNodeInterfaceName); + stringBuffer.append(TEXT_144); stringBuffer.append(nextNode.getDomainMetaClass().getName()); stringBuffer.append(nextNode.getVisualID()); - stringBuffer.append(TEXT_144); - if (!isListLayout) { stringBuffer.append(TEXT_145); - } + if (!isListLayout) { stringBuffer.append(TEXT_146); + } + stringBuffer.append(TEXT_147); } - stringBuffer.append(TEXT_147); - stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_148); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_150); if (childNodes.size() == 0) { - stringBuffer.append(TEXT_150); - stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_151); + stringBuffer.append(importManager.getImportedName("java.util.Collections")); + stringBuffer.append(TEXT_152); } else { - stringBuffer.append(TEXT_152); - stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_153); - stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_154); + stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(TEXT_155); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { @@ -706,17 +711,17 @@ Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { - stringBuffer.append(TEXT_155); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_156); - stringBuffer.append(_getViewCode); + 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(_getViewCode); stringBuffer.append(TEXT_158); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_159); + stringBuffer.append(_getSemanticElementCode); stringBuffer.append(TEXT_160); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_161); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { @@ -725,107 +730,107 @@ Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_161); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_162); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_163); - stringBuffer.append(childMetaFeature.getGetAccessor()); + stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_164); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(childMetaFeature.getGetAccessor()); stringBuffer.append(TEXT_165); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_166); } else { - stringBuffer.append(TEXT_166); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_167); - stringBuffer.append(childMetaFeature.getGetAccessor()); + stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_168); + stringBuffer.append(childMetaFeature.getGetAccessor()); + stringBuffer.append(TEXT_169); } - stringBuffer.append(TEXT_169); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_170); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_171); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_172); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { - stringBuffer.append(TEXT_172); - stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_173); + stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_174); } else { - stringBuffer.append(TEXT_174); - stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_175); + stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_176); } - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_177); if (generateSwitch) { - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_178); } else { - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_179); } } if (generateSwitch) { - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_180); } if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_181); } } - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_182); } - stringBuffer.append(TEXT_182); - stringBuffer.append(genDiagram.isSynchronized()); stringBuffer.append(TEXT_183); stringBuffer.append(genDiagram.isSynchronized()); stringBuffer.append(TEXT_184); + stringBuffer.append(genDiagram.isSynchronized()); + stringBuffer.append(TEXT_185); } - stringBuffer.append(TEXT_185); stringBuffer.append(TEXT_186); stringBuffer.append(TEXT_187); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_188); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_189); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_190); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_191); stringBuffer.append(TEXT_192); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_194); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_195); stringBuffer.append(TEXT_196); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_197); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_198); for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { GenChildNode next = (GenChildNode)it.next(); @@ -833,42 +838,42 @@ boolean isListLayout = genCompartment.isListLayout(); String resolvedSemanticElement = "resolveSemanticElement()"; - stringBuffer.append(TEXT_198); stringBuffer.append(TEXT_199); - if (isStatic) { stringBuffer.append(TEXT_200); - } + if (isStatic) { stringBuffer.append(TEXT_201); + } + stringBuffer.append(TEXT_202); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_202); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); stringBuffer.append(TEXT_203); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); + stringBuffer.append(TEXT_204); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_204); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_205); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_206); - if (!isListLayout) { + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_207); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + if (!isListLayout) { stringBuffer.append(TEXT_208); - } + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_209); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); + } stringBuffer.append(TEXT_210); - stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); stringBuffer.append(TEXT_211); + stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); + stringBuffer.append(TEXT_212); if (!isListLayout) { - stringBuffer.append(TEXT_212); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_213); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_214); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); + stringBuffer.append(TEXT_215); int defaultWidth = 40; int defaultHeight = 40; @@ -878,140 +883,140 @@ defaultHeight = defSizeAttrs.getHeight(); } - stringBuffer.append(TEXT_215); - stringBuffer.append(defaultWidth); stringBuffer.append(TEXT_216); - stringBuffer.append(defaultHeight); + stringBuffer.append(defaultWidth); stringBuffer.append(TEXT_217); + stringBuffer.append(defaultHeight); + stringBuffer.append(TEXT_218); } - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_219); if (genDiagram.getPalette() != null) { - stringBuffer.append(TEXT_219); - if (isStatic) { stringBuffer.append(TEXT_220); - } + if (isStatic) { stringBuffer.append(TEXT_221); - stringBuffer.append(next.getDomainMetaClass().getName()); - stringBuffer.append(next.getVisualID()); + } stringBuffer.append(TEXT_222); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_223); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); + stringBuffer.append(TEXT_223); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); stringBuffer.append(TEXT_224); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); stringBuffer.append(TEXT_225); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(next.getDomainMetaClass().getName()); + stringBuffer.append(next.getVisualID()); stringBuffer.append(TEXT_226); - stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_227); - if (!isListLayout) { + stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); stringBuffer.append(TEXT_228); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + if (!isListLayout) { stringBuffer.append(TEXT_229); - } + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_230); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + } stringBuffer.append(TEXT_231); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_232); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_233); if (next.getDomainMetaClass().isMapEntry()) { /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ - stringBuffer.append(TEXT_233); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_234); - stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_235); - stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); stringBuffer.append(TEXT_236); - stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); + stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_237); + stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); + stringBuffer.append(TEXT_238); } else { - stringBuffer.append(TEXT_238); - stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_239); - stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); + stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); stringBuffer.append(TEXT_240); - stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); + stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); stringBuffer.append(TEXT_241); + stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); + stringBuffer.append(TEXT_242); } - stringBuffer.append(TEXT_242); - /*XXX: Class name DomainElementInitializer should be user-customizable*/ stringBuffer.append(TEXT_243); - stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); + /*XXX: Class name DomainElementInitializer should be user-customizable*/ stringBuffer.append(TEXT_244); - stringBuffer.append(next.getUniqueIdentifier()); + stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); stringBuffer.append(TEXT_245); + stringBuffer.append(next.getUniqueIdentifier()); + stringBuffer.append(TEXT_246); TypeModelFacet facet = next.getModelFacet(); GenFeature childFeature = facet.getChildMetaFeature(); GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_246); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_248); - stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_249); - stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_250); - stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_251); - stringBuffer.append(containmentFeature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_252); - stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); + stringBuffer.append(containmentFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_253); - stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_254); - stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_255); - stringBuffer.append(childFeature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_256); + stringBuffer.append(childFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_257); } else { - stringBuffer.append(TEXT_257); - stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_258); - stringBuffer.append(resolvedSemanticElement); + stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); stringBuffer.append(TEXT_259); - stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(resolvedSemanticElement); stringBuffer.append(TEXT_260); - stringBuffer.append(containmentFeature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_261); + stringBuffer.append(containmentFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_262); } - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_263); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_263); - if(!isListLayout) { stringBuffer.append(TEXT_264); - } + if(!isListLayout) { stringBuffer.append(TEXT_265); + } + stringBuffer.append(TEXT_266); } } - stringBuffer.append(TEXT_266); - importManager.emitSortedImports(); stringBuffer.append(TEXT_267); + importManager.emitSortedImports(); + stringBuffer.append(TEXT_268); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java,v retrieving revision 1.5 diff -u -r1.5 DiagramEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java 19 Jun 2006 19:14:13 -0000 1.5 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java 1 Aug 2006 13:55:34 -0000 @@ -28,238 +28,505 @@ protected final String TEXT_9 = "("; protected final String TEXT_10 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; protected final String TEXT_11 = " getDiagram() {" + NL + "\t\treturn ("; - protected final String TEXT_12 = ") getModel();" + 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_13 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_14 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_15 = ".CreateRequestEx requestEx = ("; - protected final String TEXT_16 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_17 = " result = new "; - protected final String TEXT_18 = "();" + 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_19 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_20 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_21 = "Command(getDiagram(), requestEx, ("; - protected final String TEXT_22 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_23 = 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_24 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_25 = 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_26 = " emfCommand = new "; - protected final String TEXT_27 = "(\"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_28 = " original = new "; - protected final String TEXT_29 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_30 = " 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_31 = ".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();" + 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_32 = ".class == key) {" + NL + "\t\t\treturn new "; - protected final String TEXT_33 = "(this);" + NL + "\t\t}"; - protected final String TEXT_34 = 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_35 = NL; - protected final String TEXT_36 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_37 = "static "; - protected final String TEXT_38 = "class Create"; - protected final String TEXT_39 = "NotationCommand extends "; - protected final String TEXT_40 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; - protected final String TEXT_41 = "NotationCommand("; - protected final String TEXT_42 = " parent, " + NL + "\t\t\t\t"; - protected final String TEXT_43 = " domainElement"; - protected final String TEXT_44 = ", "; - protected final String TEXT_45 = " constraint"; - protected final String TEXT_46 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; - protected final String TEXT_47 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; - protected final String TEXT_48 = ".decorateView(createdNode);"; - protected final String TEXT_49 = NL + "\t\t\t"; - protected final String TEXT_50 = " bounds = "; - protected final String TEXT_51 = ".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_52 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; - protected final String TEXT_53 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; - protected final String TEXT_54 = "));"; - protected final String TEXT_55 = NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_56 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_57 = "static "; - protected final String TEXT_58 = "class Create"; - protected final String TEXT_59 = "Command extends "; - protected final String TEXT_60 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; - protected final String TEXT_61 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_62 = "Command("; - protected final String TEXT_63 = " parent, "; - protected final String TEXT_64 = ".CreateRequestEx request"; - protected final String TEXT_65 = ", "; - protected final String TEXT_66 = " constraint"; - protected final String TEXT_67 = ") {" + NL + "\t\t\t"; - protected final String TEXT_68 = " domainModelEditDomain = "; - protected final String TEXT_69 = ".getEditingDomain(parent.getDiagram().getElement());"; - protected final String TEXT_70 = NL + "\t\t\t"; - protected final String TEXT_71 = " createdDomainElement = "; - protected final String TEXT_72 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; - protected final String TEXT_73 = ".eINSTANCE.get"; - protected final String TEXT_74 = "());"; - protected final String TEXT_75 = NL + "\t\t\t"; - protected final String TEXT_76 = " createdDomainElement = "; - protected final String TEXT_77 = ".eINSTANCE.create"; - protected final String TEXT_78 = "();"; - protected final String TEXT_79 = NL + "\t\t\t"; - protected final String TEXT_80 = NL + "\t\t\t"; - protected final String TEXT_81 = "."; - protected final String TEXT_82 = ".initializeElement(createdDomainElement);"; + protected final String TEXT_12 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_13 = NL; + protected final String TEXT_14 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; + protected final String TEXT_15 = " view = ("; + protected final String TEXT_16 = ") 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_17 = " view = ("; + protected final String TEXT_18 = ") 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_19 = NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_20 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_21 = ".CreateRequestEx requestEx = ("; + protected final String TEXT_22 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_23 = " result = new "; + protected final String TEXT_24 = "();" + 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_25 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_26 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_27 = "Command(getDiagram(), requestEx, ("; + protected final String TEXT_28 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_29 = 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_30 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_31 = 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_32 = " emfCommand = new "; + protected final String TEXT_33 = "(\"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_34 = " original = new "; + protected final String TEXT_35 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_36 = " 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_37 = ".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_38 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_39 = 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_40 = ".class == key) {" + NL + "\t\t\treturn new "; + protected final String TEXT_41 = "(this);" + NL + "\t\t}"; + protected final String TEXT_42 = 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_43 = NL; + protected final String TEXT_44 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_45 = "static "; + protected final String TEXT_46 = "class Create"; + protected final String TEXT_47 = "NotationCommand extends "; + protected final String TEXT_48 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; + protected final String TEXT_49 = "NotationCommand("; + protected final String TEXT_50 = " parent, " + NL + "\t\t\t\t"; + protected final String TEXT_51 = " domainElement"; + protected final String TEXT_52 = ", "; + protected final String TEXT_53 = " constraint"; + protected final String TEXT_54 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; + protected final String TEXT_55 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; + protected final String TEXT_56 = ".decorateView(createdNode);"; + protected final String TEXT_57 = NL + "\t\t\t"; + protected final String TEXT_58 = " bounds = "; + protected final String TEXT_59 = ".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_60 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; + protected final String TEXT_61 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; + protected final String TEXT_62 = "));"; + protected final String TEXT_63 = NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_64 = NL + "\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 = "Command extends "; + protected final String TEXT_68 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; + protected final String TEXT_69 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_70 = "Command("; + protected final String TEXT_71 = " parent, "; + protected final String TEXT_72 = ".CreateRequestEx request"; + protected final String TEXT_73 = ", "; + protected final String TEXT_74 = " constraint"; + protected final String TEXT_75 = ") {" + NL + "\t\t\t"; + protected final String TEXT_76 = " domainModelEditDomain = "; + protected final String TEXT_77 = ".getEditingDomain(parent.getDiagram().getElement());"; + protected final String TEXT_78 = NL + "\t\t\t"; + protected final String TEXT_79 = " createdDomainElement = "; + protected final String TEXT_80 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; + protected final String TEXT_81 = ".eINSTANCE.get"; + protected final String TEXT_82 = "());"; protected final String TEXT_83 = NL + "\t\t\t"; - protected final String TEXT_84 = " compoundCommand = new "; - protected final String TEXT_85 = "();" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_86 = ".create(domainModelEditDomain, "; - protected final String TEXT_87 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_88 = ".eINSTANCE.get"; - protected final String TEXT_89 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_90 = ".create(domainModelEditDomain, "; - protected final String TEXT_91 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_92 = ".eINSTANCE.get"; - protected final String TEXT_93 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; - protected final String TEXT_94 = NL + "\t\t\tthis.domainModelAddCommand = "; - protected final String TEXT_95 = ".create(domainModelEditDomain, "; - protected final String TEXT_96 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_97 = ".eINSTANCE.get"; - protected final String TEXT_98 = "(), createdDomainElement);"; - protected final String TEXT_99 = NL + "\t\t\tthis.notationAddCommand = new Create"; - protected final String TEXT_100 = "NotationCommand(parent, createdDomainElement"; - protected final String TEXT_101 = ", constraint"; - protected final String TEXT_102 = ");" + 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_103 = NL; - protected final String TEXT_104 = NL; - protected final String TEXT_105 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_106 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_107 = " feature, "; - protected final String TEXT_108 = " 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_109 = NL; - protected final String TEXT_110 = "\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_111 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_112 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends "; - protected final String TEXT_113 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_114 = " 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_115 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor("; - protected final String TEXT_116 = " 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_117 = ")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_118 = "/**/ findAffectedParts("; - protected final String TEXT_119 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof "; - protected final String TEXT_120 = ") {" + NL + "\t\t\t\t"; - protected final String TEXT_121 = " 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_122 = ".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_123 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_124 = " 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_125 = ") offspring;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + 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_126 = NL; - protected final String TEXT_127 = "\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_128 = " domainModelEditDomain = "; - protected final String TEXT_129 = ".getEditingDomain("; - protected final String TEXT_130 = ".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_131 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_132 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_133 = " 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_134 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; - protected final String TEXT_135 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

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_136 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_137 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_138 = 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_139 = NL + "\t\t\tfilter = "; - protected final String TEXT_140 = ".createFeatureFilter("; - protected final String TEXT_141 = ".eINSTANCE.get"; - protected final String TEXT_142 = "());"; - protected final String TEXT_143 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_144 = ".createFeatureFilter("; - protected final String TEXT_145 = ".eINSTANCE.get"; - protected final String TEXT_146 = "()));"; - protected final String TEXT_147 = NL + "\t\t\tfilter = filter.and("; - protected final String TEXT_148 = ".createNotifierFilter("; - protected final String TEXT_149 = "));"; - protected final String TEXT_150 = NL + "\t\t\tfilter = "; - protected final String TEXT_151 = ".createNotifierFilter("; - protected final String TEXT_152 = ");"; - protected final String TEXT_153 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; - protected final String TEXT_154 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_155 = " 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_156 = " transactionAboutToCommit("; - protected final String TEXT_157 = " 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_158 = " 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_159 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_160 = " domainModelEditDomain = "; - protected final String TEXT_161 = ".getEditingDomain("; - protected final String TEXT_162 = ".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_163 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_164 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; - protected final String TEXT_165 = " notationalChildren = "; - protected final String TEXT_166 = ".getChildren();" + NL + "\t\tfinal "; - protected final String TEXT_167 = " semanticToNotational = new "; - protected final String TEXT_168 = "();" + NL + "\t\tfor("; - protected final String TEXT_169 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_170 = " next = ("; - protected final String TEXT_171 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_172 = " 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_173 = " parentView = "; - protected final String TEXT_174 = ";" + NL + "\t\t"; - protected final String TEXT_175 = " command = new "; - protected final String TEXT_176 = "();" + NL + "\t\tfor("; - protected final String TEXT_177 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_178 = " next = ("; - protected final String TEXT_179 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_180 = " currentView = ("; - protected final String TEXT_181 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; - protected final String TEXT_182 = ".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_183 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; - protected final String TEXT_184 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_185 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_186 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_187 = " obsoleteView = ("; - protected final String TEXT_188 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_189 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; - protected final String TEXT_190 = " getCreateNotationalElementCommand("; - protected final String TEXT_191 = " parentView, "; - protected final String TEXT_192 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; - protected final String TEXT_193 = NL + "\t\tcase "; - protected final String TEXT_194 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; - protected final String TEXT_195 = ") {" + NL + "\t\t\t\treturn new Create"; - protected final String TEXT_196 = "NotationCommand(parentView, domainElement"; - protected final String TEXT_197 = ", new Rectangle(0, 0, 0, 0)"; - protected final String TEXT_198 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; - protected final String TEXT_199 = 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_200 = " getSemanticChildren() {"; - 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 = "; - protected final String TEXT_211 = ";" + NL + "\t"; - protected final String TEXT_212 = " nextValue;" + NL + "\tint nodeVID;"; - protected final String TEXT_213 = NL + "\tfor("; - protected final String TEXT_214 = " it = (("; - protected final String TEXT_215 = ")modelObject)."; - protected final String TEXT_216 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_217 = ") it.next();"; - protected final String TEXT_218 = NL + "\tnextValue = (("; - protected final String TEXT_219 = ")modelObject)."; - protected final String TEXT_220 = "();"; - protected final String TEXT_221 = NL + "\tnodeVID = "; - protected final String TEXT_222 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; - protected final String TEXT_223 = NL + "\tswitch (nodeVID) {"; - protected final String TEXT_224 = NL + "\tcase "; - protected final String TEXT_225 = ".VISUAL_ID: {"; - protected final String TEXT_226 = NL + "\tif ("; - protected final String TEXT_227 = ".VISUAL_ID == nodeVID) {"; - protected final String TEXT_228 = NL + "\t\tresult.add(nextValue);"; - protected final String TEXT_229 = NL + "\t\tbreak;" + NL + "\t\t}"; - protected final String TEXT_230 = NL + "\t\t}"; - protected final String TEXT_231 = NL + "\t}"; - protected final String TEXT_232 = NL + "\t}"; - protected final String TEXT_233 = NL + "\treturn result;"; - protected final String TEXT_234 = 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_235 = ". " + 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_236 = ";" + NL + "\t}"; - protected final String TEXT_237 = NL; - protected final String TEXT_238 = NL; - protected final String TEXT_239 = "\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_240 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_241 = " 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_242 = ") 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_243 = NL; + protected final String TEXT_84 = " createdDomainElement = "; + protected final String TEXT_85 = ".eINSTANCE.create"; + protected final String TEXT_86 = "();"; + protected final String TEXT_87 = NL + "\t\t\t"; + protected final String TEXT_88 = NL + "\t\t\t"; + protected final String TEXT_89 = "."; + protected final String TEXT_90 = ".initializeElement(createdDomainElement);"; + protected final String TEXT_91 = NL + "\t\t\t"; + protected final String TEXT_92 = " compoundCommand = new "; + protected final String TEXT_93 = "();" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_94 = ".create(domainModelEditDomain, "; + protected final String TEXT_95 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_96 = ".eINSTANCE.get"; + protected final String TEXT_97 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_98 = ".create(domainModelEditDomain, "; + protected final String TEXT_99 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_100 = ".eINSTANCE.get"; + protected final String TEXT_101 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; + protected final String TEXT_102 = NL + "\t\t\tthis.domainModelAddCommand = "; + protected final String TEXT_103 = ".create(domainModelEditDomain, "; + protected final String TEXT_104 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_105 = ".eINSTANCE.get"; + protected final String TEXT_106 = "(), createdDomainElement);"; + protected final String TEXT_107 = NL + "\t\t\tthis.notationAddCommand = new Create"; + protected final String TEXT_108 = "NotationCommand(parent, createdDomainElement"; + protected final String TEXT_109 = ", constraint"; + protected final String TEXT_110 = ");" + 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_111 = NL; + protected final String TEXT_112 = NL; + protected final String TEXT_113 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_114 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_115 = " feature, "; + protected final String TEXT_116 = " 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_117 = NL; + protected final String TEXT_118 = "\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_119 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_120 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends "; + protected final String TEXT_121 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_122 = " 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_123 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor("; + protected final String TEXT_124 = " 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_125 = ")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_126 = "/**/ findAffectedParts("; + protected final String TEXT_127 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof "; + protected final String TEXT_128 = ") {" + NL + "\t\t\t\t"; + protected final String TEXT_129 = " 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_130 = ".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_131 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_132 = " 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_133 = ") 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_134 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_135 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; + protected final String TEXT_136 = NL + "\t\tuninstallLinkNotationModelRefresher();"; + protected final String TEXT_137 = 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_138 = NL; + protected final String TEXT_139 = "\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_140 = " domainModelEditDomain = "; + protected final String TEXT_141 = ".getEditingDomain("; + protected final String TEXT_142 = ".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_143 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_144 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_145 = " 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_146 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; + protected final String TEXT_147 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

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_148 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_149 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_150 = 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_151 = NL + "\t\t\tfilter = "; + protected final String TEXT_152 = ".createFeatureFilter("; + protected final String TEXT_153 = ".eINSTANCE.get"; + protected final String TEXT_154 = "());"; + protected final String TEXT_155 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_156 = ".createFeatureFilter("; + protected final String TEXT_157 = ".eINSTANCE.get"; + protected final String TEXT_158 = "()));"; + protected final String TEXT_159 = NL + "\t\t\tfilter = filter.and("; + protected final String TEXT_160 = ".createNotifierFilter("; + protected final String TEXT_161 = "));"; + protected final String TEXT_162 = NL + "\t\t\tfilter = "; + protected final String TEXT_163 = ".createNotifierFilter("; + protected final String TEXT_164 = ");"; + protected final String TEXT_165 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; + protected final String TEXT_166 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_167 = " 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_168 = " transactionAboutToCommit("; + protected final String TEXT_169 = " 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_170 = " 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_171 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_172 = " domainModelEditDomain = "; + protected final String TEXT_173 = ".getEditingDomain("; + protected final String TEXT_174 = ".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_175 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_176 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; + protected final String TEXT_177 = " notationalChildren = "; + protected final String TEXT_178 = ".getChildren();" + NL + "\t\tfinal "; + protected final String TEXT_179 = " semanticToNotational = new "; + protected final String TEXT_180 = "();" + NL + "\t\tfor("; + protected final String TEXT_181 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_182 = " next = ("; + protected final String TEXT_183 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_184 = " 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_185 = " parentView = "; + protected final String TEXT_186 = ";" + NL + "\t\t"; + protected final String TEXT_187 = " command = new "; + protected final String TEXT_188 = "();" + NL + "\t\tfor("; + protected final String TEXT_189 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_190 = " next = ("; + protected final String TEXT_191 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_192 = " currentView = ("; + protected final String TEXT_193 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; + protected final String TEXT_194 = ".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_195 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; + protected final String TEXT_196 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_197 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_198 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_199 = " obsoleteView = ("; + protected final String TEXT_200 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_201 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; + protected final String TEXT_202 = " getCreateNotationalElementCommand("; + protected final String TEXT_203 = " parentView, "; + protected final String TEXT_204 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; + protected final String TEXT_205 = NL + "\t\tcase "; + protected final String TEXT_206 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; + protected final String TEXT_207 = ") {" + NL + "\t\t\t\treturn new Create"; + protected final String TEXT_208 = "NotationCommand(parentView, domainElement"; + protected final String TEXT_209 = ", new Rectangle(0, 0, 0, 0)"; + protected final String TEXT_210 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; + protected final String TEXT_211 = 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_212 = " getSemanticChildren() {"; + protected final String TEXT_213 = NL; + protected final String TEXT_214 = NL + "\treturn "; + protected final String TEXT_215 = ".EMPTY_LIST;"; + protected final String TEXT_216 = NL + "\t"; + protected final String TEXT_217 = " result = new "; + protected final String TEXT_218 = "();"; + protected final String TEXT_219 = NL + "\t"; + protected final String TEXT_220 = " viewObject = "; + protected final String TEXT_221 = ";" + NL + "\t"; + protected final String TEXT_222 = " modelObject = "; + protected final String TEXT_223 = ";" + NL + "\t"; + protected final String TEXT_224 = " nextValue;" + NL + "\tint nodeVID;"; + protected final String TEXT_225 = NL + "\tfor("; + protected final String TEXT_226 = " it = (("; + protected final String TEXT_227 = ")modelObject)."; + protected final String TEXT_228 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_229 = ") it.next();"; + protected final String TEXT_230 = NL + "\tnextValue = (("; + protected final String TEXT_231 = ")modelObject)."; + protected final String TEXT_232 = "();"; + protected final String TEXT_233 = NL + "\tnodeVID = "; + protected final String TEXT_234 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; + protected final String TEXT_235 = NL + "\tswitch (nodeVID) {"; + protected final String TEXT_236 = NL + "\tcase "; + protected final String TEXT_237 = ".VISUAL_ID: {"; + protected final String TEXT_238 = NL + "\tif ("; + protected final String TEXT_239 = ".VISUAL_ID == nodeVID) {"; + protected final String TEXT_240 = NL + "\t\tresult.add(nextValue);"; + protected final String TEXT_241 = NL + "\t\tbreak;" + NL + "\t\t}"; + protected final String TEXT_242 = NL + "\t\t}"; + protected final String TEXT_243 = NL + "\t}"; + protected final String TEXT_244 = NL + "\t}"; + protected final String TEXT_245 = NL + "\treturn result;"; + protected final String TEXT_246 = 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_247 = ". " + 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_248 = ";" + NL + "\t}" + NL; + protected final String TEXT_249 = NL; + protected final String TEXT_250 = 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_251 = " domainModelEditDomain = "; + protected final String TEXT_252 = ".getEditingDomain("; + protected final String TEXT_253 = ".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_254 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_255 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_256 = " 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_257 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; + protected final String TEXT_258 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

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_259 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_260 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_261 = 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_262 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_263 = ".createEventTypeFilter("; + protected final String TEXT_264 = ".SET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_265 = ".createEventTypeFilter("; + protected final String TEXT_266 = ".UNSET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_267 = ".createEventTypeFilter("; + protected final String TEXT_268 = ".REMOVE).or(" + NL + "\t\t\t\t"; + protected final String TEXT_269 = ".createEventTypeFilter("; + protected final String TEXT_270 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; + protected final String TEXT_271 = 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_272 = NL; + protected final String TEXT_273 = NL + "\t\t\tfilter = "; + 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\tfilter = "; + protected final String TEXT_283 = ".createFeatureFilter("; + protected final String TEXT_284 = ".eINSTANCE.get"; + protected final String TEXT_285 = "());"; + protected final String TEXT_286 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_287 = ".createFeatureFilter("; + protected final String TEXT_288 = ".eINSTANCE.get"; + protected final String TEXT_289 = "()));"; + protected final String TEXT_290 = NL; + protected final String TEXT_291 = NL + "\t\t\tfilter = "; + protected final String TEXT_292 = ".createFeatureFilter("; + protected final String TEXT_293 = ".eINSTANCE.get"; + protected final String TEXT_294 = "());"; + protected final String TEXT_295 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_296 = ".createFeatureFilter("; + protected final String TEXT_297 = ".eINSTANCE.get"; + protected final String TEXT_298 = "()));"; + protected final String TEXT_299 = NL; + protected final String TEXT_300 = NL + "\t\t\tfilter = "; + protected final String TEXT_301 = ".createFeatureFilter("; + protected final String TEXT_302 = ".eINSTANCE.get"; + protected final String TEXT_303 = "());"; + protected final String TEXT_304 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_305 = ".createFeatureFilter("; + protected final String TEXT_306 = ".eINSTANCE.get"; + protected final String TEXT_307 = "()));"; + protected final String TEXT_308 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; + protected final String TEXT_309 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();"; + protected final String TEXT_310 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; + protected final String TEXT_311 = NL + "\t\t\tfilter = createUncontainedLinksFilter();"; + protected final String TEXT_312 = NL + "\t\t\tfilter = "; + protected final String TEXT_313 = ".ANY.negated();"; + protected final String TEXT_314 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_315 = " 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_316 = " transactionAboutToCommit("; + protected final String TEXT_317 = " 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_318 = " 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_319 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_320 = " domainModelEditDomain = "; + protected final String TEXT_321 = ".getEditingDomain("; + protected final String TEXT_322 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL; + protected final String TEXT_323 = NL; + protected final String TEXT_324 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_325 = " mySource;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_326 = " myDestination;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_327 = " 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_328 = " source, "; + protected final String TEXT_329 = " destination, "; + protected final String TEXT_330 = " 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_331 = " source, "; + protected final String TEXT_332 = " 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_333 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_334 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_335 = " 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_336 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_337 = "/**/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t"; + protected final String TEXT_338 = "/**/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal "; + protected final String TEXT_339 = " semanticToNotationalTypeBasedLinks = new "; + protected final String TEXT_340 = "();" + NL + "\t\tfinal "; + protected final String TEXT_341 = "/*>*/ semanticToNotationalFeatureBasedLinks = new "; + protected final String TEXT_342 = "();" + NL + "\t\tfor("; + protected final String TEXT_343 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_344 = " next = ("; + protected final String TEXT_345 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_346 = " 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_347 = " featureBasedLinksForSource = ("; + protected final String TEXT_348 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new "; + protected final String TEXT_349 = "();" + 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_350 = " parentView = "; + protected final String TEXT_351 = ";" + NL + "\t\t"; + protected final String TEXT_352 = " command = new "; + protected final String TEXT_353 = "();" + NL + "\t\tfor("; + protected final String TEXT_354 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t"; + protected final String TEXT_355 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t"; + protected final String TEXT_356 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = ("; + protected final String TEXT_357 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; + protected final String TEXT_358 = " featureBasedLinksForSource = ("; + protected final String TEXT_359 = ") 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_360 = ") 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_361 = ".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_362 = " 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_363 = "(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_364 = "(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_365 = "(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_366 = " 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_367 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_368 = " 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_369 = "(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_370 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_371 = " obsoleteView = ("; + protected final String TEXT_372 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_373 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_374 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_375 = " obsoleteViews = ("; + protected final String TEXT_376 = ") it.next();" + NL + "\t\t\tfor("; + protected final String TEXT_377 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t"; + protected final String TEXT_378 = " obsoleteView = ("; + protected final String TEXT_379 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_380 = "(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_381 = " findView("; + protected final String TEXT_382 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_383 = " editPart = ("; + protected final String TEXT_384 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof "; + protected final String TEXT_385 = ") {" + NL + "\t\t\treturn ("; + protected final String TEXT_386 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_387 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t"; + protected final String TEXT_388 = " 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_389 = " findNode("; + protected final String TEXT_390 = " parentView, "; + protected final String TEXT_391 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_392 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_393 = " next = ("; + protected final String TEXT_394 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t"; + protected final String TEXT_395 = " 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_396 = " findEdge("; + protected final String TEXT_397 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_398 = " it = "; + protected final String TEXT_399 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_400 = " next = ("; + protected final String TEXT_401 = ") 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_402 = " getCreateNotationalEdgeCommand("; + protected final String TEXT_403 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t"; + protected final String TEXT_404 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t"; + protected final String TEXT_405 = " 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_406 = " createdEdge = "; + protected final String TEXT_407 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {"; + protected final String TEXT_408 = NL + "\t\tcase "; + protected final String TEXT_409 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof "; + protected final String TEXT_410 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t"; + protected final String TEXT_411 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_412 = NL + "\t\tcase "; + protected final String TEXT_413 = ".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_414 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_415 = 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_416 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_417 = " getSemanticChildLinks() {"; + protected final String TEXT_418 = NL; + protected final String TEXT_419 = "\t"; + protected final String TEXT_420 = " result = new "; + protected final String TEXT_421 = "();"; + protected final String TEXT_422 = NL + "\t"; + protected final String TEXT_423 = " modelObject = "; + protected final String TEXT_424 = ";" + NL + "\t"; + protected final String TEXT_425 = " nextValue;"; + protected final String TEXT_426 = NL + "\tint linkVID;"; + protected final String TEXT_427 = NL + "\tfor("; + protected final String TEXT_428 = " it = (("; + protected final String TEXT_429 = ")modelObject)."; + protected final String TEXT_430 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_431 = ") it.next();"; + protected final String TEXT_432 = NL + "\tnextValue = (("; + protected final String TEXT_433 = ")modelObject)."; + protected final String TEXT_434 = "();"; + protected final String TEXT_435 = NL + "\tlinkVID = "; + protected final String TEXT_436 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; + protected final String TEXT_437 = NL + "\tswitch (linkVID) {"; + protected final String TEXT_438 = NL + "\tcase "; + protected final String TEXT_439 = ".VISUAL_ID: {"; + protected final String TEXT_440 = NL + "\tif ("; + protected final String TEXT_441 = ".VISUAL_ID == linkVID) {"; + protected final String TEXT_442 = NL + "\t\t"; + protected final String TEXT_443 = " source = (("; + protected final String TEXT_444 = ")nextValue)."; + protected final String TEXT_445 = "();"; + protected final String TEXT_446 = NL + "\t\t"; + protected final String TEXT_447 = " source = "; + protected final String TEXT_448 = ";"; + protected final String TEXT_449 = NL + "\t\t"; + protected final String TEXT_450 = " target = (("; + protected final String TEXT_451 = ")nextValue)."; + protected final String TEXT_452 = "();"; + protected final String TEXT_453 = NL + "\t\t"; + protected final String TEXT_454 = " target = "; + protected final String TEXT_455 = ";"; + protected final String TEXT_456 = 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_457 = NL + "\t\tbreak;" + NL + "\t}"; + protected final String TEXT_458 = NL + "\t}"; + protected final String TEXT_459 = NL + "\t}"; + protected final String TEXT_460 = NL + "\t}"; + protected final String TEXT_461 = NL + "\tfor("; + protected final String TEXT_462 = " it = (("; + protected final String TEXT_463 = ")modelObject)."; + protected final String TEXT_464 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_465 = ") it.next();"; + protected final String TEXT_466 = NL + "\tnextValue = (("; + protected final String TEXT_467 = ")modelObject)."; + protected final String TEXT_468 = "();"; + protected final String TEXT_469 = NL + "\tif (nextValue != null) {"; + protected final String TEXT_470 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, "; + protected final String TEXT_471 = ".VISUAL_ID));"; + protected final String TEXT_472 = NL + "\t}"; + protected final String TEXT_473 = NL + "\t}"; + protected final String TEXT_474 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_475 = " getNotationalChildLinks() {" + NL + "\t\t"; + protected final String TEXT_476 = " result = new "; + protected final String TEXT_477 = "();" + NL + "\t\t"; + protected final String TEXT_478 = " allLinks = "; + protected final String TEXT_479 = ".getEdges();" + NL + "\t\tfor("; + protected final String TEXT_480 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_481 = " next = ("; + protected final String TEXT_482 = ") it.next();"; + protected final String TEXT_483 = 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_484 = " 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_485 = " 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_486 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == "; + protected final String TEXT_487 = ") {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_488 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_489 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_490 = ".VISUAL_ID:"; + protected final String TEXT_491 = 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_492 = NL + "\t\t\t} else {"; + protected final String TEXT_493 = NL + "\t\t\t}"; + protected final String TEXT_494 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {"; + protected final String TEXT_495 = NL + "\t\t\t\tif (next.getElement().eContainer() == "; + protected final String TEXT_496 = ") {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_497 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_498 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_499 = ".VISUAL_ID:"; + protected final String TEXT_500 = 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_501 = 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_502 = ". " + 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_503 = ";" + NL + "\t}"; + protected final String TEXT_504 = NL; + protected final String TEXT_505 = NL; + protected final String TEXT_506 = "\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_507 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_508 = " 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_509 = ") 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_510 = NL; public String generate(Object argument) { @@ -268,8 +535,66 @@ GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0]; 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(); +class DiagramEditPartHelper { + private final List myContainedFeatureModelFacetLinks = new LinkedList(); + private final List myContainedTypeModelFacetLinks = new LinkedList(); + public DiagramEditPartHelper(GenDiagram diagram) { + for(Iterator it = diagram.getLinks().iterator(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) { + continue; + } + GenClass containerClass; + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) { + //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link. + containerClass = null; + } else { + containerClass = modelFacet.getContainmentMetaFeature().getGenClass(); + } + } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + containerClass = metaFeature.getGenClass(); + } else { + continue; + } + if (containerClass.getEcoreClass().isSuperTypeOf(diagram.getDomainDiagramElement().getEcoreClass())) { + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + myContainedTypeModelFacetLinks.add(genLink); + } else { + myContainedFeatureModelFacetLinks.add(genLink); + } + } + } + } + + public boolean containsLinks() { + return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks(); + } + + public boolean containsFeatureModelFacetLinks() { + return !myContainedFeatureModelFacetLinks.isEmpty(); + } + + public boolean containsTypeModelFacetLinks() { + return !myContainedTypeModelFacetLinks.isEmpty(); + } + + public Iterator getContainedFeatureModelFacetLinks() { + return myContainedFeatureModelFacetLinks.iterator(); + } + + public Iterator getContainedTypeModelFacetLinks() { + return myContainedTypeModelFacetLinks.iterator(); + } +} +final DiagramEditPartHelper myHelper = new DiagramEditPartHelper(genDiagram); + stringBuffer.append(TEXT_1); importManager.emitPackageStatement(stringBuffer); @@ -321,57 +646,76 @@ stringBuffer.append(TEXT_11); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_14); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_15); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + 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); if (null != genDiagram.getPalette()) { final Palette palette = genDiagram.getPalette(); - stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_19); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_20); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_21); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_22); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_18); + stringBuffer.append(TEXT_24); for(Iterator it = childNodes.iterator(); it.hasNext(); ) { GenTopLevelNode next = (GenTopLevelNode)it.next(); - stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_25); stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_26); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_27); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_28); } - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_30); }/*when there's palette*/ - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_31); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_32); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_35); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_37); + +//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_38); + +//} + + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid")); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_41); /*@ include file="adapters/propertySource.javajetinc"*/ - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_42); for(Iterator it = childNodes.iterator(); it.hasNext(); ) { GenTopLevelNode next = (GenTopLevelNode)it.next(); @@ -379,42 +723,42 @@ boolean isListLayout = false; String resolvedSemanticElement = "parent.getElement()"; - stringBuffer.append(TEXT_35); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_44); if (isStatic) { - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_45); } - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_46); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_48); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_51); if (!isListLayout) { - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_53); } - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_55); stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_56); if (!isListLayout) { - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_59); int defaultWidth = 40; int defaultHeight = 40; @@ -424,199 +768,218 @@ defaultHeight = defSizeAttrs.getHeight(); } - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_60); stringBuffer.append(defaultWidth); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_61); stringBuffer.append(defaultHeight); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_62); } - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_63); if (genDiagram.getPalette() != null) { - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_64); if (isStatic) { - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_65); } - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_66); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_68); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_69); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_72); if (!isListLayout) { - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_73); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_74); } - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_77); if (next.getDomainMetaClass().isMapEntry()) { /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_81); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_82); } else { - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_85); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_86); } - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_87); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_89); stringBuffer.append(next.getUniqueIdentifier()); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_90); TypeModelFacet facet = next.getModelFacet(); GenFeature childFeature = facet.getChildMetaFeature(); GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_94); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_96); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_98); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_100); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_101); } else { - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_103); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_105); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_106); } - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_107); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_108); if(!isListLayout) { - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_109); } - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_110); } } - stringBuffer.append(TEXT_103); - stringBuffer.append(TEXT_104); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_108); - stringBuffer.append(TEXT_109); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("java.util.Collection")); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName("java.util.Collection")); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_128); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_131); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_133); + +//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_134); + +//} + + stringBuffer.append(TEXT_135); + +//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_136); + +//} + + stringBuffer.append(TEXT_137); { String _getDiagramCode = "getDiagram()"; String _getViewCode = "getDiagram()"; String _getSemanticElementCode = "getDiagram().getElement()"; boolean isListLayout = false; +final boolean _includeUncontainedLinks = true; - stringBuffer.append(TEXT_126); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_140); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_141); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_145); boolean hasConstraintsInChildren = false; for (Iterator it = childNodes.iterator(); it.hasNext(); ) { @@ -631,158 +994,160 @@ if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_146); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_149); } - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_150); -boolean hasDeclaredFilter = false; -Set genChildFeatures = new LinkedHashSet(); -for (Iterator it = childNodes.iterator(); it.hasNext(); ) { - GenNode nextNode = (GenNode) it.next(); - TypeModelFacet typeModelFacet = nextNode.getModelFacet(); - if (typeModelFacet == null) { - continue; - } - GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature(); - if (genChildFeatures.contains(childMetaFeature)) { - continue; - } - genChildFeatures.add(childMetaFeature); - if (!hasDeclaredFilter) { - hasDeclaredFilter = true; +{ + boolean hasDeclaredFilter = false; + Set genChildFeatures = new LinkedHashSet(); + for (Iterator it = childNodes.iterator(); it.hasNext(); ) { + GenNode nextNode = (GenNode) it.next(); + TypeModelFacet typeModelFacet = nextNode.getModelFacet(); + if (typeModelFacet == null) { + continue; + } + GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature(); + if (genChildFeatures.contains(childMetaFeature)) { + continue; + } + genChildFeatures.add(childMetaFeature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_153); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_154); - } else { + } else { - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_157); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_158); - } -} //for + } + } //for -if (hasDeclaredFilter) { + if (hasDeclaredFilter) { - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_160); stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_161); -} else { + } else { - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_163); stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_164); -} + } +} //local declaration of hasDeclaredFilter if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_165); } - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_169); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_172); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_173); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_177); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_185); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_186); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_188); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_200); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_203); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_204); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); @@ -792,39 +1157,39 @@ } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_206); stringBuffer.append(childNodeInterfaceName); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_207); stringBuffer.append(nextNode.getDomainMetaClass().getName()); stringBuffer.append(nextNode.getVisualID()); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_208); if (!isListLayout) { - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_209); } - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_210); } - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_200); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_213); if (childNodes.size() == 0) { - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_215); } else { - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_218); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { @@ -842,17 +1207,17 @@ Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_220); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_221); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_222); stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_224); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { @@ -861,99 +1226,875 @@ Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_227); stringBuffer.append(childMetaFeature.getGetAccessor()); - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_229); } else { - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_230); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_231); stringBuffer.append(childMetaFeature.getGetAccessor()); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_232); } - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_233); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_234); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_235); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_236); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_237); } else { - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_238); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_239); } - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_240); if (generateSwitch) { - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_241); } else { - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_242); } } if (generateSwitch) { - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_243); } if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_244); } } - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_245); } - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_246); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_247); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_249); -} +if (myHelper.containsLinks() || _includeUncontainedLinks) { - stringBuffer.append(TEXT_237); - stringBuffer.append(TEXT_238); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_250); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_251); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_252); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_253); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); + stringBuffer.append(TEXT_254); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_255); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_256); + + boolean hasConstraintsInContainedLinks = false; + for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) { + hasConstraintsInContainedLinks = true; + break; + } + } + if (hasConstraintsInContainedLinks) { + + stringBuffer.append(TEXT_257); + stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); + stringBuffer.append(TEXT_258); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_259); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_260); + + } + if (_includeUncontainedLinks) { + + stringBuffer.append(TEXT_261); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_262); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_263); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(TEXT_264); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_265); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(TEXT_266); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_267); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(TEXT_268); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_269); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(TEXT_270); + + } + + stringBuffer.append(TEXT_271); + + { + boolean hasDeclaredFilter = false; + Set genAffectingFeatures = new LinkedHashSet(); + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (modelFacet == null) { + continue; + } + GenFeature _feature = modelFacet.getChildMetaFeature(); + + stringBuffer.append(TEXT_272); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + + 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_275); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_276); + + } else { + + stringBuffer.append(TEXT_277); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_278); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_279); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_280); + + } + + + _feature = modelFacet.getSourceMetaFeature(); + + stringBuffer.append(TEXT_281); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_282); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_283); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_284); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_285); + + } else { + + stringBuffer.append(TEXT_286); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_287); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_288); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_289); + + } + + + _feature = modelFacet.getTargetMetaFeature(); + + stringBuffer.append(TEXT_290); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_291); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_292); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_293); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_294); + + } else { + + stringBuffer.append(TEXT_295); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_296); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_297); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_298); + + } + + + } + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature(); + + stringBuffer.append(TEXT_299); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_300); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_301); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_302); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_303); + + } else { + + stringBuffer.append(TEXT_304); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_305); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_306); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_307); + + } + + + } + if (hasConstraintsInContainedLinks) { + if (hasDeclaredFilter) { + + stringBuffer.append(TEXT_308); + + } else { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_309); + + } + } + if (_includeUncontainedLinks) { + if (hasDeclaredFilter) { + + stringBuffer.append(TEXT_310); + + } else { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_311); + + } + } + if (!hasDeclaredFilter) { + + stringBuffer.append(TEXT_312); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_313); + + } + } //local declaration of hasDeclaredFilter + + stringBuffer.append(TEXT_314); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_315); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_316); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); + stringBuffer.append(TEXT_317); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_318); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_319); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_320); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_321); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_322); + stringBuffer.append(TEXT_323); + /*inner class*/ + stringBuffer.append(TEXT_324); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_325); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_326); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_327); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_328); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_329); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_330); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_331); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_332); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_333); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_334); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_335); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_336); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_337); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_338); + stringBuffer.append(importManager.getImportedName("java.util.Map")); + stringBuffer.append(TEXT_339); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(TEXT_340); + stringBuffer.append(importManager.getImportedName("java.util.Map")); + stringBuffer.append(TEXT_341); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(TEXT_342); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_343); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_344); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_345); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_346); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_347); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_348); + stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(TEXT_349); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_350); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_351); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_352); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_353); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_354); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_355); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_356); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + 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("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_360); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_361); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); + stringBuffer.append(TEXT_362); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); + stringBuffer.append(TEXT_363); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_364); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_365); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_366); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")); + stringBuffer.append(TEXT_367); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_368); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")); + stringBuffer.append(TEXT_369); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_370); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_371); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_372); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_373); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_374); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_375); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_376); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_377); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_378); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_379); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_380); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_381); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_382); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_383); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_384); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_385); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_386); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_387); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_388); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_389); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_390); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_391); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_392); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_393); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_394); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_395); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_396); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_397); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_398); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_399); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_400); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_401); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); + stringBuffer.append(TEXT_402); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_403); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_404); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_405); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_406); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); + stringBuffer.append(TEXT_407); + + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (modelFacet == null) { + continue; + } + + stringBuffer.append(TEXT_408); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_409); + stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_410); + stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); + stringBuffer.append(TEXT_411); + + } + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + + stringBuffer.append(TEXT_412); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_413); + stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); + stringBuffer.append(TEXT_414); + + } + + stringBuffer.append(TEXT_415); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); + stringBuffer.append(TEXT_416); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_417); + stringBuffer.append(TEXT_418); + stringBuffer.append(TEXT_419); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_420); + stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(TEXT_421); + +Map genFeature2genLinkMap = new LinkedHashMap(); +for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + GenFeature metaFeature = modelFacet.getChildMetaFeature(); + if (!genFeature2genLinkMap.containsKey(metaFeature)) { + genFeature2genLinkMap.put(metaFeature, new ArrayList()); + } + ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink); +} +Map genFeature2featureGenLinkMap = new LinkedHashMap(); +for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) { + genFeature2featureGenLinkMap.put(metaFeature, new ArrayList()); + } + ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink); +} +if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { + + stringBuffer.append(TEXT_422); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_423); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_424); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_425); + +} +if (!genFeature2genLinkMap.isEmpty()) { + + stringBuffer.append(TEXT_426); + +} +for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { + Map.Entry nextEntry = (Map.Entry) entries.next(); + GenFeature metaFeature = (GenFeature) nextEntry.getKey(); + Collection genLinksCollection = (Collection) nextEntry.getValue(); + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_427); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_428); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_429); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_430); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_431); + + } else { + + stringBuffer.append(TEXT_432); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_433); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_434); + + } + + stringBuffer.append(TEXT_435); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_436); + + boolean generateSwitch = genLinksCollection.size() != 1; + if (generateSwitch) { + + stringBuffer.append(TEXT_437); + + } + for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { + GenLink nextLink = (GenLink) genLinksIterator.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (generateSwitch) { + + stringBuffer.append(TEXT_438); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_439); + + } else { + + stringBuffer.append(TEXT_440); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_441); + + } + if (modelFacet.getSourceMetaFeature() != null) { + + stringBuffer.append(TEXT_442); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_443); + stringBuffer.append(importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_444); + stringBuffer.append(modelFacet.getSourceMetaFeature().getGetAccessor()); + stringBuffer.append(TEXT_445); + + } else { + + stringBuffer.append(TEXT_446); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_447); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_448); + + } + if (modelFacet.getTargetMetaFeature() != null) { + + stringBuffer.append(TEXT_449); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_450); + stringBuffer.append(importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_451); + stringBuffer.append(modelFacet.getTargetMetaFeature().getGetAccessor()); + stringBuffer.append(TEXT_452); + + } else { + + stringBuffer.append(TEXT_453); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_454); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_455); + + } + + stringBuffer.append(TEXT_456); + + if (generateSwitch) { + + stringBuffer.append(TEXT_457); + + } else { + + stringBuffer.append(TEXT_458); + + } + + + } //iterate over genLinksCollection + if (generateSwitch) { + + stringBuffer.append(TEXT_459); + + } + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_460); + + } +} +for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) { + Map.Entry nextEntry = (Map.Entry) entries.next(); + GenFeature metaFeature = (GenFeature) nextEntry.getKey(); + Collection genLinksCollection = (Collection) nextEntry.getValue(); + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_461); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_462); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_463); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_464); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_465); + + } else { + + stringBuffer.append(TEXT_466); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_467); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_468); + + } + + stringBuffer.append(TEXT_469); + + for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { + GenLink nextLink = (GenLink) genLinksIterator.next(); + + stringBuffer.append(TEXT_470); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_471); + + } + + stringBuffer.append(TEXT_472); + + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_473); + + } +} + + stringBuffer.append(TEXT_474); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_475); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_476); + stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(TEXT_477); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_478); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_479); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_480); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_481); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_482); + + if (_includeUncontainedLinks) { + + stringBuffer.append(TEXT_483); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_484); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_485); + + } + + + if (myHelper.containsFeatureModelFacetLinks()) { + + stringBuffer.append(TEXT_486); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_487); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_488); + + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + + stringBuffer.append(TEXT_489); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_490); + + } + + stringBuffer.append(TEXT_491); + + if (myHelper.containsTypeModelFacetLinks()) { + + stringBuffer.append(TEXT_492); + + } else { + + stringBuffer.append(TEXT_493); + + } + } + + + + if (myHelper.containsTypeModelFacetLinks()) { + if (!myHelper.containsFeatureModelFacetLinks()) { + + stringBuffer.append(TEXT_494); + + } + + stringBuffer.append(TEXT_495); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_496); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_497); + + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + + stringBuffer.append(TEXT_498); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_499); + + } + + stringBuffer.append(TEXT_500); + + } + + stringBuffer.append(TEXT_501); + stringBuffer.append(genDiagram.isSynchronized()); + stringBuffer.append(TEXT_502); + stringBuffer.append(genDiagram.isSynchronized()); + stringBuffer.append(TEXT_503); + +} + + +} + + stringBuffer.append(TEXT_504); + stringBuffer.append(TEXT_505); + stringBuffer.append(TEXT_506); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_507); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_508); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_509); importManager.emitSortedImports(); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_510); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java,v retrieving revision 1.8 diff -u -r1.8 LinkLabelEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java 3 Jul 2006 18:10:52 -0000 1.8 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java 1 Aug 2006 13:55:35 -0000 @@ -180,71 +180,84 @@ protected final String TEXT_160 = " imageDescriptor = "; protected final String TEXT_161 = ".getInstance().getItemImageDescriptor(resolveSemanticElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; protected final String TEXT_162 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_163 = " resolveSemanticElement() {" + NL + "\t\tfor(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tView view = (View)editPart.getModel();" + NL + "\t\t\tif (view != null && view.getElement() != null) {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_164 = ") view.getElement();" + 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_165 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; - protected final String TEXT_166 = ") {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_167 = ") 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_168 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_169 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_170 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_171 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_172 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_173 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_174 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_175 = ".eINSTANCE.get"; - protected final String TEXT_176 = "(), labelRefresher);"; - protected final String TEXT_177 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_178 = ".eINSTANCE.get"; - protected final String TEXT_179 = "(), labelRefresher);"; - protected final String TEXT_180 = 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_181 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_182 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_183 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_184 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_185 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_186 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_187 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_188 = ".eINSTANCE.get"; - protected final String TEXT_189 = "(), labelRefresher);"; - protected final String TEXT_190 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_191 = ".eINSTANCE.get"; - protected final String TEXT_192 = "(), labelRefresher);"; - protected final String TEXT_193 = 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_194 = NL; - protected final String TEXT_195 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_196 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_197 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_198 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_199 = " createLabel() {"; - protected final String TEXT_200 = NL + "\t\treturn new "; - protected final String TEXT_201 = "();"; - protected final String TEXT_202 = NL + "\t\treturn "; - protected final String TEXT_203 = ";"; - protected final String TEXT_204 = NL + "\t\treturn new "; - protected final String TEXT_205 = "();"; - protected final String TEXT_206 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_207 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_208 = " label = createLabel();"; - protected final String TEXT_209 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_210 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_211 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_212 = NL + NL + "\t/**"; - protected final String TEXT_213 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_214 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_215 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_216 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_217 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_218 = "("; - protected final String TEXT_219 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_220 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_221 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_222 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_223 = NL; - protected final String TEXT_224 = NL; - protected final String TEXT_225 = 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_226 = NL + "}"; - protected final String TEXT_227 = NL; + protected final String TEXT_163 = " resolveSemanticElement() {" + NL + "\t\t"; + protected final String TEXT_164 = " parent = getUpdatableParent();" + NL + "\t\tif (parent == null || parent.getModel() instanceof "; + protected final String TEXT_165 = " == false) {" + NL + "\t\t\treturn null;" + NL + "\t\t}"; + protected final String TEXT_166 = NL + "\t\t"; + protected final String TEXT_167 = " view = ("; + protected final String TEXT_168 = ") parent.getModel();" + NL + "\t\treturn ("; + protected final String TEXT_169 = ") view.getElement();"; + protected final String TEXT_170 = NL + "\t\t"; + protected final String TEXT_171 = " target = (("; + protected final String TEXT_172 = ") parent.getModel()).getTarget();" + NL + "\t\treturn (target != null && target.getElement() instanceof "; + protected final String TEXT_173 = ") ? ("; + protected final String TEXT_174 = ") target.getElement() : null;"; + protected final String TEXT_175 = NL + "\t\treturn null;"; + protected final String TEXT_176 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_177 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; + protected final String TEXT_178 = ") {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_179 = ") 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_180 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_181 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_182 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_183 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_184 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_185 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_186 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_187 = ".eINSTANCE.get"; + protected final String TEXT_188 = "(), labelRefresher);"; + protected final String TEXT_189 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_190 = ".eINSTANCE.get"; + protected final String TEXT_191 = "(), labelRefresher);"; + protected final String TEXT_192 = 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_193 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_194 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_195 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_196 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_197 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_198 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_199 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_200 = ".eINSTANCE.get"; + protected final String TEXT_201 = "(), labelRefresher);"; + protected final String TEXT_202 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_203 = ".eINSTANCE.get"; + protected final String TEXT_204 = "(), labelRefresher);"; + protected final String TEXT_205 = 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_206 = NL; + protected final String TEXT_207 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_208 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_209 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_210 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_211 = " createLabel() {"; + protected final String TEXT_212 = NL + "\t\treturn new "; + protected final String TEXT_213 = "();"; + protected final String TEXT_214 = NL + "\t\treturn "; + protected final String TEXT_215 = ";"; + protected final String TEXT_216 = NL + "\t\treturn new "; + protected final String TEXT_217 = "();"; + protected final String TEXT_218 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_219 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_220 = " label = createLabel();"; + protected final String TEXT_221 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment("; + protected final String TEXT_222 = ".LEFT);"; + protected final String TEXT_223 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_224 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_225 = NL + NL + "\t/**"; + protected final String TEXT_226 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_227 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_228 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_229 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_230 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_231 = "("; + protected final String TEXT_232 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_233 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_234 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_235 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_236 = NL; + protected final String TEXT_237 = NL; + protected final String TEXT_238 = 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_239 = NL + "}"; + protected final String TEXT_240 = NL; public String generate(Object argument) { @@ -757,92 +770,124 @@ stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_163); - stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_164); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); stringBuffer.append(TEXT_165); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + +if (genHost.getModelFacet() instanceof TypeLinkModelFacet) { + stringBuffer.append(TEXT_166); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_167); - stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_168); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_169); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + +} else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) { + stringBuffer.append(TEXT_170); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_171); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); stringBuffer.append(TEXT_172); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); stringBuffer.append(TEXT_173); + stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); + stringBuffer.append(TEXT_174); + +} else { + + stringBuffer.append(TEXT_175); + +} + + stringBuffer.append(TEXT_176); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_177); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_178); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_179); + stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_180); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_181); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_182); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_183); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_184); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_185); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_186); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_187); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_188); } 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_177); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_190); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_191); } } - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_198); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_200); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_201); } 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_190); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_203); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_204); } } - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_205); final Viewmap viewmap = genLabel.getViewmap(); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_206); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -871,64 +916,66 @@ if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_208); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_209); } else { - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_210); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_211); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_212); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_213); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_214); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_215); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_216); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_217); } - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_219); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_220); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_221); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); + stringBuffer.append(TEXT_222); } else { - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_223); } - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_224); } /*not parent-assigned*/ - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_225); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_226); } - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_227); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_229); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -942,43 +989,43 @@ } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_230); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_231); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_232); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_233); } else { - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_234); } - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_235); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_236); stringBuffer.append(classBody); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_237); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_238); } } - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_239); importManager.emitSortedImports(); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_240); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java,v retrieving revision 1.15 diff -u -r1.15 NodeEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 4 Jul 2006 15:44:10 -0000 1.15 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 1 Aug 2006 13:55:36 -0000 @@ -35,875 +35,1143 @@ protected final String TEXT_14 = " primaryShape;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; protected final String TEXT_15 = "("; protected final String TEXT_16 = " model) {" + NL + "\t\tassert model instanceof "; - protected final String TEXT_17 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; + protected final String TEXT_17 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL; protected final String TEXT_18 = NL; - protected final String TEXT_19 = "\t\tinstallEditPolicy("; - protected final String TEXT_20 = ".COMPONENT_ROLE, new "; - protected final String TEXT_21 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_22 = " createDeleteCommand("; - protected final String TEXT_23 = " deleteRequest) {" + NL + "\t\t\t\t"; - protected final String TEXT_24 = " editingDomain = "; - protected final String TEXT_25 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_26 = " cc = new "; - protected final String TEXT_27 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; - protected final String TEXT_28 = ".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_29 = " editingDomain) {"; - protected final String TEXT_30 = NL + "\t\t\t\t"; - protected final String TEXT_31 = " result = new "; - protected final String TEXT_32 = "();"; - protected final String TEXT_33 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_35 = ".eINSTANCE.get"; - protected final String TEXT_36 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_37 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_38 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_39 = ".eINSTANCE.get"; - protected final String TEXT_40 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_41 = ".UNSET_VALUE));"; - 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\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_44 = ".eINSTANCE.get"; - protected final String TEXT_45 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_46 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_48 = ".eINSTANCE.get"; - protected final String TEXT_49 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_50 = ".UNSET_VALUE));"; - protected final String TEXT_51 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_52 = NL + "\t\t\t\treturn "; + protected final String TEXT_19 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + 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) {" + 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_22 = " view = ("; + protected final String TEXT_23 = ") 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_24 = NL; + protected final String TEXT_25 = "\t\tinstallEditPolicy("; + protected final String TEXT_26 = ".COMPONENT_ROLE, new "; + protected final String TEXT_27 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_28 = " createDeleteCommand("; + protected final String TEXT_29 = " deleteRequest) {" + NL + "\t\t\t\t"; + protected final String TEXT_30 = " editingDomain = "; + protected final String TEXT_31 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; + protected final String TEXT_32 = " cc = new "; + protected final String TEXT_33 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; + protected final String TEXT_34 = ".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_35 = " editingDomain) {"; + protected final String TEXT_36 = NL + "\t\t\t\t"; + protected final String TEXT_37 = " result = new "; + protected final String TEXT_38 = "();"; + protected final String TEXT_39 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_40 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_41 = ".eINSTANCE.get"; + protected final String TEXT_42 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_43 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_44 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_45 = ".eINSTANCE.get"; + protected final String TEXT_46 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_47 = ".UNSET_VALUE));"; + protected final String TEXT_48 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_49 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_50 = ".eINSTANCE.get"; + protected final String TEXT_51 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + 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\tgetDiagramNode().getElement().eContainer(), "; protected final String TEXT_54 = ".eINSTANCE.get"; - protected final String TEXT_55 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; - protected final String TEXT_56 = NL + "\t\t\t\treturn "; - 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\t"; - protected final String TEXT_60 = ".UNSET_VALUE);"; - protected final String TEXT_61 = NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_62 = NL + "\t\tinstallEditPolicy("; - protected final String TEXT_63 = ".LAYOUT_ROLE, new "; - protected final String TEXT_64 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_65 = " getCreateCommand("; - protected final String TEXT_66 = " request) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_67 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_68 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_69 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_70 = " createChangeConstraintCommand("; - protected final String TEXT_71 = " child, Object constraint) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_72 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_73 = " createChildEditPolicy("; - protected final String TEXT_74 = " child) {" + NL + "\t\t\t\treturn new "; - protected final String TEXT_75 = "() {" + NL + "\t\t\t\t\tpublic "; - protected final String TEXT_76 = " getTargetEditPart("; - protected final String TEXT_77 = " request) {" + NL + "\t\t\t\t\t\tif ("; - protected final String TEXT_78 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_79 = ".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_80 = ".GRAPHICAL_NODE_ROLE, new "; - protected final String TEXT_81 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_82 = " getReconnectTargetCommand("; - protected final String TEXT_83 = " request) {"; - protected final String TEXT_84 = " " + NL + "\t\t\t\treturn "; - protected final String TEXT_85 = ".INSTANCE;"; - protected final String TEXT_86 = NL + "\t\t\t\t"; - protected final String TEXT_87 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; - protected final String TEXT_88 = " == false) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_89 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_90 = " edge = ("; - protected final String TEXT_91 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; - protected final String TEXT_92 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; - protected final String TEXT_93 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_94 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_95 = " result = null;" + NL + "\t\t\t\tint visualID = "; - protected final String TEXT_96 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; - protected final String TEXT_97 = NL + "\t\t\t\tcase "; - protected final String TEXT_98 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; - protected final String TEXT_99 = "TargetCommand(request);" + NL + "\t\t\t\t\tbreak;"; - protected final String TEXT_100 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_101 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_102 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; - protected final String TEXT_103 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_104 = " getReconnectSourceCommand("; - protected final String TEXT_105 = " request) {"; - protected final String TEXT_106 = " " + NL + "\t\t\t\treturn "; - protected final String TEXT_107 = ".INSTANCE;"; - protected final String TEXT_108 = NL + "\t\t\t\t"; - protected final String TEXT_109 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; - protected final String TEXT_110 = " == false) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_111 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_112 = " edge = ("; - protected final String TEXT_113 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; - protected final String TEXT_114 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; - protected final String TEXT_115 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_116 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_117 = " result = null;" + NL + "\t\t\t\tint visualID = "; - protected final String TEXT_118 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; - protected final String TEXT_119 = NL + "\t\t\t\tcase "; - protected final String TEXT_120 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; - protected final String TEXT_121 = "SourceCommand(request);" + NL + "\t\t\t\t\tbreak;"; - protected final String TEXT_122 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_123 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_124 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; - protected final String TEXT_125 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_126 = " getConnectionCreateCommand("; - protected final String TEXT_127 = " request) {"; - protected final String TEXT_128 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_129 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_130 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_131 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_132 = " result = new "; - protected final String TEXT_133 = "();" + 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_134 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_135 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_136 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_137 = 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_138 = " wrappedResult = new WrappingCommand("; - protected final String TEXT_139 = ".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_140 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_141 = " getConnectionCompleteCommand("; - protected final String TEXT_142 = " request) {"; - protected final String TEXT_143 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_144 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_145 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_146 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_147 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_148 = " result = new "; - protected final String TEXT_149 = "();" + 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_150 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_151 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_152 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_153 = 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_154 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_155 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_156 = NL + "\t\t\t\treturn "; - protected final String TEXT_157 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_158 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_159 = " invisibleRectangle = new "; - protected final String TEXT_160 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; - protected final String TEXT_161 = "());" + NL + "\t\t"; - protected final String TEXT_162 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; - protected final String TEXT_163 = " 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_164 = " createNodeShape() {"; - protected final String TEXT_165 = NL + "\t\tprimaryShape = new "; - protected final String TEXT_166 = "()"; - protected final String TEXT_167 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_168 = ";"; - protected final String TEXT_169 = NL + "\t\tprimaryShape = "; - protected final String TEXT_170 = ";"; - protected final String TEXT_171 = NL + "\t\t"; - protected final String TEXT_172 = " figure = new "; - protected final String TEXT_173 = "();"; - protected final String TEXT_174 = NL + " \t\tfigure.setUseLocalCoordinates(true);"; - protected final String TEXT_175 = NL + " \t\tprimaryShape = figure;"; - protected final String TEXT_176 = NL + "\t\treturn primaryShape;" + NL + "\t}"; - protected final String TEXT_177 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_178 = " getPrimaryShape() {" + NL + "\t\treturn ("; - protected final String TEXT_179 = ") primaryShape;" + NL + "\t}"; - protected final String TEXT_180 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_181 = " createDecorationPane() {" + NL + "\t\t"; - protected final String TEXT_182 = " view = ("; - protected final String TEXT_183 = ") getModel();" + NL + "\t\t"; - protected final String TEXT_184 = " 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_185 = " decorationPane = new "; - protected final String TEXT_186 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; - protected final String TEXT_187 = "());" + NL + "" + NL + "\t\t"; - protected final String TEXT_188 = " imageFigure = new "; - protected final String TEXT_189 = "("; - protected final String TEXT_190 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; - protected final String TEXT_191 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; - protected final String TEXT_192 = ".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_193 = " setupContentPane("; - protected final String TEXT_194 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; - protected final String TEXT_195 = NL + "\t\t\t"; - protected final String TEXT_196 = " layout = new "; - protected final String TEXT_197 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; - protected final String TEXT_198 = NL + "\t\tnodeShape.setLayoutManager(new "; - protected final String TEXT_199 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; - protected final String TEXT_200 = " 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_201 = "(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_202 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_203 = " getContentPane() {" + NL + "\t\tif (contentPane == null) {" + NL + "\t\t\treturn super.getContentPane();" + NL + "\t\t}" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_204 = " getDiagramNode() {" + NL + "\t\treturn ("; - protected final String TEXT_205 = ") getModel();" + NL + "\t}" + NL; - protected final String TEXT_206 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; - protected final String TEXT_207 = " childEditPart) {"; - protected final String TEXT_208 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_209 = ") {" + NL + "\t\t\t(("; - protected final String TEXT_210 = ") childEditPart)."; - protected final String TEXT_211 = "(getPrimaryShape()."; - protected final String TEXT_212 = "());" + NL + "\t\t\treturn true;" + NL + "\t\t}"; - protected final String TEXT_213 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_214 = ") {" + NL + "\t\t\t"; - protected final String TEXT_215 = " pane = getPrimaryShape()."; - protected final String TEXT_216 = "();" + NL + "\t\t\tsetupContentPane(pane); // FIXME each comparment should handle his content pane in his own way " + NL + "\t\t\tpane.add((("; - protected final String TEXT_217 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; - protected final String TEXT_218 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean removeFixedChild(EditPart childEditPart) {"; - protected final String TEXT_219 = "\t\t" + NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_220 = ") {" + NL + "\t\t\t"; - protected final String TEXT_221 = " pane = getPrimaryShape()."; - protected final String TEXT_222 = "();" + NL + "\t\t\tpane.remove((("; - protected final String TEXT_223 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; - protected final String TEXT_224 = NL + "\t\treturn false;" + NL + "\t}"; - protected final String TEXT_225 = 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_226 = " getPrimaryLabelEditPart() {"; - protected final String TEXT_227 = NL + "\t\tfor("; - protected final String TEXT_228 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_229 = " nextChild = ("; - protected final String TEXT_230 = ")it.next();" + NL + "\t\t\tif ("; - protected final String TEXT_231 = ".getVisualID(nextChild) == "; - protected final String TEXT_232 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_233 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_234 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_235 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_236 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; - protected final String TEXT_237 = " labelToEdit;" + NL + "\t\t\tif (req instanceof "; - protected final String TEXT_238 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart(("; - protected final String TEXT_239 = ")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_240 = " getLabelEditPart("; - protected final String TEXT_241 = " req) {" + NL + "\t\t"; - protected final String TEXT_242 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; - protected final String TEXT_243 = " view = ("; - protected final String TEXT_244 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; - protected final String TEXT_245 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; - protected final String TEXT_246 = NL + "\t\t\t\tcase "; - protected final String TEXT_247 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; - protected final String TEXT_248 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; - protected final String TEXT_249 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; - protected final String TEXT_250 = " childEditPart) {"; - protected final String TEXT_251 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_252 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; - protected final String TEXT_253 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_254 = " getExternalLabelsContainer() {" + NL + "\t\t"; - protected final String TEXT_255 = " root = ("; - protected final String TEXT_256 = ") getRoot();" + NL + "\t\treturn root.getLayer("; - protected final String TEXT_257 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; - protected final String TEXT_258 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; - protected final String TEXT_259 = " childEditPart, int index) {"; - protected final String TEXT_260 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; - protected final String TEXT_261 = " labelFigure = (("; - protected final String TEXT_262 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_263 = NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_264 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; - protected final String TEXT_265 = " childEditPart) {"; - protected final String TEXT_266 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; - protected final String TEXT_267 = " labelFigure = (("; - protected final String TEXT_268 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_269 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_270 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}"; - protected final String TEXT_271 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor ("; - protected final String TEXT_272 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t"; - protected final String TEXT_273 = " childEditPart = ("; - protected final String TEXT_274 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = (("; - protected final String TEXT_275 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}"; - protected final String TEXT_276 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t\trefreshBackgroundColor();" + NL + "\t\trefreshForegroundColor();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + 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 + "\tprotected void refreshBounds() {" + NL + "\t\t"; - protected final String TEXT_277 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; - protected final String TEXT_278 = ";" + NL + "\t\t"; - protected final String TEXT_279 = " bounds = ("; - protected final String TEXT_280 = ") node.getLayoutConstraint();" + NL + "\t\t(("; - protected final String TEXT_281 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; - protected final String TEXT_282 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_283 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_284 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_285 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_286 = " getSourceConnectionAnchor("; - protected final String TEXT_287 = " connection) {" + NL + "\t\treturn new "; - protected final String TEXT_288 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_289 = " getSourceConnectionAnchor("; - protected final String TEXT_290 = " request) {" + NL + "\t\treturn new "; - protected final String TEXT_291 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_292 = " getTargetConnectionAnchor("; - protected final String TEXT_293 = " connection) {" + NL + "\t\treturn new "; - protected final String TEXT_294 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_295 = " getTargetConnectionAnchor("; - protected final String TEXT_296 = " request) {" + NL + "\t\treturn new "; - protected final String TEXT_297 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; - protected final String TEXT_298 = 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_299 = NL; - protected final String TEXT_300 = "\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_301 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_302 = " 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_303 = ") 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_304 = NL; - protected final String TEXT_305 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher("; - protected final String TEXT_306 = " 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_307 = " 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_308 = " 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; - protected final String TEXT_309 = NL; - protected final String TEXT_310 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_311 = NL + "\t\t"; - protected final String TEXT_312 = " style =" + NL + "\t\t\t("; - protected final String TEXT_313 = ") "; - protected final String TEXT_314 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_315 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_316 = " 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_317 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_318 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_319 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_320 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_321 = " 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_322 = "(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_323 = "\t" + NL + "\t}"; - protected final String TEXT_324 = 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_325 = " createdFont;"; - protected final String TEXT_326 = "\t" + NL; - protected final String TEXT_327 = NL; - protected final String TEXT_328 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; - protected final String TEXT_329 = " style = ("; - protected final String TEXT_330 = ") "; - protected final String TEXT_331 = ".getStyle("; - protected final String TEXT_332 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; - protected final String TEXT_333 = " toDispose = createdForegroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint foregroundColor = style.getLineColor();" + NL + "\t\t\tint red = foregroundColor & 0x000000FF;" + NL + "\t\t\tint green = (foregroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (foregroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; - protected final String TEXT_334 = " currentColor = getFigure().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\tcreatedForegroundColor = new "; - protected final String TEXT_335 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdForegroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedForegroundColor = 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 #refreshForegroundColor()}) currently assigned to the figure." + 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_336 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; - protected final String TEXT_337 = " style = ("; - protected final String TEXT_338 = ") "; - protected final String TEXT_339 = ".getStyle("; - protected final String TEXT_340 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; - protected final String TEXT_341 = " toDispose = createdBackgroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint backgroundColor = style.getFillColor();" + NL + "\t\t\tint red = backgroundColor & 0x000000FF;" + NL + "\t\t\tint green = (backgroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (backgroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; - protected final String TEXT_342 = " currentColor = getFigure().getBackgroundColor();" + 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\tcreatedBackgroundColor = new "; - protected final String TEXT_343 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setBackgroundColor(createdBackgroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setBackgroundColor(getViewer().getControl().getBackground());" + 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 #refreshBackgroundColor()}) currently assigned to the figure." + 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_344 = " createdBackgroundColor;" + NL; - protected final String TEXT_345 = NL; - protected final String TEXT_346 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_347 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_348 = " feature, "; - protected final String TEXT_349 = " 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 "; - protected final String TEXT_350 = "();"; - protected final String TEXT_351 = NL; - protected final String TEXT_352 = "\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_353 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_354 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_355 = NL; - protected final String TEXT_356 = "\t\tRefresher boundsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBounds();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_357 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_358 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_359 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_360 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_361 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; - protected final String TEXT_362 = NL; - protected final String TEXT_363 = "\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_364 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; - protected final String TEXT_365 = NL; - protected final String TEXT_366 = "\t\tRefresher sourceEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshSourceConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_367 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; - protected final String TEXT_368 = NL; - protected final String TEXT_369 = "\t\tRefresher targetEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshTargetConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_370 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; - protected final String TEXT_371 = NL; - protected final String TEXT_372 = "\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_373 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_374 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_375 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_376 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; - protected final String TEXT_377 = NL; - protected final String TEXT_378 = "\t\tRefresher backgroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBackgroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_379 = ".eINSTANCE.getFillStyle_FillColor(), backgroundColorRefresher);" + NL + "\t\tRefresher foregroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshForegroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_380 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; - protected final String TEXT_381 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; - protected final String TEXT_382 = "SourceCommand extends "; - protected final String TEXT_383 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_384 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_385 = " newSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_386 = " oldSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_387 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_388 = "SourceCommand("; - protected final String TEXT_389 = " request) {" + NL + "\t\t\tthis(("; - protected final String TEXT_390 = ")request.getConnectionEditPart().getModel(), ("; - protected final String TEXT_391 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_392 = "SourceCommand("; - protected final String TEXT_393 = " edge, "; - protected final String TEXT_394 = " newSource) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newSource = newSource;" + NL + "\t\t\tthis.oldSource = edge.getSource();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.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\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; - protected final String TEXT_395 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; - protected final String TEXT_396 = " domainModelEditDomain = "; - protected final String TEXT_397 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_398 = " command = new "; - protected final String TEXT_399 = "() {" + NL + "\t\t\t\tprivate "; - protected final String TEXT_400 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; - protected final String TEXT_401 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; - protected final String TEXT_402 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; - protected final String TEXT_403 = NL + "\t\t\treturn false;"; - protected final String TEXT_404 = NL + "\t\t\t"; - protected final String TEXT_405 = " container = ("; - protected final String TEXT_406 = ")getRelationshipContainer(newSource.getElement(), "; - protected final String TEXT_407 = ".eINSTANCE.get"; - protected final String TEXT_408 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_409 = NL; - protected final String TEXT_410 = NL + "\t\tif ("; - protected final String TEXT_411 = "."; - protected final String TEXT_412 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_413 = NL + "\t\t}"; - protected final String TEXT_414 = NL + "\t\tif ("; - protected final String TEXT_415 = "."; - protected final String TEXT_416 = "().size() >= "; - protected final String TEXT_417 = ".eINSTANCE.get"; - protected final String TEXT_418 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_419 = NL + "\t\t}"; - protected final String TEXT_420 = NL; - protected final String TEXT_421 = NL + "\t\tif ("; - protected final String TEXT_422 = "."; - protected final String TEXT_423 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_424 = NL + "\t\t}"; - protected final String TEXT_425 = NL + "\t\tif ("; - protected final String TEXT_426 = "."; - protected final String TEXT_427 = "().size() >= "; - protected final String TEXT_428 = ".eINSTANCE.get"; - protected final String TEXT_429 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_430 = NL + "\t\t}"; - protected final String TEXT_431 = NL; - protected final String TEXT_432 = NL + "\t\t\tif(!"; - protected final String TEXT_433 = ".canCreateLink("; - protected final String TEXT_434 = ", "; - protected final String TEXT_435 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_436 = NL + "\t\t\treturn true;"; - protected final String TEXT_437 = NL; - protected final String TEXT_438 = NL + "\t\tif ("; - protected final String TEXT_439 = "."; - protected final String TEXT_440 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_441 = NL + "\t\t}"; - protected final String TEXT_442 = NL + "\t\tif ("; - protected final String TEXT_443 = "."; - protected final String TEXT_444 = "().size() >= "; - protected final String TEXT_445 = ".eINSTANCE.get"; - protected final String TEXT_446 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_447 = NL + "\t\t}"; - protected final String TEXT_448 = NL; - protected final String TEXT_449 = NL + "\t\t\tif(!"; - protected final String TEXT_450 = ".canCreateLink("; - protected final String TEXT_451 = ", "; - protected final String TEXT_452 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_453 = NL + "\t\t\treturn true;"; - protected final String TEXT_454 = NL + "\t\t\treturn false;"; - protected final String TEXT_455 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_456 = " createReconnectCommand() {" + NL + "\t\t\t"; - protected final String TEXT_457 = " editingDomain = "; - protected final String TEXT_458 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_459 = " result = new "; - protected final String TEXT_460 = "();" + NL + "\t\t\tresult.append(new "; - protected final String TEXT_461 = "(edge, newSource));"; - protected final String TEXT_462 = NL + "\t\t\t"; - protected final String TEXT_463 = " container = getRelationshipContainer(newSource.getElement(), "; - protected final String TEXT_464 = ".eINSTANCE.get"; - protected final String TEXT_465 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_466 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_467 = " oldContainer = edge.getElement().eContainer();" + NL + "\t\t\tif (oldContainer == null) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_468 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tif (oldContainer != container) {"; - protected final String TEXT_469 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_470 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), edge.getElement()));"; - protected final String TEXT_471 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_472 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), "; - protected final String TEXT_473 = ".UNSET_VALUE));"; - protected final String TEXT_474 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_475 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; - protected final String TEXT_476 = ".eINSTANCE.get"; - protected final String TEXT_477 = "(), edge.getElement()));"; - protected final String TEXT_478 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_479 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; - protected final String TEXT_480 = ".eINSTANCE.get"; - protected final String TEXT_481 = "()," + NL + "\t\t\t\t\tedge.getElement()));"; - protected final String TEXT_482 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_483 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; - protected final String TEXT_484 = ".eINSTANCE.get"; - protected final String TEXT_485 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_486 = ".UNSET_VALUE));"; - protected final String TEXT_487 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_488 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; - protected final String TEXT_489 = ".eINSTANCE.get"; - protected final String TEXT_490 = "(), edge.getElement()));"; - protected final String TEXT_491 = NL + "\t\t\t}"; - protected final String TEXT_492 = NL + "\t\t\tresult.append("; - protected final String TEXT_493 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_494 = ".eINSTANCE.get"; - protected final String TEXT_495 = "()," + NL + "\t\t\t\toldSource.getElement()));" + NL + "\t\t\tresult.append("; - protected final String TEXT_496 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_497 = ".eINSTANCE.get"; - protected final String TEXT_498 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; - protected final String TEXT_499 = NL + "\t\t\tresult.append("; - protected final String TEXT_500 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_501 = ".eINSTANCE.get"; - protected final String TEXT_502 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; - protected final String TEXT_503 = NL + "\t\t\tresult.append("; - protected final String TEXT_504 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; - protected final String TEXT_505 = ".eINSTANCE.get"; - protected final String TEXT_506 = "(), edge.getTarget().getElement()));" + NL + "\t\t\tresult.append("; - protected final String TEXT_507 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; - protected final String TEXT_508 = ".eINSTANCE.get"; - protected final String TEXT_509 = "(), edge.getTarget().getElement()));"; - protected final String TEXT_510 = NL + "\t\t\tresult.append("; - protected final String TEXT_511 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; - protected final String TEXT_512 = ".eINSTANCE.get"; - protected final String TEXT_513 = "(), "; - protected final String TEXT_514 = ".UNSET_VALUE));" + NL + "\t\t\tresult.append("; - protected final String TEXT_515 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; - protected final String TEXT_516 = ".eINSTANCE.get"; - protected final String TEXT_517 = "(), edge.getTarget().getElement()));"; - protected final String TEXT_518 = NL + "\t\t\treturn result;" + NL + "\t\t}" + NL; - protected final String TEXT_519 = NL; - protected final String TEXT_520 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_521 = " getRelationshipContainer("; - protected final String TEXT_522 = " element, "; - protected final String TEXT_523 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_524 = NL; - protected final String TEXT_525 = NL + "\t\t\tprivate "; - protected final String TEXT_526 = " createDomainModelRemoveCommand("; - protected final String TEXT_527 = " editingDomain) {"; - protected final String TEXT_528 = NL + "\t\t\t\t"; - protected final String TEXT_529 = " result = new "; + protected final String TEXT_55 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_56 = ".UNSET_VALUE));"; + protected final String TEXT_57 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_58 = NL + "\t\t\t\treturn "; + protected final String TEXT_59 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_60 = ".eINSTANCE.get"; + protected final String TEXT_61 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; + protected final String TEXT_62 = NL + "\t\t\t\treturn "; + protected final String TEXT_63 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_64 = ".eINSTANCE.get"; + protected final String TEXT_65 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_66 = ".UNSET_VALUE);"; + protected final String TEXT_67 = NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_68 = NL + "\t\tinstallEditPolicy("; + protected final String TEXT_69 = ".LAYOUT_ROLE, new "; + protected final String TEXT_70 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_71 = " getCreateCommand("; + protected final String TEXT_72 = " request) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_73 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_74 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_75 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_76 = " createChangeConstraintCommand("; + protected final String TEXT_77 = " child, Object constraint) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_78 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_79 = " createChildEditPolicy("; + protected final String TEXT_80 = " child) {" + NL + "\t\t\t\treturn new "; + protected final String TEXT_81 = "() {" + NL + "\t\t\t\t\tpublic "; + protected final String TEXT_82 = " getTargetEditPart("; + protected final String TEXT_83 = " request) {" + NL + "\t\t\t\t\t\tif ("; + protected final String TEXT_84 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_85 = ".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_86 = ".GRAPHICAL_NODE_ROLE, new "; + protected final String TEXT_87 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_88 = " getReconnectTargetCommand("; + protected final String TEXT_89 = " request) {"; + protected final String TEXT_90 = " " + NL + "\t\t\t\treturn "; + protected final String TEXT_91 = ".INSTANCE;"; + protected final String TEXT_92 = NL + "\t\t\t\t"; + protected final String TEXT_93 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; + protected final String TEXT_94 = " == false) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_95 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_96 = " edge = ("; + protected final String TEXT_97 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; + protected final String TEXT_98 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; + protected final String TEXT_99 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_100 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_101 = " result = null;" + NL + "\t\t\t\tint visualID = "; + protected final String TEXT_102 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; + protected final String TEXT_103 = NL + "\t\t\t\tcase "; + protected final String TEXT_104 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; + protected final String TEXT_105 = "TargetCommand(request);" + NL + "\t\t\t\t\tbreak;"; + protected final String TEXT_106 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_107 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_108 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; + protected final String TEXT_109 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_110 = " getReconnectSourceCommand("; + protected final String TEXT_111 = " request) {"; + protected final String TEXT_112 = " " + NL + "\t\t\t\treturn "; + protected final String TEXT_113 = ".INSTANCE;"; + protected final String TEXT_114 = NL + "\t\t\t\t"; + protected final String TEXT_115 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; + protected final String TEXT_116 = " == false) {" + 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 = " edge = ("; + protected final String TEXT_119 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; + protected final String TEXT_120 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; + protected final String TEXT_121 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_122 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_123 = " result = null;" + NL + "\t\t\t\tint visualID = "; + protected final String TEXT_124 = ".getVisualID(edge);" + 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\tresult = new Reconnect"; + protected final String TEXT_127 = "SourceCommand(request);" + NL + "\t\t\t\t\tbreak;"; + protected final String TEXT_128 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_129 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_130 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; + protected final String TEXT_131 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_132 = " getConnectionCreateCommand("; + protected final String TEXT_133 = " request) {"; + protected final String TEXT_134 = NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_135 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_136 = ".CreateConnectionRequestEx requestEx = ("; + protected final String TEXT_137 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_138 = " result = new "; + protected final String TEXT_139 = "();" + 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_140 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_141 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_142 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_143 = 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_144 = " wrappedResult = new WrappingCommand("; + protected final String TEXT_145 = ".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_146 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_147 = " getConnectionCompleteCommand("; + protected final String TEXT_148 = " request) {"; + protected final String TEXT_149 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_150 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_151 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_152 = ".CreateConnectionRequestEx requestEx = ("; + protected final String TEXT_153 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_154 = " result = new "; + protected final String TEXT_155 = "();" + 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_156 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_157 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_158 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_159 = 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_160 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_161 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_162 = NL + "\t\t\t\treturn "; + protected final String TEXT_163 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_164 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_165 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_166 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_167 = " invisibleRectangle = new "; + protected final String TEXT_168 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; + protected final String TEXT_169 = "());" + NL + "\t\t"; + protected final String TEXT_170 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; + protected final String TEXT_171 = " 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_172 = " createNodeShape() {"; + protected final String TEXT_173 = NL + "\t\tprimaryShape = new "; + protected final String TEXT_174 = "()"; + protected final String TEXT_175 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_176 = ";"; + protected final String TEXT_177 = NL + "\t\tprimaryShape = "; + protected final String TEXT_178 = ";"; + protected final String TEXT_179 = NL + "\t\t"; + protected final String TEXT_180 = " figure = new "; + protected final String TEXT_181 = "();"; + protected final String TEXT_182 = NL + " \t\tfigure.setUseLocalCoordinates(true);"; + protected final String TEXT_183 = NL + " \t\tprimaryShape = figure;"; + protected final String TEXT_184 = NL + "\t\treturn primaryShape;" + NL + "\t}"; + protected final String TEXT_185 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_186 = " getPrimaryShape() {" + NL + "\t\treturn ("; + protected final String TEXT_187 = ") primaryShape;" + NL + "\t}"; + protected final String TEXT_188 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_189 = " createDecorationPane() {" + NL + "\t\t"; + protected final String TEXT_190 = " view = ("; + protected final String TEXT_191 = ") getModel();" + NL + "\t\t"; + protected final String TEXT_192 = " 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_193 = " decorationPane = new "; + protected final String TEXT_194 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; + protected final String TEXT_195 = "());" + NL + "" + NL + "\t\t"; + protected final String TEXT_196 = " imageFigure = new "; + protected final String TEXT_197 = "("; + protected final String TEXT_198 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; + protected final String TEXT_199 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; + protected final String TEXT_200 = ".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_201 = " setupContentPane("; + protected final String TEXT_202 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; + protected final String TEXT_203 = NL + "\t\t\t"; + protected final String TEXT_204 = " layout = new "; + protected final String TEXT_205 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; + protected final String TEXT_206 = NL + "\t\tnodeShape.setLayoutManager(new "; + protected final String TEXT_207 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; + protected final String TEXT_208 = " 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_209 = "(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_210 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_211 = " getContentPane() {" + NL + "\t\tif (contentPane == null) {" + NL + "\t\t\treturn super.getContentPane();" + NL + "\t\t}" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_212 = " getDiagramNode() {" + NL + "\t\treturn ("; + protected final String TEXT_213 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_214 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; + protected final String TEXT_215 = " childEditPart) {"; + protected final String TEXT_216 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_217 = ") {" + NL + "\t\t\t(("; + protected final String TEXT_218 = ") childEditPart)."; + protected final String TEXT_219 = "(getPrimaryShape()."; + protected final String TEXT_220 = "());" + NL + "\t\t\treturn true;" + NL + "\t\t}"; + protected final String TEXT_221 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_222 = ") {" + NL + "\t\t\t"; + protected final String TEXT_223 = " pane = getPrimaryShape()."; + protected final String TEXT_224 = "();" + NL + "\t\t\tsetupContentPane(pane); // FIXME each comparment should handle his content pane in his own way " + NL + "\t\t\tpane.add((("; + protected final String TEXT_225 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; + protected final String TEXT_226 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean removeFixedChild(EditPart childEditPart) {"; + protected final String TEXT_227 = "\t\t" + NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_228 = ") {" + NL + "\t\t\t"; + protected final String TEXT_229 = " pane = getPrimaryShape()."; + protected final String TEXT_230 = "();" + NL + "\t\t\tpane.remove((("; + protected final String TEXT_231 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; + protected final String TEXT_232 = NL + "\t\treturn false;" + NL + "\t}"; + protected final String TEXT_233 = 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_234 = " getPrimaryLabelEditPart() {"; + protected final String TEXT_235 = NL + "\t\tfor("; + protected final String TEXT_236 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_237 = " nextChild = ("; + protected final String TEXT_238 = ")it.next();" + NL + "\t\t\tif ("; + protected final String TEXT_239 = ".getVisualID(nextChild) == "; + protected final String TEXT_240 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_241 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_242 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_243 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_244 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; + protected final String TEXT_245 = " labelToEdit;" + NL + "\t\t\tif (req instanceof "; + protected final String TEXT_246 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart(("; + protected final String TEXT_247 = ")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_248 = " getLabelEditPart("; + protected final String TEXT_249 = " req) {" + NL + "\t\t"; + protected final String TEXT_250 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; + protected final String TEXT_251 = " view = ("; + protected final String TEXT_252 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; + protected final String TEXT_253 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; + protected final String TEXT_254 = NL + "\t\t\t\tcase "; + protected final String TEXT_255 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; + protected final String TEXT_256 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; + protected final String TEXT_257 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; + protected final String TEXT_258 = " childEditPart) {"; + protected final String TEXT_259 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_260 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; + protected final String TEXT_261 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_262 = " getExternalLabelsContainer() {" + NL + "\t\t"; + protected final String TEXT_263 = " root = ("; + protected final String TEXT_264 = ") getRoot();" + NL + "\t\treturn root.getLayer("; + protected final String TEXT_265 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; + protected final String TEXT_266 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; + protected final String TEXT_267 = " childEditPart, int index) {"; + protected final String TEXT_268 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; + protected final String TEXT_269 = " labelFigure = (("; + protected final String TEXT_270 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_271 = NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_272 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; + protected final String TEXT_273 = " childEditPart) {"; + protected final String TEXT_274 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; + protected final String TEXT_275 = " labelFigure = (("; + protected final String TEXT_276 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_277 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_278 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}"; + protected final String TEXT_279 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor ("; + protected final String TEXT_280 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t"; + protected final String TEXT_281 = " childEditPart = ("; + protected final String TEXT_282 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = (("; + protected final String TEXT_283 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}"; + protected final String TEXT_284 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t\trefreshBackgroundColor();" + NL + "\t\trefreshForegroundColor();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + 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 + "\tprotected void refreshBounds() {" + NL + "\t\t"; + protected final String TEXT_285 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; + protected final String TEXT_286 = ";" + NL + "\t\t"; + protected final String TEXT_287 = " bounds = ("; + protected final String TEXT_288 = ") node.getLayoutConstraint();" + NL + "\t\t(("; + protected final String TEXT_289 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; + protected final String TEXT_290 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_291 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_292 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_293 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_294 = " getSourceConnectionAnchor("; + protected final String TEXT_295 = " connection) {" + NL + "\t\treturn new "; + protected final String TEXT_296 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_297 = " getSourceConnectionAnchor("; + protected final String TEXT_298 = " request) {" + NL + "\t\treturn new "; + protected final String TEXT_299 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_300 = " getTargetConnectionAnchor("; + protected final String TEXT_301 = " connection) {" + NL + "\t\treturn new "; + protected final String TEXT_302 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_303 = " getTargetConnectionAnchor("; + protected final String TEXT_304 = " request) {" + NL + "\t\treturn new "; + protected final String TEXT_305 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; + protected final String TEXT_306 = 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);"; + protected final String TEXT_307 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_308 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; + protected final String TEXT_309 = NL + "\t\tuninstallLinkNotationModelRefresher();"; + protected final String TEXT_310 = NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}"; + protected final String TEXT_311 = NL; + protected final String TEXT_312 = 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_313 = " domainModelEditDomain = "; + protected final String TEXT_314 = ".getEditingDomain("; + protected final String TEXT_315 = ".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_316 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_317 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_318 = " 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_319 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; + protected final String TEXT_320 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

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_321 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_322 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_323 = 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_324 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_325 = ".createEventTypeFilter("; + protected final String TEXT_326 = ".SET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_327 = ".createEventTypeFilter("; + protected final String TEXT_328 = ".UNSET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_329 = ".createEventTypeFilter("; + protected final String TEXT_330 = ".REMOVE).or(" + NL + "\t\t\t\t"; + protected final String TEXT_331 = ".createEventTypeFilter("; + protected final String TEXT_332 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; + protected final String TEXT_333 = 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_334 = NL; + protected final String TEXT_335 = NL + "\t\t\tfilter = "; + protected final String TEXT_336 = ".createFeatureFilter("; + protected final String TEXT_337 = ".eINSTANCE.get"; + protected final String TEXT_338 = "());"; + protected final String TEXT_339 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_340 = ".createFeatureFilter("; + protected final String TEXT_341 = ".eINSTANCE.get"; + protected final String TEXT_342 = "()));"; + protected final String TEXT_343 = NL; + protected final String TEXT_344 = NL + "\t\t\tfilter = "; + protected final String TEXT_345 = ".createFeatureFilter("; + protected final String TEXT_346 = ".eINSTANCE.get"; + protected final String TEXT_347 = "());"; + protected final String TEXT_348 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_349 = ".createFeatureFilter("; + protected final String TEXT_350 = ".eINSTANCE.get"; + protected final String TEXT_351 = "()));"; + protected final String TEXT_352 = NL; + protected final String TEXT_353 = NL + "\t\t\tfilter = "; + protected final String TEXT_354 = ".createFeatureFilter("; + protected final String TEXT_355 = ".eINSTANCE.get"; + protected final String TEXT_356 = "());"; + protected final String TEXT_357 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_358 = ".createFeatureFilter("; + protected final String TEXT_359 = ".eINSTANCE.get"; + protected final String TEXT_360 = "()));"; + protected final String TEXT_361 = NL; + protected final String TEXT_362 = NL + "\t\t\tfilter = "; + protected final String TEXT_363 = ".createFeatureFilter("; + protected final String TEXT_364 = ".eINSTANCE.get"; + protected final String TEXT_365 = "());"; + protected final String TEXT_366 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_367 = ".createFeatureFilter("; + protected final String TEXT_368 = ".eINSTANCE.get"; + protected final String TEXT_369 = "()));"; + protected final String TEXT_370 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; + protected final String TEXT_371 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();"; + protected final String TEXT_372 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; + protected final String TEXT_373 = NL + "\t\t\tfilter = createUncontainedLinksFilter();"; + protected final String TEXT_374 = NL + "\t\t\tfilter = "; + protected final String TEXT_375 = ".ANY.negated();"; + protected final String TEXT_376 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_377 = " 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_378 = " transactionAboutToCommit("; + protected final String TEXT_379 = " 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_380 = " 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_381 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_382 = " domainModelEditDomain = "; + protected final String TEXT_383 = ".getEditingDomain("; + protected final String TEXT_384 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL; + protected final String TEXT_385 = NL; + protected final String TEXT_386 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_387 = " mySource;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_388 = " myDestination;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_389 = " 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_390 = " source, "; + protected final String TEXT_391 = " destination, "; + protected final String TEXT_392 = " 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_393 = " source, "; + protected final String TEXT_394 = " 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_395 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_396 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_397 = " 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_398 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_399 = "/**/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t"; + protected final String TEXT_400 = "/**/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal "; + protected final String TEXT_401 = " semanticToNotationalTypeBasedLinks = new "; + protected final String TEXT_402 = "();" + NL + "\t\tfinal "; + protected final String TEXT_403 = "/*>*/ semanticToNotationalFeatureBasedLinks = new "; + protected final String TEXT_404 = "();" + NL + "\t\tfor("; + protected final String TEXT_405 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_406 = " next = ("; + protected final String TEXT_407 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_408 = " 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_409 = " featureBasedLinksForSource = ("; + protected final String TEXT_410 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new "; + protected final String TEXT_411 = "();" + 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_412 = " parentView = "; + protected final String TEXT_413 = ";" + NL + "\t\t"; + protected final String TEXT_414 = " command = new "; + protected final String TEXT_415 = "();" + NL + "\t\tfor("; + protected final String TEXT_416 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t"; + protected final String TEXT_417 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t"; + protected final String TEXT_418 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = ("; + protected final String TEXT_419 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; + protected final String TEXT_420 = " featureBasedLinksForSource = ("; + protected final String TEXT_421 = ") 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_422 = ") 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_423 = ".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_424 = " 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_425 = "(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_426 = "(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_427 = "(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_428 = " 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_429 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_430 = " 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_431 = "(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_432 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_433 = " obsoleteView = ("; + protected final String TEXT_434 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_435 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_436 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_437 = " obsoleteViews = ("; + protected final String TEXT_438 = ") it.next();" + NL + "\t\t\tfor("; + protected final String TEXT_439 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t"; + protected final String TEXT_440 = " obsoleteView = ("; + protected final String TEXT_441 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_442 = "(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_443 = " findView("; + protected final String TEXT_444 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_445 = " editPart = ("; + protected final String TEXT_446 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof "; + protected final String TEXT_447 = ") {" + NL + "\t\t\treturn ("; + protected final String TEXT_448 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_449 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t"; + protected final String TEXT_450 = " 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_451 = " findNode("; + protected final String TEXT_452 = " parentView, "; + protected final String TEXT_453 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_454 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_455 = " next = ("; + protected final String TEXT_456 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t"; + protected final String TEXT_457 = " 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_458 = " findEdge("; + protected final String TEXT_459 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_460 = " it = "; + protected final String TEXT_461 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_462 = " next = ("; + protected final String TEXT_463 = ") 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_464 = " getCreateNotationalEdgeCommand("; + protected final String TEXT_465 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t"; + protected final String TEXT_466 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t"; + protected final String TEXT_467 = " 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_468 = " createdEdge = "; + protected final String TEXT_469 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {"; + protected final String TEXT_470 = NL + "\t\tcase "; + protected final String TEXT_471 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof "; + protected final String TEXT_472 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t"; + protected final String TEXT_473 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_474 = NL + "\t\tcase "; + protected final String TEXT_475 = ".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_476 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_477 = 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_478 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_479 = " getSemanticChildLinks() {"; + protected final String TEXT_480 = NL; + protected final String TEXT_481 = "\t"; + protected final String TEXT_482 = " result = new "; + protected final String TEXT_483 = "();"; + protected final String TEXT_484 = NL + "\t"; + protected final String TEXT_485 = " modelObject = "; + protected final String TEXT_486 = ";" + NL + "\t"; + protected final String TEXT_487 = " nextValue;"; + protected final String TEXT_488 = NL + "\tint linkVID;"; + protected final String TEXT_489 = NL + "\tfor("; + protected final String TEXT_490 = " it = (("; + protected final String TEXT_491 = ")modelObject)."; + protected final String TEXT_492 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_493 = ") it.next();"; + protected final String TEXT_494 = NL + "\tnextValue = (("; + protected final String TEXT_495 = ")modelObject)."; + protected final String TEXT_496 = "();"; + protected final String TEXT_497 = NL + "\tlinkVID = "; + protected final String TEXT_498 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; + protected final String TEXT_499 = NL + "\tswitch (linkVID) {"; + protected final String TEXT_500 = NL + "\tcase "; + protected final String TEXT_501 = ".VISUAL_ID: {"; + protected final String TEXT_502 = NL + "\tif ("; + protected final String TEXT_503 = ".VISUAL_ID == linkVID) {"; + protected final String TEXT_504 = NL + "\t\t"; + protected final String TEXT_505 = " source = (("; + protected final String TEXT_506 = ")nextValue)."; + protected final String TEXT_507 = "();"; + protected final String TEXT_508 = NL + "\t\t"; + protected final String TEXT_509 = " source = "; + protected final String TEXT_510 = ";"; + protected final String TEXT_511 = NL + "\t\t"; + protected final String TEXT_512 = " target = (("; + protected final String TEXT_513 = ")nextValue)."; + protected final String TEXT_514 = "();"; + protected final String TEXT_515 = NL + "\t\t"; + protected final String TEXT_516 = " target = "; + protected final String TEXT_517 = ";"; + protected final String TEXT_518 = 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_519 = NL + "\t\tbreak;" + NL + "\t}"; + protected final String TEXT_520 = NL + "\t}"; + protected final String TEXT_521 = NL + "\t}"; + protected final String TEXT_522 = NL + "\t}"; + protected final String TEXT_523 = NL + "\tfor("; + protected final String TEXT_524 = " it = (("; + protected final String TEXT_525 = ")modelObject)."; + protected final String TEXT_526 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_527 = ") it.next();"; + protected final String TEXT_528 = NL + "\tnextValue = (("; + protected final String TEXT_529 = ")modelObject)."; protected final String TEXT_530 = "();"; - protected final String TEXT_531 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_532 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_533 = ".getElement().eContainer(), "; - protected final String TEXT_534 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_535 = ".getElement()));"; - protected final String TEXT_536 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_537 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_538 = ".getElement().eContainer(), "; - protected final String TEXT_539 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_540 = ".UNSET_VALUE));"; - protected final String TEXT_541 = NL + "\t\t\t\treturn "; - protected final String TEXT_542 = ".INSTANCE;"; - protected final String TEXT_543 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_544 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_545 = ".getElement().eContainer(), "; - protected final String TEXT_546 = ".eINSTANCE.get"; - protected final String TEXT_547 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_548 = ".getElement()));"; - protected final String TEXT_549 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_550 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_551 = ".getElement().eContainer(), "; - protected final String TEXT_552 = ".eINSTANCE.get"; - protected final String TEXT_553 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_554 = ".UNSET_VALUE));"; - protected final String TEXT_555 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_556 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_557 = ".getElement(), "; - protected final String TEXT_558 = ".eINSTANCE.get"; - protected final String TEXT_559 = "(), "; - protected final String TEXT_560 = ".getSource().getElement()));"; - protected final String TEXT_561 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_562 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_563 = ".getElement(), "; - protected final String TEXT_564 = ".eINSTANCE.get"; - protected final String TEXT_565 = "(), "; - protected final String TEXT_566 = ".UNSET_VALUE));"; - protected final String TEXT_567 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_568 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_569 = ".getElement(), "; - protected final String TEXT_570 = ".eINSTANCE.get"; - protected final String TEXT_571 = "(), "; - protected final String TEXT_572 = ".getTarget().getElement()));"; - protected final String TEXT_573 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_574 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_575 = ".getElement(), "; - protected final String TEXT_576 = ".eINSTANCE.get"; - protected final String TEXT_577 = "(), "; - protected final String TEXT_578 = ".UNSET_VALUE));"; - protected final String TEXT_579 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_580 = NL + "\t\t\t\treturn "; - protected final String TEXT_581 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_582 = ".getSource().getElement(), "; - protected final String TEXT_583 = ".eINSTANCE.get"; - protected final String TEXT_584 = "(), "; - protected final String TEXT_585 = ".getTarget().getElement());"; - protected final String TEXT_586 = NL + "\t\t\t\treturn "; - protected final String TEXT_587 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_588 = ".getSource().getElement(), "; - protected final String TEXT_589 = ".eINSTANCE.get"; - protected final String TEXT_590 = "(), "; - protected final String TEXT_591 = ".UNSET_VALUE);"; - protected final String TEXT_592 = NL + "\t\t\t}"; - protected final String TEXT_593 = NL + "\t}" + NL; - protected final String TEXT_594 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; - protected final String TEXT_595 = "StartCommand extends "; - protected final String TEXT_596 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_597 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_598 = "StartCommand("; - protected final String TEXT_599 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\t//Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart()." + NL + "\t\t\tsource = ("; - protected final String TEXT_600 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {" + NL + "\t\t\tif (source == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_601 = NL + "\t\t\treturn false;"; - protected final String TEXT_602 = NL + "\t\t\t"; - protected final String TEXT_603 = " container = ("; - protected final String TEXT_604 = ")getRelationshipContainer(source.getElement(), "; - protected final String TEXT_605 = ".eINSTANCE.get"; - protected final String TEXT_606 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_607 = NL; - protected final String TEXT_608 = NL + "\t\tif ("; - protected final String TEXT_609 = "."; - protected final String TEXT_610 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_611 = NL + "\t\t}"; - protected final String TEXT_612 = NL + "\t\tif ("; - protected final String TEXT_613 = "."; - protected final String TEXT_614 = "().size() >= "; - protected final String TEXT_615 = ".eINSTANCE.get"; - protected final String TEXT_616 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_617 = NL + "\t\t}"; - protected final String TEXT_618 = NL; - protected final String TEXT_619 = NL + "\t\tif ("; - protected final String TEXT_620 = "."; - protected final String TEXT_621 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_622 = NL + "\t\t}"; - protected final String TEXT_623 = NL + "\t\tif ("; - protected final String TEXT_624 = "."; - protected final String TEXT_625 = "().size() >= "; - protected final String TEXT_626 = ".eINSTANCE.get"; - protected final String TEXT_627 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_628 = NL + "\t\t}"; - protected final String TEXT_629 = NL; - protected final String TEXT_630 = NL + "\t\t\tif(!"; - protected final String TEXT_631 = ".canCreateLink("; - protected final String TEXT_632 = ", "; - protected final String TEXT_633 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_634 = NL + "\t\t\treturn true;"; - protected final String TEXT_635 = NL; - protected final String TEXT_636 = NL + "\t\tif ("; - protected final String TEXT_637 = "."; - protected final String TEXT_638 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_639 = NL + "\t\t}"; - protected final String TEXT_640 = NL + "\t\tif ("; - protected final String TEXT_641 = "."; - protected final String TEXT_642 = "().size() >= "; - protected final String TEXT_643 = ".eINSTANCE.get"; - protected final String TEXT_644 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_645 = NL + "\t\t}"; - protected final String TEXT_646 = NL; - protected final String TEXT_647 = NL + "\t\t\tif(!"; - protected final String TEXT_648 = ".canCreateLink("; - protected final String TEXT_649 = ", "; - protected final String TEXT_650 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_651 = NL + "\t\t\treturn true;"; - protected final String TEXT_652 = NL + "\t\t\treturn false;"; - protected final String TEXT_653 = NL + "\t\t}"; - protected final String TEXT_654 = NL; - protected final String TEXT_655 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_656 = " getRelationshipContainer("; - protected final String TEXT_657 = " element, "; - protected final String TEXT_658 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_659 = NL + NL + "\t}"; - protected final String TEXT_660 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; - protected final String TEXT_661 = "TargetCommand extends "; - protected final String TEXT_662 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_663 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_664 = " newTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_665 = " oldTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_666 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_667 = "TargetCommand("; - protected final String TEXT_668 = " request) {" + NL + "\t\t\tthis(("; - protected final String TEXT_669 = ")request.getConnectionEditPart().getModel(), ("; - protected final String TEXT_670 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_671 = "TargetCommand("; - protected final String TEXT_672 = " edge, "; - protected final String TEXT_673 = " newTarget) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newTarget = newTarget;" + NL + "\t\t\tthis.oldTarget = edge.getTarget();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.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\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; - protected final String TEXT_674 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; - protected final String TEXT_675 = " domainModelEditDomain = "; - protected final String TEXT_676 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_677 = " command = new "; - protected final String TEXT_678 = "() {" + NL + "\t\t\t\tprivate "; - protected final String TEXT_679 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; - protected final String TEXT_680 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; - protected final String TEXT_681 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; - protected final String TEXT_682 = NL; - protected final String TEXT_683 = NL + "\t\t\tif(!"; - protected final String TEXT_684 = ".canCreateLink("; - protected final String TEXT_685 = ", "; - protected final String TEXT_686 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_687 = NL + "\t\t\treturn true;"; + protected final String TEXT_531 = NL + "\tif (nextValue != null) {"; + protected final String TEXT_532 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, "; + protected final String TEXT_533 = ".VISUAL_ID));"; + protected final String TEXT_534 = NL + "\t}"; + protected final String TEXT_535 = NL + "\t}"; + protected final String TEXT_536 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_537 = " getNotationalChildLinks() {" + NL + "\t\t"; + protected final String TEXT_538 = " result = new "; + protected final String TEXT_539 = "();" + NL + "\t\t"; + protected final String TEXT_540 = " allLinks = "; + protected final String TEXT_541 = ".getEdges();" + NL + "\t\tfor("; + protected final String TEXT_542 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_543 = " next = ("; + protected final String TEXT_544 = ") it.next();"; + protected final String TEXT_545 = 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_546 = " 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_547 = " 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_548 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == "; + protected final String TEXT_549 = ") {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_550 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_551 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_552 = ".VISUAL_ID:"; + protected final String TEXT_553 = 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_554 = NL + "\t\t\t} else {"; + protected final String TEXT_555 = NL + "\t\t\t}"; + protected final String TEXT_556 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {"; + protected final String TEXT_557 = NL + "\t\t\t\tif (next.getElement().eContainer() == "; + protected final String TEXT_558 = ") {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_559 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_560 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_561 = ".VISUAL_ID:"; + protected final String TEXT_562 = 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_563 = 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_564 = ". " + 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_565 = ";" + NL + "\t}"; + protected final String TEXT_566 = NL; + protected final String TEXT_567 = NL; + protected final String TEXT_568 = "\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_569 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_570 = " 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_571 = ") 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_572 = NL; + protected final String TEXT_573 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher("; + protected final String TEXT_574 = " 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_575 = " 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_576 = " 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; + protected final String TEXT_577 = NL; + protected final String TEXT_578 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_579 = NL + "\t\t"; + protected final String TEXT_580 = " style =" + NL + "\t\t\t("; + protected final String TEXT_581 = ") "; + protected final String TEXT_582 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_583 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_584 = " 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_585 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_586 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_587 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_588 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_589 = " 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_590 = "(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_591 = "\t" + NL + "\t}"; + protected final String TEXT_592 = 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_593 = " createdFont;"; + protected final String TEXT_594 = "\t" + NL; + protected final String TEXT_595 = NL; + protected final String TEXT_596 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; + protected final String TEXT_597 = " style = ("; + protected final String TEXT_598 = ") "; + protected final String TEXT_599 = ".getStyle("; + protected final String TEXT_600 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; + protected final String TEXT_601 = " toDispose = createdForegroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint foregroundColor = style.getLineColor();" + NL + "\t\t\tint red = foregroundColor & 0x000000FF;" + NL + "\t\t\tint green = (foregroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (foregroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; + protected final String TEXT_602 = " currentColor = getFigure().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\tcreatedForegroundColor = new "; + protected final String TEXT_603 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdForegroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedForegroundColor = 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 #refreshForegroundColor()}) currently assigned to the figure." + 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_604 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; + protected final String TEXT_605 = " style = ("; + protected final String TEXT_606 = ") "; + protected final String TEXT_607 = ".getStyle("; + protected final String TEXT_608 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; + protected final String TEXT_609 = " toDispose = createdBackgroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint backgroundColor = style.getFillColor();" + NL + "\t\t\tint red = backgroundColor & 0x000000FF;" + NL + "\t\t\tint green = (backgroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (backgroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; + protected final String TEXT_610 = " currentColor = getFigure().getBackgroundColor();" + 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\tcreatedBackgroundColor = new "; + protected final String TEXT_611 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setBackgroundColor(createdBackgroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setBackgroundColor(getViewer().getControl().getBackground());" + 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 #refreshBackgroundColor()}) currently assigned to the figure." + 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_612 = " createdBackgroundColor;" + NL; + protected final String TEXT_613 = NL; + protected final String TEXT_614 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_615 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_616 = " feature, "; + protected final String TEXT_617 = " 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 "; + protected final String TEXT_618 = "();"; + protected final String TEXT_619 = NL; + protected final String TEXT_620 = "\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_621 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_622 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_623 = NL; + protected final String TEXT_624 = "\t\tRefresher boundsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBounds();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_625 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_626 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_627 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_628 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_629 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; + protected final String TEXT_630 = NL; + protected final String TEXT_631 = "\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_632 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; + protected final String TEXT_633 = NL; + protected final String TEXT_634 = "\t\tRefresher sourceEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshSourceConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_635 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; + protected final String TEXT_636 = NL; + protected final String TEXT_637 = "\t\tRefresher targetEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshTargetConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_638 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; + protected final String TEXT_639 = NL; + protected final String TEXT_640 = "\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_641 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_642 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_643 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_644 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; + protected final String TEXT_645 = NL; + protected final String TEXT_646 = "\t\tRefresher backgroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBackgroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_647 = ".eINSTANCE.getFillStyle_FillColor(), backgroundColorRefresher);" + NL + "\t\tRefresher foregroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshForegroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_648 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; + protected final String TEXT_649 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; + protected final String TEXT_650 = "SourceCommand extends "; + protected final String TEXT_651 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_652 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_653 = " newSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_654 = " oldSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_655 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_656 = "SourceCommand("; + protected final String TEXT_657 = " request) {" + NL + "\t\t\tthis(("; + protected final String TEXT_658 = ")request.getConnectionEditPart().getModel(), ("; + protected final String TEXT_659 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_660 = "SourceCommand("; + protected final String TEXT_661 = " edge, "; + protected final String TEXT_662 = " newSource) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newSource = newSource;" + NL + "\t\t\tthis.oldSource = edge.getSource();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.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\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; + protected final String TEXT_663 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; + protected final String TEXT_664 = " domainModelEditDomain = "; + protected final String TEXT_665 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_666 = " command = new "; + protected final String TEXT_667 = "() {" + NL + "\t\t\t\tprivate "; + protected final String TEXT_668 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; + protected final String TEXT_669 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; + protected final String TEXT_670 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; + protected final String TEXT_671 = NL + "\t\t\treturn false;"; + protected final String TEXT_672 = NL + "\t\t\t"; + protected final String TEXT_673 = " container = ("; + protected final String TEXT_674 = ")getRelationshipContainer(newSource.getElement(), "; + protected final String TEXT_675 = ".eINSTANCE.get"; + protected final String TEXT_676 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_677 = NL; + protected final String TEXT_678 = NL + "\t\tif ("; + protected final String TEXT_679 = "."; + protected final String TEXT_680 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_681 = NL + "\t\t}"; + protected final String TEXT_682 = NL + "\t\tif ("; + protected final String TEXT_683 = "."; + protected final String TEXT_684 = "().size() >= "; + protected final String TEXT_685 = ".eINSTANCE.get"; + protected final String TEXT_686 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_687 = NL + "\t\t}"; protected final String TEXT_688 = NL; - protected final String TEXT_689 = NL + "\t\t\tif(!"; - protected final String TEXT_690 = ".canCreateLink("; - protected final String TEXT_691 = ", "; - protected final String TEXT_692 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_693 = NL + "\t\t\treturn true;"; - protected final String TEXT_694 = NL + "\t\t\treturn false;"; - protected final String TEXT_695 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_696 = " createReconnectCommand() {" + NL + "\t\t\t"; - protected final String TEXT_697 = " editingDomain = "; - protected final String TEXT_698 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_699 = " result = new "; - protected final String TEXT_700 = "();" + NL + "\t\t\tresult.append(new "; - protected final String TEXT_701 = "(edge, newTarget));"; - protected final String TEXT_702 = NL + "\t\t\tresult.append("; - protected final String TEXT_703 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_704 = ".eINSTANCE.get"; - protected final String TEXT_705 = "()," + NL + "\t\t\t\toldTarget.getElement()));" + NL + "\t\t\tresult.append("; - protected final String TEXT_706 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_707 = ".eINSTANCE.get"; - protected final String TEXT_708 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; - protected final String TEXT_709 = NL + "\t\t\tresult.append("; - protected final String TEXT_710 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_711 = ".eINSTANCE.get"; - protected final String TEXT_712 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; - protected final String TEXT_713 = NL + "\t\t\tresult.append("; - protected final String TEXT_714 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; - protected final String TEXT_715 = ".eINSTANCE.get"; - protected final String TEXT_716 = "(), oldTarget.getElement()));" + NL + "\t\t\tresult.append("; - protected final String TEXT_717 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; - protected final String TEXT_718 = ".eINSTANCE.get"; - protected final String TEXT_719 = "(), newTarget.getElement()));"; - protected final String TEXT_720 = NL + "\t\t\tresult.append("; - protected final String TEXT_721 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; - protected final String TEXT_722 = ".eINSTANCE.get"; - protected final String TEXT_723 = "(), newTarget.getElement()));"; - protected final String TEXT_724 = NL + "\t\t\treturn result;" + NL + "\t\t}"; - protected final String TEXT_725 = NL; - protected final String TEXT_726 = NL + "\t\t\tprivate "; - protected final String TEXT_727 = " createDomainModelRemoveCommand("; - protected final String TEXT_728 = " editingDomain) {"; - protected final String TEXT_729 = NL + "\t\t\t\t"; - protected final String TEXT_730 = " result = new "; - protected final String TEXT_731 = "();"; - protected final String TEXT_732 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_733 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_734 = ".getElement().eContainer(), "; - protected final String TEXT_735 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_736 = ".getElement()));"; + protected final String TEXT_689 = NL + "\t\tif ("; + protected final String TEXT_690 = "."; + protected final String TEXT_691 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_692 = NL + "\t\t}"; + protected final String TEXT_693 = NL + "\t\tif ("; + protected final String TEXT_694 = "."; + protected final String TEXT_695 = "().size() >= "; + protected final String TEXT_696 = ".eINSTANCE.get"; + protected final String TEXT_697 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_698 = NL + "\t\t}"; + protected final String TEXT_699 = NL; + protected final String TEXT_700 = NL + "\t\t\tif(!"; + protected final String TEXT_701 = ".canCreateLink("; + protected final String TEXT_702 = ", "; + protected final String TEXT_703 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_704 = NL + "\t\t\treturn true;"; + protected final String TEXT_705 = NL; + protected final String TEXT_706 = NL + "\t\tif ("; + protected final String TEXT_707 = "."; + protected final String TEXT_708 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_709 = NL + "\t\t}"; + protected final String TEXT_710 = NL + "\t\tif ("; + protected final String TEXT_711 = "."; + protected final String TEXT_712 = "().size() >= "; + protected final String TEXT_713 = ".eINSTANCE.get"; + protected final String TEXT_714 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_715 = NL + "\t\t}"; + protected final String TEXT_716 = NL; + protected final String TEXT_717 = NL + "\t\t\tif(!"; + protected final String TEXT_718 = ".canCreateLink("; + protected final String TEXT_719 = ", "; + protected final String TEXT_720 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_721 = NL + "\t\t\treturn true;"; + protected final String TEXT_722 = NL + "\t\t\treturn false;"; + protected final String TEXT_723 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_724 = " createReconnectCommand() {" + NL + "\t\t\t"; + protected final String TEXT_725 = " editingDomain = "; + protected final String TEXT_726 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_727 = " result = new "; + protected final String TEXT_728 = "();" + NL + "\t\t\tresult.append(new "; + protected final String TEXT_729 = "(edge, newSource));"; + protected final String TEXT_730 = NL + "\t\t\t"; + protected final String TEXT_731 = " container = getRelationshipContainer(newSource.getElement(), "; + protected final String TEXT_732 = ".eINSTANCE.get"; + protected final String TEXT_733 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_734 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_735 = " oldContainer = edge.getElement().eContainer();" + NL + "\t\t\tif (oldContainer == null) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_736 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tif (oldContainer != container) {"; protected final String TEXT_737 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_738 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_739 = ".getElement().eContainer(), "; - protected final String TEXT_740 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_738 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), edge.getElement()));"; + protected final String TEXT_739 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_740 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), "; protected final String TEXT_741 = ".UNSET_VALUE));"; - protected final String TEXT_742 = NL + "\t\t\t\treturn "; - protected final String TEXT_743 = ".INSTANCE;"; - protected final String TEXT_744 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_745 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_746 = ".getElement().eContainer(), "; - protected final String TEXT_747 = ".eINSTANCE.get"; - protected final String TEXT_748 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_749 = ".getElement()));"; + protected final String TEXT_742 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_743 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; + protected final String TEXT_744 = ".eINSTANCE.get"; + protected final String TEXT_745 = "(), edge.getElement()));"; + protected final String TEXT_746 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_747 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; + protected final String TEXT_748 = ".eINSTANCE.get"; + protected final String TEXT_749 = "()," + NL + "\t\t\t\t\tedge.getElement()));"; protected final String TEXT_750 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_751 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_752 = ".getElement().eContainer(), "; - protected final String TEXT_753 = ".eINSTANCE.get"; - protected final String TEXT_754 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_755 = ".UNSET_VALUE));"; - protected final String TEXT_756 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_757 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_758 = ".getElement(), "; - protected final String TEXT_759 = ".eINSTANCE.get"; - protected final String TEXT_760 = "(), "; - protected final String TEXT_761 = ".getSource().getElement()));"; - protected final String TEXT_762 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_763 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_764 = ".getElement(), "; + protected final String TEXT_751 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; + protected final String TEXT_752 = ".eINSTANCE.get"; + protected final String TEXT_753 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_754 = ".UNSET_VALUE));"; + protected final String TEXT_755 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_756 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; + protected final String TEXT_757 = ".eINSTANCE.get"; + protected final String TEXT_758 = "(), edge.getElement()));"; + protected final String TEXT_759 = NL + "\t\t\t}"; + protected final String TEXT_760 = NL + "\t\t\tresult.append("; + protected final String TEXT_761 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_762 = ".eINSTANCE.get"; + protected final String TEXT_763 = "()," + NL + "\t\t\t\toldSource.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_764 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; protected final String TEXT_765 = ".eINSTANCE.get"; - protected final String TEXT_766 = "(), "; - protected final String TEXT_767 = ".UNSET_VALUE));"; - protected final String TEXT_768 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_769 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_770 = ".getElement(), "; - protected final String TEXT_771 = ".eINSTANCE.get"; - protected final String TEXT_772 = "(), "; - protected final String TEXT_773 = ".getTarget().getElement()));"; - protected final String TEXT_774 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_775 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_776 = ".getElement(), "; - protected final String TEXT_777 = ".eINSTANCE.get"; - protected final String TEXT_778 = "(), "; - protected final String TEXT_779 = ".UNSET_VALUE));"; - protected final String TEXT_780 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_781 = NL + "\t\t\t\treturn "; - protected final String TEXT_782 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_783 = ".getSource().getElement(), "; + protected final String TEXT_766 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; + protected final String TEXT_767 = NL + "\t\t\tresult.append("; + protected final String TEXT_768 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_769 = ".eINSTANCE.get"; + protected final String TEXT_770 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; + protected final String TEXT_771 = NL + "\t\t\tresult.append("; + protected final String TEXT_772 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; + protected final String TEXT_773 = ".eINSTANCE.get"; + protected final String TEXT_774 = "(), edge.getTarget().getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_775 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; + protected final String TEXT_776 = ".eINSTANCE.get"; + protected final String TEXT_777 = "(), edge.getTarget().getElement()));"; + protected final String TEXT_778 = NL + "\t\t\tresult.append("; + protected final String TEXT_779 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; + protected final String TEXT_780 = ".eINSTANCE.get"; + protected final String TEXT_781 = "(), "; + protected final String TEXT_782 = ".UNSET_VALUE));" + NL + "\t\t\tresult.append("; + protected final String TEXT_783 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; protected final String TEXT_784 = ".eINSTANCE.get"; - protected final String TEXT_785 = "(), "; - protected final String TEXT_786 = ".getTarget().getElement());"; - protected final String TEXT_787 = NL + "\t\t\t\treturn "; - protected final String TEXT_788 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_789 = ".getSource().getElement(), "; - protected final String TEXT_790 = ".eINSTANCE.get"; - protected final String TEXT_791 = "(), "; - protected final String TEXT_792 = ".UNSET_VALUE);"; - protected final String TEXT_793 = NL + "\t\t\t}"; - protected final String TEXT_794 = NL + "\t}" + NL; - protected final String TEXT_795 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; - protected final String TEXT_796 = "Command extends "; - protected final String TEXT_797 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_798 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_799 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_800 = " createdEdge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_801 = "Command("; - protected final String TEXT_802 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; - protected final String TEXT_803 = ") {" + NL + "\t\t\t\tsource = ("; - protected final String TEXT_804 = ")requestEx.getSourceEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\tsource = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (requestEx.getTargetEditPart().getModel() instanceof "; - protected final String TEXT_805 = ") {" + NL + "\t\t\t\ttarget = ("; - protected final String TEXT_806 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\ttarget = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (source == null || target == null) {" + NL + "\t\t\t\tcreatedEdge = null;" + NL + "\t\t\t\tdomainModelAddCommand = "; - protected final String TEXT_807 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = "; - protected final String TEXT_808 = ".eINSTANCE.createEdge();"; - protected final String TEXT_809 = NL + "\t\t\t"; - protected final String TEXT_810 = " createdDomainElement = "; - protected final String TEXT_811 = ".eINSTANCE.create"; - protected final String TEXT_812 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t"; - protected final String TEXT_813 = NL + "\t\t\t"; - protected final String TEXT_814 = "."; - protected final String TEXT_815 = ".initializeElement(createdDomainElement);"; - protected final String TEXT_816 = NL + "\t\t\tcreatedEdge.setElement(null);"; - protected final String TEXT_817 = NL + "\t\t\t"; - protected final String TEXT_818 = ".decorateView(createdEdge);" + NL + "\t\t\t"; - protected final String TEXT_819 = " domainModelEditDomain = "; - protected final String TEXT_820 = ".getEditingDomain(source.getDiagram().getElement());"; - protected final String TEXT_821 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; - protected final String TEXT_822 = NL + "\t\t\t"; - protected final String TEXT_823 = " container = getRelationshipContainer(source.getElement(), "; - protected final String TEXT_824 = ".eINSTANCE.get"; - protected final String TEXT_825 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\tdomainModelAddCommand = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_826 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; - protected final String TEXT_827 = ".eINSTANCE.get"; - protected final String TEXT_828 = "(), createdDomainElement));"; - protected final String TEXT_829 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_830 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; - protected final String TEXT_831 = ".eINSTANCE.get"; - protected final String TEXT_832 = "(), createdDomainElement));"; - protected final String TEXT_833 = NL; - protected final String TEXT_834 = NL + "\t\tif ("; - protected final String TEXT_835 = "."; - protected final String TEXT_836 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_837 = NL + "\t\t}"; - protected final String TEXT_838 = NL + "\t\tif ("; - protected final String TEXT_839 = "."; - protected final String TEXT_840 = "().size() >= "; - protected final String TEXT_841 = ".eINSTANCE.get"; - protected final String TEXT_842 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_843 = NL + "\t\t}"; - protected final String TEXT_844 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_845 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; - protected final String TEXT_846 = ".eINSTANCE.get"; - protected final String TEXT_847 = "(), source.getElement()));"; - protected final String TEXT_848 = NL; - protected final String TEXT_849 = NL + "\t\tif ("; - protected final String TEXT_850 = "."; - protected final String TEXT_851 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_852 = NL + "\t\t}"; - protected final String TEXT_853 = NL + "\t\tif ("; - protected final String TEXT_854 = "."; - protected final String TEXT_855 = "().size() >= "; - protected final String TEXT_856 = ".eINSTANCE.get"; - protected final String TEXT_857 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_858 = NL + "\t\t}"; - protected final String TEXT_859 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_860 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; - protected final String TEXT_861 = ".eINSTANCE.get"; - protected final String TEXT_862 = "(), target.getElement()));"; - protected final String TEXT_863 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; - protected final String TEXT_864 = NL + "\t\t\tdomainModelAddCommand = "; - protected final String TEXT_865 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; - protected final String TEXT_866 = ".eINSTANCE.get"; - protected final String TEXT_867 = "(), target.getElement());"; - protected final String TEXT_868 = NL + "\t\t}" + NL; - protected final String TEXT_869 = NL; - protected final String TEXT_870 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_871 = " getRelationshipContainer("; - protected final String TEXT_872 = " element, "; - protected final String TEXT_873 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_874 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\tif (source == null || target == null || createdEdge == null || domainModelAddCommand == null || !domainModelAddCommand.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_785 = "(), edge.getTarget().getElement()));"; + protected final String TEXT_786 = NL + "\t\t\treturn result;" + NL + "\t\t}" + NL; + protected final String TEXT_787 = NL; + protected final String TEXT_788 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_789 = " getRelationshipContainer("; + protected final String TEXT_790 = " element, "; + protected final String TEXT_791 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; + protected final String TEXT_792 = NL; + protected final String TEXT_793 = NL + "\t\t\tprivate "; + protected final String TEXT_794 = " createDomainModelRemoveCommand("; + protected final String TEXT_795 = " editingDomain) {"; + protected final String TEXT_796 = NL + "\t\t\t\t"; + protected final String TEXT_797 = " result = new "; + protected final String TEXT_798 = "();"; + protected final String TEXT_799 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_800 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_801 = ".getElement().eContainer(), "; + protected final String TEXT_802 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_803 = ".getElement()));"; + protected final String TEXT_804 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_805 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_806 = ".getElement().eContainer(), "; + protected final String TEXT_807 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_808 = ".UNSET_VALUE));"; + protected final String TEXT_809 = NL + "\t\t\t\treturn "; + protected final String TEXT_810 = ".INSTANCE;"; + protected final String TEXT_811 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_812 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_813 = ".getElement().eContainer(), "; + protected final String TEXT_814 = ".eINSTANCE.get"; + protected final String TEXT_815 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_816 = ".getElement()));"; + protected final String TEXT_817 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_818 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_819 = ".getElement().eContainer(), "; + protected final String TEXT_820 = ".eINSTANCE.get"; + protected final String TEXT_821 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_822 = ".UNSET_VALUE));"; + protected final String TEXT_823 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_824 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_825 = ".getElement(), "; + protected final String TEXT_826 = ".eINSTANCE.get"; + protected final String TEXT_827 = "(), "; + protected final String TEXT_828 = ".getSource().getElement()));"; + protected final String TEXT_829 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_830 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_831 = ".getElement(), "; + protected final String TEXT_832 = ".eINSTANCE.get"; + protected final String TEXT_833 = "(), "; + protected final String TEXT_834 = ".UNSET_VALUE));"; + protected final String TEXT_835 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_836 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_837 = ".getElement(), "; + protected final String TEXT_838 = ".eINSTANCE.get"; + protected final String TEXT_839 = "(), "; + protected final String TEXT_840 = ".getTarget().getElement()));"; + protected final String TEXT_841 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_842 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_843 = ".getElement(), "; + protected final String TEXT_844 = ".eINSTANCE.get"; + protected final String TEXT_845 = "(), "; + protected final String TEXT_846 = ".UNSET_VALUE));"; + protected final String TEXT_847 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_848 = NL + "\t\t\t\treturn "; + protected final String TEXT_849 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_850 = ".getSource().getElement(), "; + protected final String TEXT_851 = ".eINSTANCE.get"; + protected final String TEXT_852 = "(), "; + protected final String TEXT_853 = ".getTarget().getElement());"; + protected final String TEXT_854 = NL + "\t\t\t\treturn "; + protected final String TEXT_855 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_856 = ".getSource().getElement(), "; + protected final String TEXT_857 = ".eINSTANCE.get"; + protected final String TEXT_858 = "(), "; + protected final String TEXT_859 = ".UNSET_VALUE);"; + protected final String TEXT_860 = NL + "\t\t\t}"; + protected final String TEXT_861 = NL + "\t}" + NL; + protected final String TEXT_862 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; + protected final String TEXT_863 = "StartCommand extends "; + protected final String TEXT_864 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_865 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_866 = "StartCommand("; + protected final String TEXT_867 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\t//Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart()." + NL + "\t\t\tsource = ("; + protected final String TEXT_868 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {" + NL + "\t\t\tif (source == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_869 = NL + "\t\t\treturn false;"; + protected final String TEXT_870 = NL + "\t\t\t"; + protected final String TEXT_871 = " container = ("; + protected final String TEXT_872 = ")getRelationshipContainer(source.getElement(), "; + protected final String TEXT_873 = ".eINSTANCE.get"; + protected final String TEXT_874 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; protected final String TEXT_875 = NL; - protected final String TEXT_876 = NL + "\t\t\tif(!"; - protected final String TEXT_877 = ".canCreateLink("; - protected final String TEXT_878 = ", "; - protected final String TEXT_879 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_880 = NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + 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_881 = NL; - protected final String TEXT_882 = NL; - protected final String TEXT_883 = 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_884 = NL + "}"; - protected final String TEXT_885 = NL; + protected final String TEXT_876 = NL + "\t\tif ("; + protected final String TEXT_877 = "."; + protected final String TEXT_878 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_879 = NL + "\t\t}"; + protected final String TEXT_880 = NL + "\t\tif ("; + protected final String TEXT_881 = "."; + protected final String TEXT_882 = "().size() >= "; + protected final String TEXT_883 = ".eINSTANCE.get"; + protected final String TEXT_884 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_885 = NL + "\t\t}"; + protected final String TEXT_886 = NL; + protected final String TEXT_887 = NL + "\t\tif ("; + protected final String TEXT_888 = "."; + protected final String TEXT_889 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_890 = NL + "\t\t}"; + protected final String TEXT_891 = NL + "\t\tif ("; + protected final String TEXT_892 = "."; + protected final String TEXT_893 = "().size() >= "; + protected final String TEXT_894 = ".eINSTANCE.get"; + protected final String TEXT_895 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_896 = NL + "\t\t}"; + protected final String TEXT_897 = NL; + protected final String TEXT_898 = NL + "\t\t\tif(!"; + protected final String TEXT_899 = ".canCreateLink("; + protected final String TEXT_900 = ", "; + protected final String TEXT_901 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_902 = NL + "\t\t\treturn true;"; + protected final String TEXT_903 = NL; + protected final String TEXT_904 = NL + "\t\tif ("; + protected final String TEXT_905 = "."; + protected final String TEXT_906 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_907 = NL + "\t\t}"; + protected final String TEXT_908 = NL + "\t\tif ("; + protected final String TEXT_909 = "."; + protected final String TEXT_910 = "().size() >= "; + protected final String TEXT_911 = ".eINSTANCE.get"; + protected final String TEXT_912 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_913 = NL + "\t\t}"; + protected final String TEXT_914 = NL; + protected final String TEXT_915 = NL + "\t\t\tif(!"; + protected final String TEXT_916 = ".canCreateLink("; + protected final String TEXT_917 = ", "; + protected final String TEXT_918 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_919 = NL + "\t\t\treturn true;"; + protected final String TEXT_920 = NL + "\t\t\treturn false;"; + protected final String TEXT_921 = NL + "\t\t}"; + protected final String TEXT_922 = NL; + protected final String TEXT_923 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_924 = " getRelationshipContainer("; + protected final String TEXT_925 = " element, "; + protected final String TEXT_926 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; + protected final String TEXT_927 = NL + NL + "\t}"; + protected final String TEXT_928 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; + protected final String TEXT_929 = "TargetCommand extends "; + protected final String TEXT_930 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_931 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_932 = " newTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_933 = " oldTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_934 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_935 = "TargetCommand("; + protected final String TEXT_936 = " request) {" + NL + "\t\t\tthis(("; + protected final String TEXT_937 = ")request.getConnectionEditPart().getModel(), ("; + protected final String TEXT_938 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_939 = "TargetCommand("; + protected final String TEXT_940 = " edge, "; + protected final String TEXT_941 = " newTarget) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newTarget = newTarget;" + NL + "\t\t\tthis.oldTarget = edge.getTarget();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.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\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; + protected final String TEXT_942 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; + protected final String TEXT_943 = " domainModelEditDomain = "; + protected final String TEXT_944 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_945 = " command = new "; + protected final String TEXT_946 = "() {" + NL + "\t\t\t\tprivate "; + protected final String TEXT_947 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; + protected final String TEXT_948 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; + protected final String TEXT_949 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; + protected final String TEXT_950 = NL; + protected final String TEXT_951 = NL + "\t\t\tif(!"; + protected final String TEXT_952 = ".canCreateLink("; + protected final String TEXT_953 = ", "; + protected final String TEXT_954 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_955 = NL + "\t\t\treturn true;"; + protected final String TEXT_956 = NL; + protected final String TEXT_957 = NL + "\t\t\tif(!"; + protected final String TEXT_958 = ".canCreateLink("; + protected final String TEXT_959 = ", "; + protected final String TEXT_960 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_961 = NL + "\t\t\treturn true;"; + protected final String TEXT_962 = NL + "\t\t\treturn false;"; + protected final String TEXT_963 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_964 = " createReconnectCommand() {" + NL + "\t\t\t"; + protected final String TEXT_965 = " editingDomain = "; + protected final String TEXT_966 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_967 = " result = new "; + protected final String TEXT_968 = "();" + NL + "\t\t\tresult.append(new "; + protected final String TEXT_969 = "(edge, newTarget));"; + protected final String TEXT_970 = NL + "\t\t\tresult.append("; + protected final String TEXT_971 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_972 = ".eINSTANCE.get"; + protected final String TEXT_973 = "()," + NL + "\t\t\t\toldTarget.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_974 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_975 = ".eINSTANCE.get"; + protected final String TEXT_976 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; + protected final String TEXT_977 = NL + "\t\t\tresult.append("; + protected final String TEXT_978 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_979 = ".eINSTANCE.get"; + protected final String TEXT_980 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; + protected final String TEXT_981 = NL + "\t\t\tresult.append("; + protected final String TEXT_982 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; + protected final String TEXT_983 = ".eINSTANCE.get"; + protected final String TEXT_984 = "(), oldTarget.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_985 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; + protected final String TEXT_986 = ".eINSTANCE.get"; + protected final String TEXT_987 = "(), newTarget.getElement()));"; + protected final String TEXT_988 = NL + "\t\t\tresult.append("; + protected final String TEXT_989 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; + protected final String TEXT_990 = ".eINSTANCE.get"; + protected final String TEXT_991 = "(), newTarget.getElement()));"; + protected final String TEXT_992 = NL + "\t\t\treturn result;" + NL + "\t\t}"; + protected final String TEXT_993 = NL; + protected final String TEXT_994 = NL + "\t\t\tprivate "; + protected final String TEXT_995 = " createDomainModelRemoveCommand("; + protected final String TEXT_996 = " editingDomain) {"; + protected final String TEXT_997 = NL + "\t\t\t\t"; + protected final String TEXT_998 = " result = new "; + protected final String TEXT_999 = "();"; + protected final String TEXT_1000 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1001 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1002 = ".getElement().eContainer(), "; + protected final String TEXT_1003 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_1004 = ".getElement()));"; + protected final String TEXT_1005 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1006 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1007 = ".getElement().eContainer(), "; + protected final String TEXT_1008 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_1009 = ".UNSET_VALUE));"; + protected final String TEXT_1010 = NL + "\t\t\t\treturn "; + protected final String TEXT_1011 = ".INSTANCE;"; + protected final String TEXT_1012 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1013 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1014 = ".getElement().eContainer(), "; + protected final String TEXT_1015 = ".eINSTANCE.get"; + protected final String TEXT_1016 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_1017 = ".getElement()));"; + protected final String TEXT_1018 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1019 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1020 = ".getElement().eContainer(), "; + protected final String TEXT_1021 = ".eINSTANCE.get"; + protected final String TEXT_1022 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_1023 = ".UNSET_VALUE));"; + protected final String TEXT_1024 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1025 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1026 = ".getElement(), "; + protected final String TEXT_1027 = ".eINSTANCE.get"; + protected final String TEXT_1028 = "(), "; + protected final String TEXT_1029 = ".getSource().getElement()));"; + protected final String TEXT_1030 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1031 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1032 = ".getElement(), "; + protected final String TEXT_1033 = ".eINSTANCE.get"; + protected final String TEXT_1034 = "(), "; + protected final String TEXT_1035 = ".UNSET_VALUE));"; + protected final String TEXT_1036 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1037 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1038 = ".getElement(), "; + protected final String TEXT_1039 = ".eINSTANCE.get"; + protected final String TEXT_1040 = "(), "; + protected final String TEXT_1041 = ".getTarget().getElement()));"; + protected final String TEXT_1042 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1043 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1044 = ".getElement(), "; + protected final String TEXT_1045 = ".eINSTANCE.get"; + protected final String TEXT_1046 = "(), "; + protected final String TEXT_1047 = ".UNSET_VALUE));"; + protected final String TEXT_1048 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_1049 = NL + "\t\t\t\treturn "; + protected final String TEXT_1050 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1051 = ".getSource().getElement(), "; + protected final String TEXT_1052 = ".eINSTANCE.get"; + protected final String TEXT_1053 = "(), "; + protected final String TEXT_1054 = ".getTarget().getElement());"; + protected final String TEXT_1055 = NL + "\t\t\t\treturn "; + protected final String TEXT_1056 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1057 = ".getSource().getElement(), "; + protected final String TEXT_1058 = ".eINSTANCE.get"; + protected final String TEXT_1059 = "(), "; + protected final String TEXT_1060 = ".UNSET_VALUE);"; + protected final String TEXT_1061 = NL + "\t\t\t}"; + protected final String TEXT_1062 = NL + "\t}" + NL; + protected final String TEXT_1063 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; + protected final String TEXT_1064 = "Command extends "; + protected final String TEXT_1065 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_1066 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_1067 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_1068 = " createdEdge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_1069 = "Command("; + protected final String TEXT_1070 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; + protected final String TEXT_1071 = ") {" + NL + "\t\t\t\tsource = ("; + protected final String TEXT_1072 = ")requestEx.getSourceEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\tsource = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (requestEx.getTargetEditPart().getModel() instanceof "; + protected final String TEXT_1073 = ") {" + NL + "\t\t\t\ttarget = ("; + protected final String TEXT_1074 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\ttarget = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (source == null || target == null) {" + NL + "\t\t\t\tcreatedEdge = null;" + NL + "\t\t\t\tdomainModelAddCommand = "; + protected final String TEXT_1075 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = "; + protected final String TEXT_1076 = ".eINSTANCE.createEdge();"; + protected final String TEXT_1077 = NL + "\t\t\t"; + protected final String TEXT_1078 = " createdDomainElement = "; + protected final String TEXT_1079 = ".eINSTANCE.create"; + protected final String TEXT_1080 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t"; + protected final String TEXT_1081 = NL + "\t\t\t"; + protected final String TEXT_1082 = "."; + protected final String TEXT_1083 = ".initializeElement(createdDomainElement);"; + protected final String TEXT_1084 = NL + "\t\t\tcreatedEdge.setElement(null);"; + protected final String TEXT_1085 = NL + "\t\t\t"; + protected final String TEXT_1086 = ".decorateView(createdEdge);" + NL + "\t\t\t"; + protected final String TEXT_1087 = " domainModelEditDomain = "; + protected final String TEXT_1088 = ".getEditingDomain(source.getDiagram().getElement());"; + protected final String TEXT_1089 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; + protected final String TEXT_1090 = NL + "\t\t\t"; + protected final String TEXT_1091 = " container = getRelationshipContainer(source.getElement(), "; + protected final String TEXT_1092 = ".eINSTANCE.get"; + protected final String TEXT_1093 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\tdomainModelAddCommand = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_1094 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; + protected final String TEXT_1095 = ".eINSTANCE.get"; + protected final String TEXT_1096 = "(), createdDomainElement));"; + protected final String TEXT_1097 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_1098 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; + protected final String TEXT_1099 = ".eINSTANCE.get"; + protected final String TEXT_1100 = "(), createdDomainElement));"; + protected final String TEXT_1101 = NL; + protected final String TEXT_1102 = NL + "\t\tif ("; + protected final String TEXT_1103 = "."; + protected final String TEXT_1104 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_1105 = NL + "\t\t}"; + protected final String TEXT_1106 = NL + "\t\tif ("; + protected final String TEXT_1107 = "."; + protected final String TEXT_1108 = "().size() >= "; + protected final String TEXT_1109 = ".eINSTANCE.get"; + protected final String TEXT_1110 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_1111 = NL + "\t\t}"; + protected final String TEXT_1112 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_1113 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; + protected final String TEXT_1114 = ".eINSTANCE.get"; + protected final String TEXT_1115 = "(), source.getElement()));"; + protected final String TEXT_1116 = NL; + protected final String TEXT_1117 = NL + "\t\tif ("; + protected final String TEXT_1118 = "."; + protected final String TEXT_1119 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_1120 = NL + "\t\t}"; + protected final String TEXT_1121 = NL + "\t\tif ("; + protected final String TEXT_1122 = "."; + protected final String TEXT_1123 = "().size() >= "; + protected final String TEXT_1124 = ".eINSTANCE.get"; + protected final String TEXT_1125 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_1126 = NL + "\t\t}"; + protected final String TEXT_1127 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_1128 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; + protected final String TEXT_1129 = ".eINSTANCE.get"; + protected final String TEXT_1130 = "(), target.getElement()));"; + protected final String TEXT_1131 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; + protected final String TEXT_1132 = NL + "\t\t\tdomainModelAddCommand = "; + protected final String TEXT_1133 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; + protected final String TEXT_1134 = ".eINSTANCE.get"; + protected final String TEXT_1135 = "(), target.getElement());"; + protected final String TEXT_1136 = NL + "\t\t}" + NL; + protected final String TEXT_1137 = NL; + protected final String TEXT_1138 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_1139 = " getRelationshipContainer("; + protected final String TEXT_1140 = " element, "; + protected final String TEXT_1141 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; + protected final String TEXT_1142 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\tif (source == null || target == null || createdEdge == null || domainModelAddCommand == null || !domainModelAddCommand.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_1143 = NL; + protected final String TEXT_1144 = NL + "\t\t\tif(!"; + protected final String TEXT_1145 = ".canCreateLink("; + protected final String TEXT_1146 = ", "; + protected final String TEXT_1147 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_1148 = NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + 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_1149 = NL; + protected final String TEXT_1150 = NL; + protected final String TEXT_1151 = 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_1152 = NL + "}"; + protected final String TEXT_1153 = NL; public String generate(Object argument) { @@ -915,6 +1183,8 @@ Palette palette = genDiagram.getPalette(); boolean isXYLayout = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genNode); final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc +importManager.registerInnerClass("LinkDescriptor"); //from linkNotationModelRefresher.jetinc class NodeEditPartHelper { private final List myInnerLabels = new LinkedList(); @@ -922,6 +1192,8 @@ private final List myExternalLabels = new LinkedList(); private final List myPinnedCompartments = new LinkedList(); private final List myFloatingCompartments = new LinkedList(); + private final List myContainedFeatureModelFacetLinks = new LinkedList(); + private final List myContainedTypeModelFacetLinks = new LinkedList(); private GenNodeLabel myPrimaryLabel; private boolean myHasChildrenInListCompartments = false; private boolean hasIncomingLinks = false; @@ -963,24 +1235,51 @@ } GenClass incomingClass; GenClass outgoingClass; + GenClass containerClass; if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); incomingClass = modelFacet.getTargetMetaFeature().getTypeGenClass(); outgoingClass = modelFacet.getSourceMetaFeature() == null ? modelFacet.getContainmentMetaFeature().getGenClass() : modelFacet.getSourceMetaFeature().getTypeGenClass(); + if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) { + //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link. + containerClass = null; + } else { + containerClass = modelFacet.getContainmentMetaFeature().getGenClass(); + } } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); incomingClass = metaFeature.getTypeGenClass(); outgoingClass = metaFeature.getGenClass(); + containerClass = metaFeature.getGenClass(); } else { continue; } hasIncomingLinks |= (incomingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())); hasOutgoingLinks |= (outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())); + if (containerClass != null && containerClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())) { + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + myContainedTypeModelFacetLinks.add(genLink); + } else { + myContainedFeatureModelFacetLinks.add(genLink); + } + } } } + public boolean containsLinks() { + return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks(); + } + + public boolean containsFeatureModelFacetLinks() { + return !myContainedFeatureModelFacetLinks.isEmpty(); + } + + public boolean containsTypeModelFacetLinks() { + return !myContainedTypeModelFacetLinks.isEmpty(); + } + public boolean hasIncomingLinks() { return hasIncomingLinks; } @@ -1028,6 +1327,14 @@ public Iterator getAllInnerLabels() { return myAllInnerLabels.iterator(); } + + public Iterator getContainedFeatureModelFacetLinks() { + return myContainedFeatureModelFacetLinks.iterator(); + } + + public Iterator getContainedTypeModelFacetLinks() { + return myContainedTypeModelFacetLinks.iterator(); + } } final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode); @@ -1072,26 +1379,36 @@ stringBuffer.append(TEXT_17); stringBuffer.append(TEXT_18); stringBuffer.append(TEXT_19); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_20); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_21); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_22); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_23); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_24); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_25); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); stringBuffer.append(TEXT_26); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); stringBuffer.append(TEXT_27); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_28); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); stringBuffer.append(TEXT_29); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_30); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_31); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_32); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_33); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); + stringBuffer.append(TEXT_34); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_35); { TypeModelFacet facet = genNode.getModelFacet(); @@ -1099,166 +1416,166 @@ GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_38); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_41); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_42); } else { - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_45); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_47); } if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_50); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_51); } else { - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_54); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_55); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_56); } - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_57); } else { if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_60); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_61); } else { - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_64); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_66); } } - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_67); } /*restrict local vars used in component edit policy*/ - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_73); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_84); stringBuffer.append(genNode.getEditPartClassName()); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy")); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_89); if (!myHelper.hasIncomingLinks()) { - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_91); } else { - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_94); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_102); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1282,58 +1599,58 @@ continue; } - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_104); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_105); } - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_108); } - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_111); if (!myHelper.hasOutgoingLinks()) { - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_113); } else { - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_124); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1359,40 +1676,40 @@ continue; } - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_126); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_127); } - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_128); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_130); } - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_131); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_133); if (palette != null && myHelper.hasOutgoingLinks()) { - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_134); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_137); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_139); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1418,40 +1735,40 @@ continue; } - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_140); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_141); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_142); } - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_145); }/*when there's palette*/ - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_148); if (palette != null && myHelper.hasIncomingLinks()) { - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_155); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1475,38 +1792,46 @@ continue; } - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_157); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_158); } - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_161); }/*when there's palette*/ - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_163); + +if (myHelper.containsLinks()) { + + stringBuffer.append(TEXT_164); + +} + + stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_169); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_172); String figureQualifiedClassName = null; Viewmap viewmap = genNode.getViewmap(); @@ -1516,98 +1841,98 @@ figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure"; } - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_174); if (isXYLayout) { - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_175); } /* use flow layout*/ - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_176); } else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_177); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_178); } else if (viewmap instanceof InnerClassViewmap) { figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_179); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_180); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_181); if (!genNode.getChildNodes().isEmpty() && isXYLayout) { /*otherwise, leave to figure's default value*/ - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_182); } - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_183); } - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_184); if (figureQualifiedClassName != null) { - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_185); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_186); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_187); } - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_188); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_200); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_202); if (!isXYLayout) { String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout"); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_203); stringBuffer.append(layoutClassName); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_204); stringBuffer.append(layoutClassName); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_205); } else { - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_209); } - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_213); if (myHelper.hasFixedChildren()) { - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_215); for (Iterator it = myHelper.getInnerFixedLabels(); it.hasNext(); ) { GenNodeLabel genLabel = (GenNodeLabel) it.next(); @@ -1615,15 +1940,15 @@ final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) genLabel.getViewmap(); final String childSetterName = childViewmap.getSetterName() == null ? "setLabel" : childViewmap.getSetterName(); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_216); stringBuffer.append(labelEditPart); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_217); stringBuffer.append(labelEditPart); - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_218); stringBuffer.append(childSetterName); - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_219); stringBuffer.append(childViewmap.getGetterName()); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_220); } @@ -1632,19 +1957,19 @@ final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap(); String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName()); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_221); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_222); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_223); stringBuffer.append(childViewmap.getGetterName()); - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_224); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_225); } // for pinned compartments - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_226); //XXX: ignore labels assuming that they never may be removed for (Iterator it = myHelper.getPinnedCompartments(); it.hasNext(); ) { @@ -1652,25 +1977,25 @@ final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap(); String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName()); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_227); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_229); stringBuffer.append(childViewmap.getGetterName()); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_230); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_231); } // for pinned compartments - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_232); } // if myHelper.hasFixedChildren() - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_233); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_234); GenNodeLabel firstEditableLabel = null; for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) { @@ -1682,45 +2007,45 @@ } if (firstEditableLabel != null) { - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_235); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_236); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_237); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_238); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName(firstEditableLabel.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_240); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_241); } - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_242); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_243); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_244); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_245); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_246); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_248); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_249); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_250); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_251); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_252); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_253); for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) { GenNodeLabel genLabel = (GenNodeLabel) it.next(); @@ -1728,302 +2053,1105 @@ continue; } - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_254); stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_255); } - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_256); if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_257); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_258); for (Iterator externalLabels = myHelper.getExternalLabels(); externalLabels.hasNext();) { GenNodeLabel next = (GenNodeLabel) externalLabels.next(); - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_260); } - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_261); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_262); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager")); - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_263); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager")); - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_264); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_265); } if (myHelper.hasExternalLabels() || myHelper.hasFixedChildren()) { - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_266); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_267); if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_268); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_269); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_270); } if (myHelper.hasFixedChildren()) { - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_271); } - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_272); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_273); if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_274); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_275); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_276); } if (myHelper.hasFixedChildren()){ - stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_277); } - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_278); } if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_279); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_272); + stringBuffer.append(TEXT_280); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_273); + stringBuffer.append(TEXT_281); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_274); + stringBuffer.append(TEXT_282); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_275); + stringBuffer.append(TEXT_283); } - stringBuffer.append(TEXT_276); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_277); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_278); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_279); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_280); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_281); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_282); - stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_283); - stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_284); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_285); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_286); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_287); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_288); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); stringBuffer.append(TEXT_289); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_290); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_291); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_292); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_293); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); - stringBuffer.append(TEXT_294); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(TEXT_294); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); stringBuffer.append(TEXT_295); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_296); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); + stringBuffer.append(TEXT_296); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); stringBuffer.append(TEXT_297); - /*@ include file="adapters/propertySource.javajetinc"*/ + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_298); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); stringBuffer.append(TEXT_299); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); stringBuffer.append(TEXT_300); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); stringBuffer.append(TEXT_301); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); stringBuffer.append(TEXT_302); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); stringBuffer.append(TEXT_303); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_304); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); stringBuffer.append(TEXT_305); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + /*@ include file="adapters/propertySource.javajetinc"*/ stringBuffer.append(TEXT_306); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + +if (myHelper.containsLinks()) { + stringBuffer.append(TEXT_307); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + +} + stringBuffer.append(TEXT_308); - final String primaryView = "getDiagramNode()"; +if (myHelper.containsLinks()) { stringBuffer.append(TEXT_309); -boolean isFixedFontSetInFigure; -{ - StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class); - isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } stringBuffer.append(TEXT_310); -if (!isFixedFontSetInFigure) { +{ + final String _getViewCode = "getDiagramNode()"; + final String _getDiagramCode = "getDiagramNode().getDiagram()"; + final String _getSemanticElementCode = "getDiagramNode().getElement()"; + final boolean _includeUncontainedLinks = false; stringBuffer.append(TEXT_311); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); + +if (myHelper.containsLinks() || _includeUncontainedLinks) { + stringBuffer.append(TEXT_312); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_313); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_314); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(_getDiagramCode); stringBuffer.append(TEXT_315); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); stringBuffer.append(TEXT_316); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_317); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_318); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + + boolean hasConstraintsInContainedLinks = false; + for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) { + hasConstraintsInContainedLinks = true; + break; + } + } + if (hasConstraintsInContainedLinks) { + stringBuffer.append(TEXT_319); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); stringBuffer.append(TEXT_320); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_321); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_322); -} + } + if (_includeUncontainedLinks) { stringBuffer.append(TEXT_323); - -if (!isFixedFontSetInFigure) { - + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_324); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_325); - -} - + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_326); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_327); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_328); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_329); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_330); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_331); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_332); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + + } + stringBuffer.append(TEXT_333); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + + { + boolean hasDeclaredFilter = false; + Set genAffectingFeatures = new LinkedHashSet(); + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (modelFacet == null) { + continue; + } + GenFeature _feature = modelFacet.getChildMetaFeature(); + stringBuffer.append(TEXT_334); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + stringBuffer.append(TEXT_335); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_336); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_337); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_338); - stringBuffer.append(primaryView); + + } else { + stringBuffer.append(TEXT_339); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_340); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_341); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_342); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + + } + + + _feature = modelFacet.getSourceMetaFeature(); + stringBuffer.append(TEXT_343); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + stringBuffer.append(TEXT_344); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_345); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_346); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_347); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + + } else { + stringBuffer.append(TEXT_348); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_349); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_350); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_351); + + } + + + _feature = modelFacet.getTargetMetaFeature(); + stringBuffer.append(TEXT_352); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + stringBuffer.append(TEXT_353); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_354); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_355); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_356); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + + } else { + stringBuffer.append(TEXT_357); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_358); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_359); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_360); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + + } + + + } + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature(); + stringBuffer.append(TEXT_361); + + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; + stringBuffer.append(TEXT_362); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_363); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_364); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_365); + + } else { + stringBuffer.append(TEXT_366); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); stringBuffer.append(TEXT_367); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_368); + stringBuffer.append(_feature.getFeatureAccessorName()); stringBuffer.append(TEXT_369); + + } + + + } + if (hasConstraintsInContainedLinks) { + if (hasDeclaredFilter) { + + stringBuffer.append(TEXT_370); + + } else { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_371); + + } + } + if (_includeUncontainedLinks) { + if (hasDeclaredFilter) { + + stringBuffer.append(TEXT_372); + + } else { + hasDeclaredFilter = true; + + stringBuffer.append(TEXT_373); + + } + } + if (!hasDeclaredFilter) { + + stringBuffer.append(TEXT_374); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_375); + + } + } //local declaration of hasDeclaredFilter + + stringBuffer.append(TEXT_376); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_377); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_378); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); + stringBuffer.append(TEXT_379); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); + stringBuffer.append(TEXT_380); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_381); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(TEXT_382); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(TEXT_383); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_384); + stringBuffer.append(TEXT_385); + /*inner class*/ + stringBuffer.append(TEXT_386); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_387); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_388); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_389); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_390); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_391); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_392); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_393); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_394); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_395); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_396); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_397); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_398); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_399); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_400); + stringBuffer.append(importManager.getImportedName("java.util.Map")); + stringBuffer.append(TEXT_401); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(TEXT_402); + stringBuffer.append(importManager.getImportedName("java.util.Map")); + stringBuffer.append(TEXT_403); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(TEXT_404); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_405); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_406); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_407); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_408); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_409); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_410); + stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(TEXT_411); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_412); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_413); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_414); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_415); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_416); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_417); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_418); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_419); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_420); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_421); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_422); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_423); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); + stringBuffer.append(TEXT_424); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); + stringBuffer.append(TEXT_425); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_426); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_427); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_428); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")); + stringBuffer.append(TEXT_429); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_430); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")); + stringBuffer.append(TEXT_431); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_432); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_433); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_434); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_435); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_436); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_437); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_438); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_439); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_440); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_441); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); + stringBuffer.append(TEXT_442); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_443); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_444); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_445); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_446); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_447); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_448); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_449); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_450); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_451); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_452); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_453); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_454); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_455); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_456); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_457); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_458); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_459); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_460); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_461); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_462); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_463); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); + stringBuffer.append(TEXT_464); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_465); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_466); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_467); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_468); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); + stringBuffer.append(TEXT_469); + + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (modelFacet == null) { + continue; + } + + stringBuffer.append(TEXT_470); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_471); + stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_472); + stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); + stringBuffer.append(TEXT_473); + + } + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + + stringBuffer.append(TEXT_474); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_475); + stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); + stringBuffer.append(TEXT_476); + + } + + stringBuffer.append(TEXT_477); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); + stringBuffer.append(TEXT_478); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_479); + stringBuffer.append(TEXT_480); + stringBuffer.append(TEXT_481); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_482); + stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(TEXT_483); + +Map genFeature2genLinkMap = new LinkedHashMap(); +for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + GenFeature metaFeature = modelFacet.getChildMetaFeature(); + if (!genFeature2genLinkMap.containsKey(metaFeature)) { + genFeature2genLinkMap.put(metaFeature, new ArrayList()); + } + ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink); +} +Map genFeature2featureGenLinkMap = new LinkedHashMap(); +for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) { + genFeature2featureGenLinkMap.put(metaFeature, new ArrayList()); + } + ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink); +} +if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { + + stringBuffer.append(TEXT_484); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_485); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_486); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_487); + +} +if (!genFeature2genLinkMap.isEmpty()) { + + stringBuffer.append(TEXT_488); + +} +for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { + Map.Entry nextEntry = (Map.Entry) entries.next(); + GenFeature metaFeature = (GenFeature) nextEntry.getKey(); + Collection genLinksCollection = (Collection) nextEntry.getValue(); + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_489); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_490); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_491); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_492); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_493); + + } else { + + stringBuffer.append(TEXT_494); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_495); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_496); + + } + + stringBuffer.append(TEXT_497); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_498); + + boolean generateSwitch = genLinksCollection.size() != 1; + if (generateSwitch) { + + stringBuffer.append(TEXT_499); + + } + for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { + GenLink nextLink = (GenLink) genLinksIterator.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (generateSwitch) { + + stringBuffer.append(TEXT_500); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_501); + + } else { + + stringBuffer.append(TEXT_502); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_503); + + } + if (modelFacet.getSourceMetaFeature() != null) { + + stringBuffer.append(TEXT_504); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_505); + stringBuffer.append(importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_506); + stringBuffer.append(modelFacet.getSourceMetaFeature().getGetAccessor()); + stringBuffer.append(TEXT_507); + + } else { + + stringBuffer.append(TEXT_508); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_509); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_510); + + } + if (modelFacet.getTargetMetaFeature() != null) { + + stringBuffer.append(TEXT_511); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_512); + stringBuffer.append(importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_513); + stringBuffer.append(modelFacet.getTargetMetaFeature().getGetAccessor()); + stringBuffer.append(TEXT_514); + + } else { + + stringBuffer.append(TEXT_515); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_516); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_517); + + } + + stringBuffer.append(TEXT_518); + + if (generateSwitch) { + + stringBuffer.append(TEXT_519); + + } else { + + stringBuffer.append(TEXT_520); + + } + + + } //iterate over genLinksCollection + if (generateSwitch) { + + stringBuffer.append(TEXT_521); + + } + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_522); + + } +} +for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) { + Map.Entry nextEntry = (Map.Entry) entries.next(); + GenFeature metaFeature = (GenFeature) nextEntry.getKey(); + Collection genLinksCollection = (Collection) nextEntry.getValue(); + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_523); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_524); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_525); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_526); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_527); + + } else { + + stringBuffer.append(TEXT_528); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_529); + stringBuffer.append(metaFeature.getGetAccessor()); + stringBuffer.append(TEXT_530); + + } + + stringBuffer.append(TEXT_531); + + for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { + GenLink nextLink = (GenLink) genLinksIterator.next(); + + stringBuffer.append(TEXT_532); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_533); + + } + + stringBuffer.append(TEXT_534); + + if (metaFeature.isListType()) { + + stringBuffer.append(TEXT_535); + + } +} + + stringBuffer.append(TEXT_536); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_537); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_538); + stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); + stringBuffer.append(TEXT_539); + stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(TEXT_540); + stringBuffer.append(_getDiagramCode); + stringBuffer.append(TEXT_541); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_542); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_543); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); + stringBuffer.append(TEXT_544); + + if (_includeUncontainedLinks) { + + stringBuffer.append(TEXT_545); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_546); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_547); + + } + + + if (myHelper.containsFeatureModelFacetLinks()) { + + stringBuffer.append(TEXT_548); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_549); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_550); + + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + + stringBuffer.append(TEXT_551); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_552); + + } + + stringBuffer.append(TEXT_553); + + if (myHelper.containsTypeModelFacetLinks()) { + + stringBuffer.append(TEXT_554); + + } else { + + stringBuffer.append(TEXT_555); + + } + } + + + + if (myHelper.containsTypeModelFacetLinks()) { + if (!myHelper.containsFeatureModelFacetLinks()) { + + stringBuffer.append(TEXT_556); + + } + + stringBuffer.append(TEXT_557); + stringBuffer.append(_getSemanticElementCode); + stringBuffer.append(TEXT_558); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_559); + + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + + stringBuffer.append(TEXT_560); + stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_561); + + } + + stringBuffer.append(TEXT_562); + + } + + stringBuffer.append(TEXT_563); + stringBuffer.append(genDiagram.isSynchronized()); + stringBuffer.append(TEXT_564); + stringBuffer.append(genDiagram.isSynchronized()); + stringBuffer.append(TEXT_565); + +} + + +} //end of local declarations + + stringBuffer.append(TEXT_566); + stringBuffer.append(TEXT_567); + stringBuffer.append(TEXT_568); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); + stringBuffer.append(TEXT_569); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(TEXT_570); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_571); + stringBuffer.append(TEXT_572); + stringBuffer.append(TEXT_573); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_574); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_575); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_576); + + final String primaryView = "getDiagramNode()"; + + stringBuffer.append(TEXT_577); + +boolean isFixedFontSetInFigure; +{ + StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class); + isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); +} + + stringBuffer.append(TEXT_578); + +if (!isFixedFontSetInFigure) { + + stringBuffer.append(TEXT_579); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); + stringBuffer.append(TEXT_580); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); + stringBuffer.append(TEXT_581); + stringBuffer.append(primaryView); + stringBuffer.append(TEXT_582); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_583); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(TEXT_584); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(TEXT_585); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(TEXT_586); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(TEXT_587); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(TEXT_588); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); + stringBuffer.append(TEXT_589); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(TEXT_590); + +} + + stringBuffer.append(TEXT_591); + +if (!isFixedFontSetInFigure) { + + stringBuffer.append(TEXT_592); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(TEXT_593); + +} + + stringBuffer.append(TEXT_594); + stringBuffer.append(TEXT_595); + stringBuffer.append(TEXT_596); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); + stringBuffer.append(TEXT_597); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); + stringBuffer.append(TEXT_598); + stringBuffer.append(primaryView); + stringBuffer.append(TEXT_599); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_600); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_601); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_602); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_603); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_604); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); + stringBuffer.append(TEXT_605); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); + stringBuffer.append(TEXT_606); + stringBuffer.append(primaryView); + stringBuffer.append(TEXT_607); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_608); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_609); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_610); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_611); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(TEXT_612); + stringBuffer.append(TEXT_613); + stringBuffer.append(TEXT_614); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(TEXT_615); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_616); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(TEXT_617); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(TEXT_618); + stringBuffer.append(TEXT_619); + stringBuffer.append(TEXT_620); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_621); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_622); + stringBuffer.append(TEXT_623); + stringBuffer.append(TEXT_624); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_625); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_626); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_627); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_628); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_629); + stringBuffer.append(TEXT_630); + stringBuffer.append(TEXT_631); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_632); + stringBuffer.append(TEXT_633); + stringBuffer.append(TEXT_634); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_370); - stringBuffer.append(TEXT_371); - stringBuffer.append(TEXT_372); + stringBuffer.append(TEXT_635); + stringBuffer.append(TEXT_636); + stringBuffer.append(TEXT_637); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_373); + stringBuffer.append(TEXT_638); + stringBuffer.append(TEXT_639); + stringBuffer.append(TEXT_640); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_374); + stringBuffer.append(TEXT_641); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_375); + stringBuffer.append(TEXT_642); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_376); - stringBuffer.append(TEXT_377); - stringBuffer.append(TEXT_378); + stringBuffer.append(TEXT_643); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_379); + stringBuffer.append(TEXT_644); + stringBuffer.append(TEXT_645); + stringBuffer.append(TEXT_646); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_380); + stringBuffer.append(TEXT_647); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_648); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -2051,110 +3179,110 @@ } GenLinkConstraints linkConstraints = genLink.getCreationConstraints(); - stringBuffer.append(TEXT_381); + stringBuffer.append(TEXT_649); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_382); + stringBuffer.append(TEXT_650); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_383); + stringBuffer.append(TEXT_651); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_384); + stringBuffer.append(TEXT_652); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_385); + stringBuffer.append(TEXT_653); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_386); + stringBuffer.append(TEXT_654); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_387); + stringBuffer.append(TEXT_655); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_388); + stringBuffer.append(TEXT_656); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_389); + stringBuffer.append(TEXT_657); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_390); + stringBuffer.append(TEXT_658); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_391); + stringBuffer.append(TEXT_659); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_392); + stringBuffer.append(TEXT_660); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_393); + stringBuffer.append(TEXT_661); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_394); + stringBuffer.append(TEXT_662); if (linkConstraints != null) { - stringBuffer.append(TEXT_395); + stringBuffer.append(TEXT_663); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_396); + stringBuffer.append(TEXT_664); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_397); + stringBuffer.append(TEXT_665); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_398); + stringBuffer.append(TEXT_666); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_399); + stringBuffer.append(TEXT_667); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_400); + stringBuffer.append(TEXT_668); } else { - stringBuffer.append(TEXT_401); + stringBuffer.append(TEXT_669); } - stringBuffer.append(TEXT_402); + stringBuffer.append(TEXT_670); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature containmentFeature = modelFacet.getContainmentMetaFeature(); if (containmentFeature == null) { - stringBuffer.append(TEXT_403); + stringBuffer.append(TEXT_671); } else { - stringBuffer.append(TEXT_404); + stringBuffer.append(TEXT_672); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_405); + stringBuffer.append(TEXT_673); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_406); + stringBuffer.append(TEXT_674); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_407); + stringBuffer.append(TEXT_675); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_408); + stringBuffer.append(TEXT_676); { GenFeature _feature = containmentFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; - stringBuffer.append(TEXT_409); + stringBuffer.append(TEXT_677); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_410); + stringBuffer.append(TEXT_678); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_411); + stringBuffer.append(TEXT_679); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_412); + stringBuffer.append(TEXT_680); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_413); + stringBuffer.append(TEXT_681); } else { - stringBuffer.append(TEXT_414); + stringBuffer.append(TEXT_682); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_415); + stringBuffer.append(TEXT_683); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_416); + stringBuffer.append(TEXT_684); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_417); + stringBuffer.append(TEXT_685); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_418); + stringBuffer.append(TEXT_686); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_419); + stringBuffer.append(TEXT_687); } } @@ -2168,33 +3296,33 @@ String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; - stringBuffer.append(TEXT_420); + stringBuffer.append(TEXT_688); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_421); + stringBuffer.append(TEXT_689); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_422); + stringBuffer.append(TEXT_690); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_423); + stringBuffer.append(TEXT_691); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_424); + stringBuffer.append(TEXT_692); } else { - stringBuffer.append(TEXT_425); + stringBuffer.append(TEXT_693); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_426); + stringBuffer.append(TEXT_694); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_427); + stringBuffer.append(TEXT_695); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_428); + stringBuffer.append(TEXT_696); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_429); + stringBuffer.append(TEXT_697); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_430); + stringBuffer.append(TEXT_698); } } @@ -2208,24 +3336,24 @@ String _source = "newSource.getElement()"; String _target = "edge.getTarget().getElement()"; - stringBuffer.append(TEXT_431); + stringBuffer.append(TEXT_699); if (linkConstraints != null) { - stringBuffer.append(TEXT_432); + stringBuffer.append(TEXT_700); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_433); + stringBuffer.append(TEXT_701); stringBuffer.append(_source); - stringBuffer.append(TEXT_434); + stringBuffer.append(TEXT_702); stringBuffer.append(_target); - stringBuffer.append(TEXT_435); + stringBuffer.append(TEXT_703); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_436); + stringBuffer.append(TEXT_704); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); @@ -2234,33 +3362,33 @@ String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") newSource.getElement())"; String _exceedsUpperBound = "return false;"; - stringBuffer.append(TEXT_437); + stringBuffer.append(TEXT_705); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_438); + stringBuffer.append(TEXT_706); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_439); + stringBuffer.append(TEXT_707); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_440); + stringBuffer.append(TEXT_708); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_441); + stringBuffer.append(TEXT_709); } else { - stringBuffer.append(TEXT_442); + stringBuffer.append(TEXT_710); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_443); + stringBuffer.append(TEXT_711); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_444); + stringBuffer.append(TEXT_712); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_445); + stringBuffer.append(TEXT_713); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_446); + stringBuffer.append(TEXT_714); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_447); + stringBuffer.append(TEXT_715); } } @@ -2271,44 +3399,44 @@ String _source = "newSource.getElement()"; String _target = "edge.getTarget().getElement()"; - stringBuffer.append(TEXT_448); + stringBuffer.append(TEXT_716); if (linkConstraints != null) { - stringBuffer.append(TEXT_449); + stringBuffer.append(TEXT_717); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_450); + stringBuffer.append(TEXT_718); stringBuffer.append(_source); - stringBuffer.append(TEXT_451); + stringBuffer.append(TEXT_719); stringBuffer.append(_target); - stringBuffer.append(TEXT_452); + stringBuffer.append(TEXT_720); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_453); + stringBuffer.append(TEXT_721); } else { - stringBuffer.append(TEXT_454); + stringBuffer.append(TEXT_722); } - stringBuffer.append(TEXT_455); + stringBuffer.append(TEXT_723); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_456); + stringBuffer.append(TEXT_724); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_457); + stringBuffer.append(TEXT_725); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_458); + stringBuffer.append(TEXT_726); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_459); + stringBuffer.append(TEXT_727); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_460); + stringBuffer.append(TEXT_728); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")); - stringBuffer.append(TEXT_461); + stringBuffer.append(TEXT_729); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -2327,110 +3455,110 @@ } if (containmentFeature != null || setChild) { - stringBuffer.append(TEXT_462); + stringBuffer.append(TEXT_730); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_463); + stringBuffer.append(TEXT_731); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_464); + stringBuffer.append(TEXT_732); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_465); + stringBuffer.append(TEXT_733); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_466); + stringBuffer.append(TEXT_734); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_467); + stringBuffer.append(TEXT_735); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_468); + stringBuffer.append(TEXT_736); } if (containmentFeature != null) { if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_469); + stringBuffer.append(TEXT_737); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_470); + stringBuffer.append(TEXT_738); } else { - stringBuffer.append(TEXT_471); + stringBuffer.append(TEXT_739); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_472); + stringBuffer.append(TEXT_740); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_473); + stringBuffer.append(TEXT_741); } - stringBuffer.append(TEXT_474); + stringBuffer.append(TEXT_742); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_475); + stringBuffer.append(TEXT_743); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_476); + stringBuffer.append(TEXT_744); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_477); + stringBuffer.append(TEXT_745); } if (setChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_478); + stringBuffer.append(TEXT_746); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_479); + stringBuffer.append(TEXT_747); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_480); + stringBuffer.append(TEXT_748); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_481); + stringBuffer.append(TEXT_749); } else { - stringBuffer.append(TEXT_482); + stringBuffer.append(TEXT_750); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_483); + stringBuffer.append(TEXT_751); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_484); + stringBuffer.append(TEXT_752); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_485); + stringBuffer.append(TEXT_753); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_486); + stringBuffer.append(TEXT_754); } - stringBuffer.append(TEXT_487); + stringBuffer.append(TEXT_755); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_488); + stringBuffer.append(TEXT_756); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_489); + stringBuffer.append(TEXT_757); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_490); + stringBuffer.append(TEXT_758); } - stringBuffer.append(TEXT_491); + stringBuffer.append(TEXT_759); if (setSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_492); + stringBuffer.append(TEXT_760); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_493); + stringBuffer.append(TEXT_761); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_494); + stringBuffer.append(TEXT_762); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_495); + stringBuffer.append(TEXT_763); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_496); + stringBuffer.append(TEXT_764); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_497); + stringBuffer.append(TEXT_765); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_498); + stringBuffer.append(TEXT_766); } else { - stringBuffer.append(TEXT_499); + stringBuffer.append(TEXT_767); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_500); + stringBuffer.append(TEXT_768); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_501); + stringBuffer.append(TEXT_769); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_502); + stringBuffer.append(TEXT_770); } } @@ -2438,53 +3566,53 @@ GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_503); + stringBuffer.append(TEXT_771); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_504); + stringBuffer.append(TEXT_772); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_505); + stringBuffer.append(TEXT_773); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_506); + stringBuffer.append(TEXT_774); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_507); + stringBuffer.append(TEXT_775); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_508); + stringBuffer.append(TEXT_776); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_509); + stringBuffer.append(TEXT_777); } else { - stringBuffer.append(TEXT_510); + stringBuffer.append(TEXT_778); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_511); + stringBuffer.append(TEXT_779); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_512); + stringBuffer.append(TEXT_780); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_513); + stringBuffer.append(TEXT_781); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_514); + stringBuffer.append(TEXT_782); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_515); + stringBuffer.append(TEXT_783); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_516); + stringBuffer.append(TEXT_784); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_517); + stringBuffer.append(TEXT_785); } } - stringBuffer.append(TEXT_518); - stringBuffer.append(TEXT_519); + stringBuffer.append(TEXT_786); + stringBuffer.append(TEXT_787); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_520); + stringBuffer.append(TEXT_788); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_521); + stringBuffer.append(TEXT_789); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_522); + stringBuffer.append(TEXT_790); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); - stringBuffer.append(TEXT_523); + stringBuffer.append(TEXT_791); } @@ -2492,15 +3620,15 @@ if (linkConstraints != null) { String _edge = "edge"; - stringBuffer.append(TEXT_524); + stringBuffer.append(TEXT_792); //input: _edge : String - stringBuffer.append(TEXT_525); + stringBuffer.append(TEXT_793); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_526); + stringBuffer.append(TEXT_794); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_527); + stringBuffer.append(TEXT_795); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -2527,250 +3655,250 @@ } } - stringBuffer.append(TEXT_528); + stringBuffer.append(TEXT_796); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_529); + stringBuffer.append(TEXT_797); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_530); + stringBuffer.append(TEXT_798); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_531); + stringBuffer.append(TEXT_799); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_532); + stringBuffer.append(TEXT_800); stringBuffer.append(_edge); - stringBuffer.append(TEXT_533); + stringBuffer.append(TEXT_801); stringBuffer.append(_edge); - stringBuffer.append(TEXT_534); + stringBuffer.append(TEXT_802); stringBuffer.append(_edge); - stringBuffer.append(TEXT_535); + stringBuffer.append(TEXT_803); } else { - stringBuffer.append(TEXT_536); + stringBuffer.append(TEXT_804); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_537); + stringBuffer.append(TEXT_805); stringBuffer.append(_edge); - stringBuffer.append(TEXT_538); + stringBuffer.append(TEXT_806); stringBuffer.append(_edge); - stringBuffer.append(TEXT_539); + stringBuffer.append(TEXT_807); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_540); + stringBuffer.append(TEXT_808); } } else { - stringBuffer.append(TEXT_541); + stringBuffer.append(TEXT_809); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_542); + stringBuffer.append(TEXT_810); } if (removeChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_543); + stringBuffer.append(TEXT_811); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_544); + stringBuffer.append(TEXT_812); stringBuffer.append(_edge); - stringBuffer.append(TEXT_545); + stringBuffer.append(TEXT_813); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_546); + stringBuffer.append(TEXT_814); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_547); + stringBuffer.append(TEXT_815); stringBuffer.append(_edge); - stringBuffer.append(TEXT_548); + stringBuffer.append(TEXT_816); } else { - stringBuffer.append(TEXT_549); + stringBuffer.append(TEXT_817); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_550); + stringBuffer.append(TEXT_818); stringBuffer.append(_edge); - stringBuffer.append(TEXT_551); + stringBuffer.append(TEXT_819); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_552); + stringBuffer.append(TEXT_820); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_553); + stringBuffer.append(TEXT_821); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_554); + stringBuffer.append(TEXT_822); } } if (removeSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_555); + stringBuffer.append(TEXT_823); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_556); + stringBuffer.append(TEXT_824); stringBuffer.append(_edge); - stringBuffer.append(TEXT_557); + stringBuffer.append(TEXT_825); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_558); + stringBuffer.append(TEXT_826); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_559); + stringBuffer.append(TEXT_827); stringBuffer.append(_edge); - stringBuffer.append(TEXT_560); + stringBuffer.append(TEXT_828); } else { - stringBuffer.append(TEXT_561); + stringBuffer.append(TEXT_829); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_562); + stringBuffer.append(TEXT_830); stringBuffer.append(_edge); - stringBuffer.append(TEXT_563); + stringBuffer.append(TEXT_831); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_564); + stringBuffer.append(TEXT_832); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_565); + stringBuffer.append(TEXT_833); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_566); + stringBuffer.append(TEXT_834); } } if (removeTarget) { if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_567); + stringBuffer.append(TEXT_835); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_568); + stringBuffer.append(TEXT_836); stringBuffer.append(_edge); - stringBuffer.append(TEXT_569); + stringBuffer.append(TEXT_837); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_570); + stringBuffer.append(TEXT_838); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_571); + stringBuffer.append(TEXT_839); stringBuffer.append(_edge); - stringBuffer.append(TEXT_572); + stringBuffer.append(TEXT_840); } else { - stringBuffer.append(TEXT_573); + stringBuffer.append(TEXT_841); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_574); + stringBuffer.append(TEXT_842); stringBuffer.append(_edge); - stringBuffer.append(TEXT_575); + stringBuffer.append(TEXT_843); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_576); + stringBuffer.append(TEXT_844); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_577); + stringBuffer.append(TEXT_845); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_578); + stringBuffer.append(TEXT_846); } } - stringBuffer.append(TEXT_579); + stringBuffer.append(TEXT_847); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_580); + stringBuffer.append(TEXT_848); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_581); + stringBuffer.append(TEXT_849); stringBuffer.append(_edge); - stringBuffer.append(TEXT_582); + stringBuffer.append(TEXT_850); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_583); + stringBuffer.append(TEXT_851); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_584); + stringBuffer.append(TEXT_852); stringBuffer.append(_edge); - stringBuffer.append(TEXT_585); + stringBuffer.append(TEXT_853); } else { - stringBuffer.append(TEXT_586); + stringBuffer.append(TEXT_854); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_587); + stringBuffer.append(TEXT_855); stringBuffer.append(_edge); - stringBuffer.append(TEXT_588); + stringBuffer.append(TEXT_856); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_589); + stringBuffer.append(TEXT_857); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_590); + stringBuffer.append(TEXT_858); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_591); + stringBuffer.append(TEXT_859); } } - stringBuffer.append(TEXT_592); + stringBuffer.append(TEXT_860); } - stringBuffer.append(TEXT_593); + stringBuffer.append(TEXT_861); if (palette != null) { - stringBuffer.append(TEXT_594); + stringBuffer.append(TEXT_862); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_595); + stringBuffer.append(TEXT_863); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_596); + stringBuffer.append(TEXT_864); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_597); + stringBuffer.append(TEXT_865); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_598); + stringBuffer.append(TEXT_866); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_599); + stringBuffer.append(TEXT_867); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_600); + stringBuffer.append(TEXT_868); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature containmentFeature = modelFacet.getContainmentMetaFeature(); if (containmentFeature == null) { - stringBuffer.append(TEXT_601); + stringBuffer.append(TEXT_869); } else { - stringBuffer.append(TEXT_602); + stringBuffer.append(TEXT_870); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_603); + stringBuffer.append(TEXT_871); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_604); + stringBuffer.append(TEXT_872); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_605); + stringBuffer.append(TEXT_873); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_606); + stringBuffer.append(TEXT_874); { GenFeature _feature = containmentFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; - stringBuffer.append(TEXT_607); + stringBuffer.append(TEXT_875); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_608); + stringBuffer.append(TEXT_876); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_609); + stringBuffer.append(TEXT_877); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_610); + stringBuffer.append(TEXT_878); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_611); + stringBuffer.append(TEXT_879); } else { - stringBuffer.append(TEXT_612); + stringBuffer.append(TEXT_880); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_613); + stringBuffer.append(TEXT_881); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_614); + stringBuffer.append(TEXT_882); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_615); + stringBuffer.append(TEXT_883); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_616); + stringBuffer.append(TEXT_884); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_617); + stringBuffer.append(TEXT_885); } } @@ -2784,33 +3912,33 @@ String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; - stringBuffer.append(TEXT_618); + stringBuffer.append(TEXT_886); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_619); + stringBuffer.append(TEXT_887); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_620); + stringBuffer.append(TEXT_888); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_621); + stringBuffer.append(TEXT_889); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_622); + stringBuffer.append(TEXT_890); } else { - stringBuffer.append(TEXT_623); + stringBuffer.append(TEXT_891); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_624); + stringBuffer.append(TEXT_892); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_625); + stringBuffer.append(TEXT_893); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_626); + stringBuffer.append(TEXT_894); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_627); + stringBuffer.append(TEXT_895); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_628); + stringBuffer.append(TEXT_896); } } @@ -2822,24 +3950,24 @@ String _source = "source.getElement()"; String _target = "null"; - stringBuffer.append(TEXT_629); + stringBuffer.append(TEXT_897); if (linkConstraints != null) { - stringBuffer.append(TEXT_630); + stringBuffer.append(TEXT_898); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_631); + stringBuffer.append(TEXT_899); stringBuffer.append(_source); - stringBuffer.append(TEXT_632); + stringBuffer.append(TEXT_900); stringBuffer.append(_target); - stringBuffer.append(TEXT_633); + stringBuffer.append(TEXT_901); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_634); + stringBuffer.append(TEXT_902); } } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { @@ -2849,33 +3977,33 @@ String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") source.getElement())"; String _exceedsUpperBound = "return false;"; - stringBuffer.append(TEXT_635); + stringBuffer.append(TEXT_903); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_636); + stringBuffer.append(TEXT_904); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_637); + stringBuffer.append(TEXT_905); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_638); + stringBuffer.append(TEXT_906); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_639); + stringBuffer.append(TEXT_907); } else { - stringBuffer.append(TEXT_640); + stringBuffer.append(TEXT_908); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_641); + stringBuffer.append(TEXT_909); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_642); + stringBuffer.append(TEXT_910); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_643); + stringBuffer.append(TEXT_911); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_644); + stringBuffer.append(TEXT_912); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_645); + stringBuffer.append(TEXT_913); } } @@ -2886,47 +4014,47 @@ String _source = "source.getElement()"; String _target = "null"; - stringBuffer.append(TEXT_646); + stringBuffer.append(TEXT_914); if (linkConstraints != null) { - stringBuffer.append(TEXT_647); + stringBuffer.append(TEXT_915); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_648); + stringBuffer.append(TEXT_916); stringBuffer.append(_source); - stringBuffer.append(TEXT_649); + stringBuffer.append(TEXT_917); stringBuffer.append(_target); - stringBuffer.append(TEXT_650); + stringBuffer.append(TEXT_918); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_651); + stringBuffer.append(TEXT_919); } else { - stringBuffer.append(TEXT_652); + stringBuffer.append(TEXT_920); } - stringBuffer.append(TEXT_653); - stringBuffer.append(TEXT_654); + stringBuffer.append(TEXT_921); + stringBuffer.append(TEXT_922); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_655); + stringBuffer.append(TEXT_923); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_656); + stringBuffer.append(TEXT_924); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_657); + stringBuffer.append(TEXT_925); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); - stringBuffer.append(TEXT_658); + stringBuffer.append(TEXT_926); } - stringBuffer.append(TEXT_659); + stringBuffer.append(TEXT_927); } //if there's palette } //outgoing links @@ -2956,202 +4084,202 @@ } GenLinkConstraints linkConstraints = genLink.getCreationConstraints(); - stringBuffer.append(TEXT_660); + stringBuffer.append(TEXT_928); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_661); + stringBuffer.append(TEXT_929); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_662); + stringBuffer.append(TEXT_930); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_663); + stringBuffer.append(TEXT_931); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_664); + stringBuffer.append(TEXT_932); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_665); + stringBuffer.append(TEXT_933); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_666); + stringBuffer.append(TEXT_934); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_667); + stringBuffer.append(TEXT_935); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_668); + stringBuffer.append(TEXT_936); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_669); + stringBuffer.append(TEXT_937); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_670); + stringBuffer.append(TEXT_938); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_671); + stringBuffer.append(TEXT_939); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_672); + stringBuffer.append(TEXT_940); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_673); + stringBuffer.append(TEXT_941); if (linkConstraints != null) { - stringBuffer.append(TEXT_674); + stringBuffer.append(TEXT_942); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_675); + stringBuffer.append(TEXT_943); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_676); + stringBuffer.append(TEXT_944); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_677); + stringBuffer.append(TEXT_945); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_678); + stringBuffer.append(TEXT_946); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_679); + stringBuffer.append(TEXT_947); } else { - stringBuffer.append(TEXT_680); + stringBuffer.append(TEXT_948); } - stringBuffer.append(TEXT_681); + stringBuffer.append(TEXT_949); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { { String _source = "edge.getSource().getElement()"; String _target = "newTarget.getElement()"; - stringBuffer.append(TEXT_682); + stringBuffer.append(TEXT_950); if (linkConstraints != null) { - stringBuffer.append(TEXT_683); + stringBuffer.append(TEXT_951); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_684); + stringBuffer.append(TEXT_952); stringBuffer.append(_source); - stringBuffer.append(TEXT_685); + stringBuffer.append(TEXT_953); stringBuffer.append(_target); - stringBuffer.append(TEXT_686); + stringBuffer.append(TEXT_954); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_687); + stringBuffer.append(TEXT_955); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { { String _source = "edge.getSource().getElement()"; String _target = "newTarget.getElement()"; - stringBuffer.append(TEXT_688); + stringBuffer.append(TEXT_956); if (linkConstraints != null) { - stringBuffer.append(TEXT_689); + stringBuffer.append(TEXT_957); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_690); + stringBuffer.append(TEXT_958); stringBuffer.append(_source); - stringBuffer.append(TEXT_691); + stringBuffer.append(TEXT_959); stringBuffer.append(_target); - stringBuffer.append(TEXT_692); + stringBuffer.append(TEXT_960); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_693); + stringBuffer.append(TEXT_961); } else { - stringBuffer.append(TEXT_694); + stringBuffer.append(TEXT_962); } - stringBuffer.append(TEXT_695); + stringBuffer.append(TEXT_963); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_696); + stringBuffer.append(TEXT_964); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_697); + stringBuffer.append(TEXT_965); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_698); + stringBuffer.append(TEXT_966); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_699); + stringBuffer.append(TEXT_967); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_700); + stringBuffer.append(TEXT_968); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")); - stringBuffer.append(TEXT_701); + stringBuffer.append(TEXT_969); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature targetFeature = modelFacet.getTargetMetaFeature(); if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_702); + stringBuffer.append(TEXT_970); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_703); + stringBuffer.append(TEXT_971); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_704); + stringBuffer.append(TEXT_972); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_705); + stringBuffer.append(TEXT_973); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_706); + stringBuffer.append(TEXT_974); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_707); + stringBuffer.append(TEXT_975); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_708); + stringBuffer.append(TEXT_976); } else { - stringBuffer.append(TEXT_709); + stringBuffer.append(TEXT_977); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_710); + stringBuffer.append(TEXT_978); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_711); + stringBuffer.append(TEXT_979); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_712); + stringBuffer.append(TEXT_980); } } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_713); + stringBuffer.append(TEXT_981); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_714); + stringBuffer.append(TEXT_982); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_715); + stringBuffer.append(TEXT_983); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_716); + stringBuffer.append(TEXT_984); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_717); + stringBuffer.append(TEXT_985); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_718); + stringBuffer.append(TEXT_986); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_719); + stringBuffer.append(TEXT_987); } else { - stringBuffer.append(TEXT_720); + stringBuffer.append(TEXT_988); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_721); + stringBuffer.append(TEXT_989); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_722); + stringBuffer.append(TEXT_990); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_723); + stringBuffer.append(TEXT_991); } } - stringBuffer.append(TEXT_724); + stringBuffer.append(TEXT_992); if (linkConstraints != null) { String _edge = "edge"; - stringBuffer.append(TEXT_725); + stringBuffer.append(TEXT_993); //input: _edge : String - stringBuffer.append(TEXT_726); + stringBuffer.append(TEXT_994); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_727); + stringBuffer.append(TEXT_995); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_728); + stringBuffer.append(TEXT_996); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -3178,248 +4306,248 @@ } } - stringBuffer.append(TEXT_729); + stringBuffer.append(TEXT_997); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_730); + stringBuffer.append(TEXT_998); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_731); + stringBuffer.append(TEXT_999); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_732); + stringBuffer.append(TEXT_1000); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_733); + stringBuffer.append(TEXT_1001); stringBuffer.append(_edge); - stringBuffer.append(TEXT_734); + stringBuffer.append(TEXT_1002); stringBuffer.append(_edge); - stringBuffer.append(TEXT_735); + stringBuffer.append(TEXT_1003); stringBuffer.append(_edge); - stringBuffer.append(TEXT_736); + stringBuffer.append(TEXT_1004); } else { - stringBuffer.append(TEXT_737); + stringBuffer.append(TEXT_1005); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_738); + stringBuffer.append(TEXT_1006); stringBuffer.append(_edge); - stringBuffer.append(TEXT_739); + stringBuffer.append(TEXT_1007); stringBuffer.append(_edge); - stringBuffer.append(TEXT_740); + stringBuffer.append(TEXT_1008); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_741); + stringBuffer.append(TEXT_1009); } } else { - stringBuffer.append(TEXT_742); + stringBuffer.append(TEXT_1010); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_743); + stringBuffer.append(TEXT_1011); } if (removeChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_744); + stringBuffer.append(TEXT_1012); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_745); + stringBuffer.append(TEXT_1013); stringBuffer.append(_edge); - stringBuffer.append(TEXT_746); + stringBuffer.append(TEXT_1014); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_747); + stringBuffer.append(TEXT_1015); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_748); + stringBuffer.append(TEXT_1016); stringBuffer.append(_edge); - stringBuffer.append(TEXT_749); + stringBuffer.append(TEXT_1017); } else { - stringBuffer.append(TEXT_750); + stringBuffer.append(TEXT_1018); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_751); + stringBuffer.append(TEXT_1019); stringBuffer.append(_edge); - stringBuffer.append(TEXT_752); + stringBuffer.append(TEXT_1020); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_753); + stringBuffer.append(TEXT_1021); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_754); + stringBuffer.append(TEXT_1022); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_755); + stringBuffer.append(TEXT_1023); } } if (removeSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_756); + stringBuffer.append(TEXT_1024); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_757); + stringBuffer.append(TEXT_1025); stringBuffer.append(_edge); - stringBuffer.append(TEXT_758); + stringBuffer.append(TEXT_1026); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_759); + stringBuffer.append(TEXT_1027); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_760); + stringBuffer.append(TEXT_1028); stringBuffer.append(_edge); - stringBuffer.append(TEXT_761); + stringBuffer.append(TEXT_1029); } else { - stringBuffer.append(TEXT_762); + stringBuffer.append(TEXT_1030); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_763); + stringBuffer.append(TEXT_1031); stringBuffer.append(_edge); - stringBuffer.append(TEXT_764); + stringBuffer.append(TEXT_1032); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_765); + stringBuffer.append(TEXT_1033); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_766); + stringBuffer.append(TEXT_1034); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_767); + stringBuffer.append(TEXT_1035); } } if (removeTarget) { if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_768); + stringBuffer.append(TEXT_1036); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_769); + stringBuffer.append(TEXT_1037); stringBuffer.append(_edge); - stringBuffer.append(TEXT_770); + stringBuffer.append(TEXT_1038); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_771); + stringBuffer.append(TEXT_1039); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_772); + stringBuffer.append(TEXT_1040); stringBuffer.append(_edge); - stringBuffer.append(TEXT_773); + stringBuffer.append(TEXT_1041); } else { - stringBuffer.append(TEXT_774); + stringBuffer.append(TEXT_1042); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_775); + stringBuffer.append(TEXT_1043); stringBuffer.append(_edge); - stringBuffer.append(TEXT_776); + stringBuffer.append(TEXT_1044); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_777); + stringBuffer.append(TEXT_1045); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_778); + stringBuffer.append(TEXT_1046); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_779); + stringBuffer.append(TEXT_1047); } } - stringBuffer.append(TEXT_780); + stringBuffer.append(TEXT_1048); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_781); + stringBuffer.append(TEXT_1049); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_782); + stringBuffer.append(TEXT_1050); stringBuffer.append(_edge); - stringBuffer.append(TEXT_783); + stringBuffer.append(TEXT_1051); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_784); + stringBuffer.append(TEXT_1052); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_785); + stringBuffer.append(TEXT_1053); stringBuffer.append(_edge); - stringBuffer.append(TEXT_786); + stringBuffer.append(TEXT_1054); } else { - stringBuffer.append(TEXT_787); + stringBuffer.append(TEXT_1055); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_788); + stringBuffer.append(TEXT_1056); stringBuffer.append(_edge); - stringBuffer.append(TEXT_789); + stringBuffer.append(TEXT_1057); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_790); + stringBuffer.append(TEXT_1058); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_791); + stringBuffer.append(TEXT_1059); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_792); + stringBuffer.append(TEXT_1060); } } - stringBuffer.append(TEXT_793); + stringBuffer.append(TEXT_1061); } - stringBuffer.append(TEXT_794); + stringBuffer.append(TEXT_1062); if (palette != null) { - stringBuffer.append(TEXT_795); + stringBuffer.append(TEXT_1063); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_796); + stringBuffer.append(TEXT_1064); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_797); + stringBuffer.append(TEXT_1065); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_798); + stringBuffer.append(TEXT_1066); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_799); + stringBuffer.append(TEXT_1067); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_800); + stringBuffer.append(TEXT_1068); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_801); + stringBuffer.append(TEXT_1069); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_802); + stringBuffer.append(TEXT_1070); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_803); + stringBuffer.append(TEXT_1071); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_804); + stringBuffer.append(TEXT_1072); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_805); + stringBuffer.append(TEXT_1073); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_806); + stringBuffer.append(TEXT_1074); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_807); + stringBuffer.append(TEXT_1075); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_808); + stringBuffer.append(TEXT_1076); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenClass linkClass = modelFacet.getMetaClass(); - stringBuffer.append(TEXT_809); + stringBuffer.append(TEXT_1077); stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName()))); - stringBuffer.append(TEXT_810); + stringBuffer.append(TEXT_1078); stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_811); + stringBuffer.append(TEXT_1079); stringBuffer.append(linkClass.getClassifierAccessorName()); - stringBuffer.append(TEXT_812); + stringBuffer.append(TEXT_1080); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_813); + stringBuffer.append(TEXT_1081); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_814); + stringBuffer.append(TEXT_1082); stringBuffer.append(genLink.getUniqueIdentifier()); - stringBuffer.append(TEXT_815); + stringBuffer.append(TEXT_1083); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { - stringBuffer.append(TEXT_816); + stringBuffer.append(TEXT_1084); } - stringBuffer.append(TEXT_817); + stringBuffer.append(TEXT_1085); stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_818); + stringBuffer.append(TEXT_1086); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_819); + stringBuffer.append(TEXT_1087); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_820); + stringBuffer.append(TEXT_1088); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_821); + stringBuffer.append(TEXT_1089); TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature sourceFeature = modelFacet.getSourceMetaFeature(); @@ -3446,30 +4574,30 @@ } } - stringBuffer.append(TEXT_822); + stringBuffer.append(TEXT_1090); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_823); + stringBuffer.append(TEXT_1091); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_824); + stringBuffer.append(TEXT_1092); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_825); + stringBuffer.append(TEXT_1093); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_826); + stringBuffer.append(TEXT_1094); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_827); + stringBuffer.append(TEXT_1095); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_828); + stringBuffer.append(TEXT_1096); } if (addChild) { - stringBuffer.append(TEXT_829); + stringBuffer.append(TEXT_1097); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_830); + stringBuffer.append(TEXT_1098); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_831); + stringBuffer.append(TEXT_1099); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_832); + stringBuffer.append(TEXT_1100); } if (addSource) { @@ -3478,33 +4606,33 @@ String _ownerInstance = "createdDomainElement"; String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; - stringBuffer.append(TEXT_833); + stringBuffer.append(TEXT_1101); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_834); + stringBuffer.append(TEXT_1102); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_835); + stringBuffer.append(TEXT_1103); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_836); + stringBuffer.append(TEXT_1104); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_837); + stringBuffer.append(TEXT_1105); } else { - stringBuffer.append(TEXT_838); + stringBuffer.append(TEXT_1106); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_839); + stringBuffer.append(TEXT_1107); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_840); + stringBuffer.append(TEXT_1108); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_841); + stringBuffer.append(TEXT_1109); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_842); + stringBuffer.append(TEXT_1110); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_843); + stringBuffer.append(TEXT_1111); } } @@ -3512,13 +4640,13 @@ } - stringBuffer.append(TEXT_844); + stringBuffer.append(TEXT_1112); stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_845); + stringBuffer.append(TEXT_1113); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_846); + stringBuffer.append(TEXT_1114); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_847); + stringBuffer.append(TEXT_1115); } if (addTarget) { @@ -3527,33 +4655,33 @@ String _ownerInstance = "createdDomainElement"; String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; - stringBuffer.append(TEXT_848); + stringBuffer.append(TEXT_1116); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_849); + stringBuffer.append(TEXT_1117); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_850); + stringBuffer.append(TEXT_1118); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_851); + stringBuffer.append(TEXT_1119); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_852); + stringBuffer.append(TEXT_1120); } else { - stringBuffer.append(TEXT_853); + stringBuffer.append(TEXT_1121); stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_854); + stringBuffer.append(TEXT_1122); stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_855); + stringBuffer.append(TEXT_1123); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_856); + stringBuffer.append(TEXT_1124); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_857); + stringBuffer.append(TEXT_1125); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_858); + stringBuffer.append(TEXT_1126); } } @@ -3561,70 +4689,70 @@ } - stringBuffer.append(TEXT_859); + stringBuffer.append(TEXT_1127); stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_860); + stringBuffer.append(TEXT_1128); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_861); + stringBuffer.append(TEXT_1129); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_862); + stringBuffer.append(TEXT_1130); } - stringBuffer.append(TEXT_863); + stringBuffer.append(TEXT_1131); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); - stringBuffer.append(TEXT_864); + stringBuffer.append(TEXT_1132); stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_865); + stringBuffer.append(TEXT_1133); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_866); + stringBuffer.append(TEXT_1134); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_867); + stringBuffer.append(TEXT_1135); } - stringBuffer.append(TEXT_868); - stringBuffer.append(TEXT_869); + stringBuffer.append(TEXT_1136); + stringBuffer.append(TEXT_1137); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_870); + stringBuffer.append(TEXT_1138); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_871); + stringBuffer.append(TEXT_1139); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_872); + stringBuffer.append(TEXT_1140); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); - stringBuffer.append(TEXT_873); + stringBuffer.append(TEXT_1141); } - stringBuffer.append(TEXT_874); + stringBuffer.append(TEXT_1142); { String _source = "source.getElement()"; String _target = "target.getElement()"; - stringBuffer.append(TEXT_875); + stringBuffer.append(TEXT_1143); if (linkConstraints != null) { - stringBuffer.append(TEXT_876); + stringBuffer.append(TEXT_1144); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_877); + stringBuffer.append(TEXT_1145); stringBuffer.append(_source); - stringBuffer.append(TEXT_878); + stringBuffer.append(TEXT_1146); stringBuffer.append(_target); - stringBuffer.append(TEXT_879); + stringBuffer.append(TEXT_1147); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_880); + stringBuffer.append(TEXT_1148); } @@ -3633,22 +4761,22 @@ if (genNode.getViewmap() instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody(); - stringBuffer.append(TEXT_881); + stringBuffer.append(TEXT_1149); stringBuffer.append(classBody); - stringBuffer.append(TEXT_882); + stringBuffer.append(TEXT_1150); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_883); + stringBuffer.append(TEXT_1151); } } - stringBuffer.append(TEXT_884); + stringBuffer.append(TEXT_1152); importManager.emitSortedImports(); - stringBuffer.append(TEXT_885); + stringBuffer.append(TEXT_1153); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java,v retrieving revision 1.7 diff -u -r1.7 ChildNodeEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java 3 Jul 2006 18:10:52 -0000 1.7 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java 1 Aug 2006 13:55:33 -0000 @@ -35,254 +35,261 @@ protected final String TEXT_15 = 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_16 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; protected final String TEXT_17 = " getDiagramNode() {" + NL + "\t\treturn ("; - protected final String TEXT_18 = ") getModel();" + 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_18 = ") getModel();" + NL + "\t}" + NL; protected final String TEXT_19 = NL; - protected final String TEXT_20 = "\t\tinstallEditPolicy("; - protected final String TEXT_21 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; - protected final String TEXT_22 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; - protected final String TEXT_23 = " 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_24 = " getDirectEditCommand("; - protected final String TEXT_25 = " 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_26 = ".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_27 = "(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_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; - protected final String TEXT_29 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_31 = " editingDomain = "; - protected final String TEXT_32 = ".getEditingDomain("; - protected final String TEXT_33 = ".getDiagram().getElement());"; - protected final String TEXT_34 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_35 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_36 = " 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_37 = " createDomainModelCommand("; - protected final String TEXT_38 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_39 = " element = "; - protected final String TEXT_40 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_41 = " feature = ("; - protected final String TEXT_42 = ") "; - protected final String TEXT_43 = ".eINSTANCE.get"; - protected final String TEXT_44 = "();" + 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_45 = ".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_46 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_47 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_48 = " result = new "; - protected final String TEXT_49 = "();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_50 = " values = new "; - protected final String TEXT_51 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_52 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_53 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_54 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; - protected final String TEXT_55 = NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_56 = ".create(editingDomain, element, feature, valueToSet);"; - protected final String TEXT_57 = NL + "\t\t\t\t\t}"; - protected final String TEXT_58 = NL + "\t\t\t\t\t\tif (parseResult.length != "; - protected final String TEXT_59 = ") {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_60 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_61 = " 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_62 = " createDomainModelCommand("; - protected final String TEXT_63 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_64 = " element = "; - protected final String TEXT_65 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_66 = " result = new "; - protected final String TEXT_67 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; - protected final String TEXT_68 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_69 = " "; - protected final String TEXT_70 = "feature = ("; - protected final String TEXT_71 = ") "; - protected final String TEXT_72 = ".eINSTANCE.get"; - protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; - protected final String TEXT_74 = ".parseValue(feature, values["; - protected final String TEXT_75 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_76 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_77 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_78 = " "; - protected final String TEXT_79 = "values = new "; - protected final String TEXT_80 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_81 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_82 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_83 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_84 = NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_85 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_86 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; - protected final String TEXT_87 = NL + "\t\t\t\t});"; - protected final String TEXT_88 = NL; - protected final String TEXT_89 = "\t\tinstallEditPolicy("; - protected final String TEXT_90 = ".COMPONENT_ROLE, new "; - protected final String TEXT_91 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_92 = " createDeleteCommand("; - protected final String TEXT_93 = " deleteRequest) {" + NL + "\t\t\t\t"; - protected final String TEXT_94 = " editingDomain = "; - protected final String TEXT_95 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_96 = " cc = new "; - protected final String TEXT_97 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; - protected final String TEXT_98 = ".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_99 = " editingDomain) {"; - protected final String TEXT_100 = NL + "\t\t\t\t"; - protected final String TEXT_101 = " result = new "; - protected final String TEXT_102 = "();"; - protected final String TEXT_103 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_104 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_105 = ".eINSTANCE.get"; - protected final String TEXT_106 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_107 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_108 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_109 = ".eINSTANCE.get"; - protected final String TEXT_110 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_111 = ".UNSET_VALUE));"; - protected final String TEXT_112 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_113 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_114 = ".eINSTANCE.get"; - protected final String TEXT_115 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_116 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_117 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_118 = ".eINSTANCE.get"; - protected final String TEXT_119 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_120 = ".UNSET_VALUE));"; - protected final String TEXT_121 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_122 = NL + "\t\t\t\treturn "; + protected final String TEXT_20 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + 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) {" + 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_23 = " view = ("; + protected final String TEXT_24 = ") 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_25 = NL; + protected final String TEXT_26 = "\t\tinstallEditPolicy("; + protected final String TEXT_27 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; + protected final String TEXT_28 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; + protected final String TEXT_29 = " 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_30 = " getDirectEditCommand("; + protected final String TEXT_31 = " 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_32 = ".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_33 = "(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_34 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; + protected final String TEXT_35 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_36 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_37 = " editingDomain = "; + protected final String TEXT_38 = ".getEditingDomain("; + protected final String TEXT_39 = ".getDiagram().getElement());"; + protected final String TEXT_40 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_41 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_42 = " 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_43 = " createDomainModelCommand("; + protected final String TEXT_44 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_45 = " element = "; + protected final String TEXT_46 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_47 = " feature = ("; + protected final String TEXT_48 = ") "; + protected final String TEXT_49 = ".eINSTANCE.get"; + protected final String TEXT_50 = "();" + 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_51 = ".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_52 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_53 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_54 = " result = new "; + protected final String TEXT_55 = "();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_56 = " values = new "; + protected final String TEXT_57 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_58 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_59 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_60 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; + protected final String TEXT_61 = NL + "\t\t\t\t\t\treturn "; + protected final String TEXT_62 = ".create(editingDomain, element, feature, valueToSet);"; + protected final String TEXT_63 = NL + "\t\t\t\t\t}"; + protected final String TEXT_64 = NL + "\t\t\t\t\t\tif (parseResult.length != "; + protected final String TEXT_65 = ") {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_66 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_67 = " 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_68 = " createDomainModelCommand("; + protected final String TEXT_69 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_70 = " element = "; + 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\tObject valueToSet;"; + protected final String TEXT_74 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_75 = " "; + protected final String TEXT_76 = "feature = ("; + protected final String TEXT_77 = ") "; + protected final String TEXT_78 = ".eINSTANCE.get"; + protected final String TEXT_79 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_80 = ".parseValue(feature, values["; + protected final String TEXT_81 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_82 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_83 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_84 = " "; + protected final String TEXT_85 = "values = new "; + protected final String TEXT_86 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_87 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_88 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_89 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_90 = NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_91 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_92 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; + protected final String TEXT_93 = NL + "\t\t\t\t});"; + protected final String TEXT_94 = NL; + protected final String TEXT_95 = "\t\tinstallEditPolicy("; + protected final String TEXT_96 = ".COMPONENT_ROLE, new "; + protected final String TEXT_97 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_98 = " createDeleteCommand("; + protected final String TEXT_99 = " deleteRequest) {" + NL + "\t\t\t\t"; + protected final String TEXT_100 = " editingDomain = "; + protected final String TEXT_101 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; + protected final String TEXT_102 = " cc = new "; + protected final String TEXT_103 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; + protected final String TEXT_104 = ".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_105 = " editingDomain) {"; + protected final String TEXT_106 = NL + "\t\t\t\t"; + protected final String TEXT_107 = " result = new "; + protected final String TEXT_108 = "();"; + protected final String TEXT_109 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_110 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_111 = ".eINSTANCE.get"; + protected final String TEXT_112 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_113 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_114 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_115 = ".eINSTANCE.get"; + protected final String TEXT_116 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_117 = ".UNSET_VALUE));"; + protected final String TEXT_118 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_119 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_120 = ".eINSTANCE.get"; + protected final String TEXT_121 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_122 = NL + "\t\t\t\tresult.append("; protected final String TEXT_123 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; protected final String TEXT_124 = ".eINSTANCE.get"; - protected final String TEXT_125 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; - protected final String TEXT_126 = NL + "\t\t\t\treturn "; - protected final String TEXT_127 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_128 = ".eINSTANCE.get"; - protected final String TEXT_129 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_130 = ".UNSET_VALUE);"; - protected final String TEXT_131 = NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_132 = NL + "\t}" + NL; - protected final String TEXT_133 = NL; - protected final String TEXT_134 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_135 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_136 = ".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_137 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; - protected final String TEXT_138 = "(this, "; - protected final String TEXT_139 = ".class, new "; - protected final String TEXT_140 = "() {" + NL + "\t\t\t\tpublic void relocate("; - protected final String TEXT_141 = " celleditor) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_142 = " 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_143 = 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_144 = NL; - protected final String TEXT_145 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; - protected final String TEXT_146 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; - protected final String TEXT_147 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; - protected final String TEXT_148 = " element = "; - protected final String TEXT_149 = ";" + 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_150 = " element = "; - protected final String TEXT_151 = ";" + 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_152 = " element, String pattern) {"; - protected final String TEXT_153 = NL + "\t\tif (element.get"; - protected final String TEXT_154 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; - protected final String TEXT_155 = NL + "\t\treturn "; - protected final String TEXT_156 = ".format(pattern, new Object[] {"; - protected final String TEXT_157 = NL + "\t\t\t"; - protected final String TEXT_158 = NL + "\t\t});"; - protected final String TEXT_159 = NL + "\t\treturn "; - protected final String TEXT_160 = ".format(pattern, new Object[] {"; - protected final String TEXT_161 = NL + "\t\t"; - protected final String TEXT_162 = ","; - protected final String TEXT_163 = NL + "\t\t});"; - protected final String TEXT_164 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; - protected final String TEXT_165 = NL + "\t}"; - protected final String TEXT_166 = NL; - protected final String TEXT_167 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_168 = NL + "\t\t"; - protected final String TEXT_169 = " style =" + NL + "\t\t\t("; - protected final String TEXT_170 = ") "; - protected final String TEXT_171 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_172 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_173 = " 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_174 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_175 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_176 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_177 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_178 = " 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_179 = "(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_180 = "\t" + NL + "\t}"; - protected final String TEXT_181 = 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_182 = " createdFont;"; - protected final String TEXT_183 = "\t"; - protected final String TEXT_184 = NL; - protected final String TEXT_185 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; - protected final String TEXT_186 = " style = ("; - protected final String TEXT_187 = ") "; - protected final String TEXT_188 = ".getStyle("; - protected final String TEXT_189 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_190 = " 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_191 = " 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_192 = "(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_193 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_194 = " getLabelIcon() {"; - protected final String TEXT_195 = NL + "\t\t"; - protected final String TEXT_196 = " imageDescriptor = "; - protected final String TEXT_197 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; - protected final String TEXT_198 = 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_199 = 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_200 = NL; - protected final String TEXT_201 = "\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_202 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_203 = " 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_204 = ") 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_205 = NL; - protected final String TEXT_206 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_207 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_208 = " feature, "; - protected final String TEXT_209 = " 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_210 = NL; - protected final String TEXT_211 = "\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_212 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_213 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_214 = NL; - protected final String TEXT_215 = "\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_216 = ".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_217 = NL + "\t\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_218 = ".eINSTANCE.get"; - protected final String TEXT_219 = "(), labelRefresher);"; - protected final String TEXT_220 = NL + "\t\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_221 = ".eINSTANCE.get"; - protected final String TEXT_222 = "(), labelRefresher);"; - protected final String TEXT_223 = NL; - protected final String TEXT_224 = "\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_225 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_226 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_227 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_228 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; + protected final String TEXT_125 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_126 = ".UNSET_VALUE));"; + protected final String TEXT_127 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_128 = NL + "\t\t\t\treturn "; + protected final String TEXT_129 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_130 = ".eINSTANCE.get"; + protected final String TEXT_131 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; + protected final String TEXT_132 = NL + "\t\t\t\treturn "; + protected final String TEXT_133 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_134 = ".eINSTANCE.get"; + protected final String TEXT_135 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_136 = ".UNSET_VALUE);"; + protected final String TEXT_137 = NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_138 = NL + "\t}" + NL; + protected final String TEXT_139 = NL; + protected final String TEXT_140 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_141 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_142 = ".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_143 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; + protected final String TEXT_144 = "(this, "; + protected final String TEXT_145 = ".class, new "; + protected final String TEXT_146 = "() {" + NL + "\t\t\t\tpublic void relocate("; + protected final String TEXT_147 = " celleditor) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_148 = " 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_149 = 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_150 = NL; + protected final String TEXT_151 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; + protected final String TEXT_152 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; + protected final String TEXT_153 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; + protected final String TEXT_154 = " element = "; + protected final String TEXT_155 = ";" + 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_156 = " element = "; + protected final String TEXT_157 = ";" + 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_158 = " element, String pattern) {"; + protected final String TEXT_159 = NL + "\t\tif (element.get"; + protected final String TEXT_160 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; + protected final String TEXT_161 = NL + "\t\treturn "; + protected final String TEXT_162 = ".format(pattern, new Object[] {"; + protected final String TEXT_163 = NL + "\t\t\t"; + protected final String TEXT_164 = NL + "\t\t});"; + protected final String TEXT_165 = NL + "\t\treturn "; + protected final String TEXT_166 = ".format(pattern, new Object[] {"; + protected final String TEXT_167 = NL + "\t\t"; + protected final String TEXT_168 = ","; + protected final String TEXT_169 = NL + "\t\t});"; + protected final String TEXT_170 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; + protected final String TEXT_171 = NL + "\t}"; + protected final String TEXT_172 = NL; + protected final String TEXT_173 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_174 = NL + "\t\t"; + protected final String TEXT_175 = " style =" + NL + "\t\t\t("; + protected final String TEXT_176 = ") "; + protected final String TEXT_177 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_178 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_179 = " 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_180 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_181 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_182 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_183 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_184 = " 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_185 = "(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_186 = "\t" + NL + "\t}"; + protected final String TEXT_187 = 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_188 = " createdFont;"; + protected final String TEXT_189 = "\t"; + protected final String TEXT_190 = NL; + protected final String TEXT_191 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; + protected final String TEXT_192 = " style = ("; + protected final String TEXT_193 = ") "; + protected final String TEXT_194 = ".getStyle("; + protected final String TEXT_195 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_196 = " 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_197 = " 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_198 = "(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_199 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_200 = " getLabelIcon() {"; + protected final String TEXT_201 = NL + "\t\t"; + protected final String TEXT_202 = " imageDescriptor = "; + protected final String TEXT_203 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; + protected final String TEXT_204 = 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_205 = 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_206 = NL; + protected final String TEXT_207 = "\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_208 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_209 = " 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_210 = ") 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_211 = NL; + protected final String TEXT_212 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_213 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_214 = " feature, "; + protected final String TEXT_215 = " 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_216 = NL; + protected final String TEXT_217 = "\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_218 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_219 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_220 = NL; + protected final String TEXT_221 = "\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_222 = ".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_223 = NL + "\t\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_224 = ".eINSTANCE.get"; + protected final String TEXT_225 = "(), labelRefresher);"; + protected final String TEXT_226 = NL + "\t\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_227 = ".eINSTANCE.get"; + protected final String TEXT_228 = "(), labelRefresher);"; protected final String TEXT_229 = NL; - protected final String TEXT_230 = "\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_231 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; - protected final String TEXT_232 = NL; - protected final String TEXT_233 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_234 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_235 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_236 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_237 = " createLabel() {"; - protected final String TEXT_238 = NL + "\t\treturn new "; - protected final String TEXT_239 = "();"; - protected final String TEXT_240 = NL + "\t\treturn "; - protected final String TEXT_241 = ";"; - protected final String TEXT_242 = NL + "\t\treturn new "; - protected final String TEXT_243 = "();"; - protected final String TEXT_244 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_245 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_246 = " label = createLabel();"; - protected final String TEXT_247 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_248 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_249 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_250 = NL + NL + "\t/**"; - protected final String TEXT_251 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_252 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_253 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_254 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_255 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_256 = "("; - protected final String TEXT_257 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_258 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_259 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_260 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_261 = NL; - protected final String TEXT_262 = NL; - protected final String TEXT_263 = 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_264 = NL + "}"; - protected final String TEXT_265 = NL; + protected final String TEXT_230 = "\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_231 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_232 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_233 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_234 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; + protected final String TEXT_235 = NL; + protected final String TEXT_236 = "\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_237 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; + protected final String TEXT_238 = NL; + protected final String TEXT_239 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_240 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_241 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_242 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_243 = " createLabel() {"; + protected final String TEXT_244 = NL + "\t\treturn new "; + protected final String TEXT_245 = "();"; + protected final String TEXT_246 = NL + "\t\treturn "; + protected final String TEXT_247 = ";"; + protected final String TEXT_248 = NL + "\t\treturn new "; + protected final String TEXT_249 = "();"; + protected final String TEXT_250 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_251 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_252 = " label = createLabel();"; + protected final String TEXT_253 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment("; + protected final String TEXT_254 = ".LEFT);"; + protected final String TEXT_255 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_256 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_257 = NL + NL + "\t/**"; + protected final String TEXT_258 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_259 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_260 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_261 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_262 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_263 = "("; + protected final String TEXT_264 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_265 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_266 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_267 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_268 = NL; + protected final String TEXT_269 = NL; + protected final String TEXT_270 = 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_271 = NL + "}"; + protected final String TEXT_272 = NL; public String generate(Object argument) { @@ -348,6 +355,16 @@ stringBuffer.append(TEXT_17); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_18); + stringBuffer.append(TEXT_19); + 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(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_23); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_24); String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()"; final String primaryView = "getDiagramNode()"; @@ -355,199 +372,199 @@ if (!isReadOnly) { - stringBuffer.append(TEXT_19); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_26); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_27); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_28); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_30); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_31); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_32); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("java.text.ParseException")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_35); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_38); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_39); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_41); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_45); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_49); stringBuffer.append(featureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_52); if (ecoreFeature.isMany()) { - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_55); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_57); stringBuffer.append(featureToSet.getAccessorName()); - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_60); } else { - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_61); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_62); } - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_63); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_64); stringBuffer.append(metaFeatures.size()); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_70); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_73); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_74); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_75); } - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_78); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_80); stringBuffer.append(i); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_82); if (nextEcoreFeature.isMany()) { - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_83); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_84); } - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_86); stringBuffer.append(nextFeatureToSet.getAccessorName()); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_89); } else { - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_91); } } - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_92); } - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_93); } - stringBuffer.append(TEXT_88); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_105); { TypeModelFacet facet = genNode.getModelFacet(); @@ -555,120 +572,120 @@ GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_108); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_111); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_112); } else { - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_115); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_117); } if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_120); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_121); } else { - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_124); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_126); } - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_127); } else { if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_128); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_130); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_131); } else { - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_134); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_136); } } - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_137); } /*restrict local vars used in component edit policy*/ - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_138); if (!isReadOnly) { - stringBuffer.append(TEXT_133); - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_140); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_148); } - stringBuffer.append(TEXT_143); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_150); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ HashMap primitiveTypeToWrapperClassName = new HashMap(); @@ -712,52 +729,52 @@ } } - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_151); stringBuffer.append(viewPattern); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_152); stringBuffer.append(editPattern); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_154); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_156); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_158); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_159); stringBuffer.append(feature.getCapName()); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_160); } - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_161); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_162); String value = "element.get" + feature.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ if (feature.isPrimitiveType()) { value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; } - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_163); stringBuffer.append(value); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_164); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_166); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); @@ -766,24 +783,24 @@ value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; } - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_167); stringBuffer.append(value); if (it.hasNext()) { - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_168); } } - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_169); } else { - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_170); } - stringBuffer.append(TEXT_165); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_172); boolean isFixedFontSetInFigure; { @@ -791,149 +808,149 @@ isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_173); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_176); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_185); } - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_186); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_188); } - stringBuffer.append(TEXT_183); - stringBuffer.append(TEXT_184); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_193); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_200); if (genChildNode.isLabelElementIcon()) { - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_203); } - stringBuffer.append(TEXT_198); - /*@ include file="adapters/propertySource.javajetinc"*/ - stringBuffer.append(TEXT_199); - stringBuffer.append(TEXT_200); - stringBuffer.append(TEXT_201); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); - stringBuffer.append(TEXT_202); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_203); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_204); + /*@ include file="adapters/propertySource.javajetinc"*/ stringBuffer.append(TEXT_205); stringBuffer.append(TEXT_206); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_207); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_209); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_210); stringBuffer.append(TEXT_211); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_212); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_213); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_214); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_215); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_217); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_218); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_221); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_222); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_224); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_225); } 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_220); + stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_227); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_228); } } - stringBuffer.append(TEXT_223); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_230); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_231); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_232); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_233); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_228); - stringBuffer.append(TEXT_229); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_236); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_237); final Viewmap viewmap = genChildNode.getViewmap(); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_238); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -962,64 +979,66 @@ if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_240); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_241); } else { - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_242); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_243); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_244); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_245); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_246); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_247); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_248); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_249); } - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_250); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_251); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_252); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_253); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); + stringBuffer.append(TEXT_254); } else { - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_255); } - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_256); } /*not parent-assigned*/ - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_257); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_258); } - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_260); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_261); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -1033,43 +1052,43 @@ } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_262); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_263); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_264); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_265); } else { - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_266); } - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_267); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_268); stringBuffer.append(classBody); - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_269); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_270); } } - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_271); importManager.emitSortedImports(); - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_272); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/VisualIDRegistryGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/VisualIDRegistryGenerator.java,v retrieving revision 1.5 diff -u -r1.5 VisualIDRegistryGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/VisualIDRegistryGenerator.java 14 Jun 2006 13:56:41 -0000 1.5 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/VisualIDRegistryGenerator.java 1 Aug 2006 13:55:33 -0000 @@ -48,7 +48,7 @@ protected final String TEXT_29 = ".VISUAL_ID;" + NL + "\t\t\t}"; protected final String TEXT_30 = NL + "\t\t\treturn getUnrecognized"; protected final String TEXT_31 = "ChildNodeID(domainElement);"; - protected final String TEXT_32 = NL + "\t\t}" + NL + "\t\treturn -1;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement) {" + NL + "\t\tEClass domainElementMetaclass = domainElement.eClass();" + NL + "\t\treturn getLinkWithClassVisualID(domainElement, domainElementMetaclass);" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement, EClass domainElementMetaclass) {"; + protected final String TEXT_32 = NL + "\t\t}" + NL + "\t\treturn -1;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement) {" + NL + "\t\tif (domainElement == null) {" + NL + "\t\t\treturn -1;" + NL + "\t\t}" + NL + "\t\tEClass domainElementMetaclass = domainElement.eClass();" + NL + "\t\treturn getLinkWithClassVisualID(domainElement, domainElementMetaclass);" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement, EClass domainElementMetaclass) {"; protected final String TEXT_33 = NL + "\t\tif ("; protected final String TEXT_34 = ".eINSTANCE.get"; protected final String TEXT_35 = "().isSuperTypeOf(domainElementMetaclass) && isLinkWithClass"; @@ -323,6 +323,7 @@ } } + final GenExpressionProviderContainer expressionProviders = genDiagram.getEditorGen().getExpressionProviders(); final List javaSelectorFacets = new ArrayList(); final Map __exprEnvVariables = Collections.EMPTY_MAP; Index: src-templates/org/eclipse/gmf/codegen/templates/lite/providers/LinkViewFactoryGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/providers/LinkViewFactoryGenerator.java,v retrieving revision 1.2 diff -u -r1.2 LinkViewFactoryGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/providers/LinkViewFactoryGenerator.java 26 Apr 2006 11:58:49 -0000 1.2 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/providers/LinkViewFactoryGenerator.java 1 Aug 2006 13:55:36 -0000 @@ -33,7 +33,7 @@ protected final String TEXT_15 = "Label("; protected final String TEXT_16 = " view) {" + NL + "\t\t"; protected final String TEXT_17 = " label = "; - protected final String TEXT_18 = ".eINSTANCE.createNode();" + NL + "\t\tview.getPersistedChildren().add(label);" + NL + "\t\tlabel.setElement(null);" + NL + "\t\t"; + protected final String TEXT_18 = ".eINSTANCE.createNode();" + NL + "\t\tview.getPersistedChildren().add(label);" + NL + "\t\t"; protected final String TEXT_19 = ".decorateView(label);" + NL + "\t}"; protected final String TEXT_20 = NL + "}"; protected final String TEXT_21 = NL; Index: templates/parts/NodeLabelEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/NodeLabelEditPart.javajet,v retrieving revision 1.6 diff -u -r1.6 NodeLabelEditPart.javajet --- templates/parts/NodeLabelEditPart.javajet 3 Jul 2006 18:07:48 -0000 1.6 +++ templates/parts/NodeLabelEditPart.javajet 1 Aug 2006 13:55:37 -0000 @@ -104,13 +104,8 @@ * @generated */ private <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%> resolveSemanticElement() { - for(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) { - View view = (View)editPart.getModel(); - if (view != null && view.getElement() != null) { - return (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement(); - } - } - return null; + View view = (View) getModel(); + return (view.getElement() instanceof <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) ? (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement() : null; } /** Index: templates/parts/LinkLabelEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkLabelEditPart.javajet,v retrieving revision 1.7 diff -u -r1.7 LinkLabelEditPart.javajet --- templates/parts/LinkLabelEditPart.javajet 3 Jul 2006 18:07:48 -0000 1.7 +++ templates/parts/LinkLabelEditPart.javajet 1 Aug 2006 13:55:36 -0000 @@ -170,13 +170,27 @@ * @generated */ private <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> resolveSemanticElement() { - for(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) { - View view = (View)editPart.getModel(); - if (view != null && view.getElement() != null) { - return (<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) view.getElement(); - } + <%=importManager.getImportedName(genHost.getEditPartQualifiedClassName())%> parent = getUpdatableParent(); + if (parent == null || parent.getModel() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> == false) { + return null; } +<% +if (genHost.getModelFacet() instanceof TypeLinkModelFacet) { +%> + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) parent.getModel(); + return (<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) view.getElement(); +<% +} else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) { +%> + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target = ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) parent.getModel()).getTarget(); + return (target != null && target.getElement() instanceof <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) ? (<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) target.getElement() : null; +<% +} else { +%> return null; +<% +} +%> } /** Index: templates/parts/CompartmentEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/CompartmentEditPart.javajet,v retrieving revision 1.5 diff -u -r1.5 CompartmentEditPart.javajet --- templates/parts/CompartmentEditPart.javajet 19 Jun 2006 19:14:13 -0000 1.5 +++ templates/parts/CompartmentEditPart.javajet 1 Aug 2006 13:55:36 -0000 @@ -193,13 +193,8 @@ * @generated */ private <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%> resolveSemanticElement() { - for(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) { - View view = (View)editPart.getModel(); - if (view != null && view.getElement() != null) { - return (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement(); - } - } - return null; + View view = getDiagramNode(); + return (view.getElement() instanceof <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) ? (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement() : null; } /** Index: templates/parts/NodeEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/NodeEditPart.javajet,v retrieving revision 1.14 diff -u -r1.14 NodeEditPart.javajet --- templates/parts/NodeEditPart.javajet 4 Jul 2006 15:44:10 -0000 1.14 +++ templates/parts/NodeEditPart.javajet 1 Aug 2006 13:55:37 -0000 @@ -8,6 +8,8 @@ Palette palette = genDiagram.getPalette(); boolean isXYLayout = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genNode); final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc +importManager.registerInnerClass("LinkDescriptor"); //from linkNotationModelRefresher.jetinc class NodeEditPartHelper { private final List myInnerLabels = new LinkedList(); @@ -15,6 +17,8 @@ private final List myExternalLabels = new LinkedList(); private final List myPinnedCompartments = new LinkedList(); private final List myFloatingCompartments = new LinkedList(); + private final List myContainedFeatureModelFacetLinks = new LinkedList(); + private final List myContainedTypeModelFacetLinks = new LinkedList(); private GenNodeLabel myPrimaryLabel; private boolean myHasChildrenInListCompartments = false; private boolean hasIncomingLinks = false; @@ -56,24 +60,51 @@ } GenClass incomingClass; GenClass outgoingClass; + GenClass containerClass; if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); incomingClass = modelFacet.getTargetMetaFeature().getTypeGenClass(); outgoingClass = modelFacet.getSourceMetaFeature() == null ? modelFacet.getContainmentMetaFeature().getGenClass() : modelFacet.getSourceMetaFeature().getTypeGenClass(); + if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) { + //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link. + containerClass = null; + } else { + containerClass = modelFacet.getContainmentMetaFeature().getGenClass(); + } } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); incomingClass = metaFeature.getTypeGenClass(); outgoingClass = metaFeature.getGenClass(); + containerClass = metaFeature.getGenClass(); } else { continue; } hasIncomingLinks |= (incomingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())); hasOutgoingLinks |= (outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())); + if (containerClass != null && containerClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())) { + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + myContainedTypeModelFacetLinks.add(genLink); + } else { + myContainedFeatureModelFacetLinks.add(genLink); + } + } } } + public boolean containsLinks() { + return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks(); + } + + public boolean containsFeatureModelFacetLinks() { + return !myContainedFeatureModelFacetLinks.isEmpty(); + } + + public boolean containsTypeModelFacetLinks() { + return !myContainedTypeModelFacetLinks.isEmpty(); + } + public boolean hasIncomingLinks() { return hasIncomingLinks; } @@ -121,6 +152,14 @@ public Iterator getAllInnerLabels() { return myAllInnerLabels.iterator(); } + + public Iterator getContainedFeatureModelFacetLinks() { + return myContainedFeatureModelFacetLinks.iterator(); + } + + public Iterator getContainedTypeModelFacetLinks() { + return myContainedTypeModelFacetLinks.iterator(); + } } final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode); %> @@ -158,6 +197,8 @@ setModel(model); } +<%@ include file="registerModel.jetinc"%> + /** * @generated */ @@ -413,6 +454,13 @@ return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; } }); +<% +if (myHelper.containsLinks()) { +%> + installLinkNotationModelRefresher(); +<% +} +%> } /** @@ -884,15 +932,40 @@ public void activate() { super.activate(); getDiagramNode().getElement().eAdapters().add(domainModelRefresher); +<% +if (myHelper.containsLinks()) { +%> + installLinkNotationModelRefresher(); +<% +} +%> } /** * @generated */ public void deactivate() { +<% +if (myHelper.containsLinks()) { +%> + uninstallLinkNotationModelRefresher(); +<% +} +%> getDiagramNode().getElement().eAdapters().remove(domainModelRefresher); super.deactivate(); } +<% +{ + final String _getViewCode = "getDiagramNode()"; + final String _getDiagramCode = "getDiagramNode().getDiagram()"; + final String _getSemanticElementCode = "getDiagramNode().getElement()"; + final boolean _includeUncontainedLinks = false; +%> +<%@ include file="linkNotationModelRefresher.jetinc"%> +<% +} //end of local declarations +%> <%@ include file="refreshers.javajetinc/domainModelRefresher.javajetinc"%> Index: templates/parts/ChildNodeEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/ChildNodeEditPart.javajet,v retrieving revision 1.6 diff -u -r1.6 ChildNodeEditPart.javajet --- templates/parts/ChildNodeEditPart.javajet 3 Jul 2006 18:07:48 -0000 1.6 +++ templates/parts/ChildNodeEditPart.javajet 1 Aug 2006 13:55:36 -0000 @@ -49,6 +49,8 @@ return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) getModel(); } +<%@ include file="registerModel.jetinc"%> + /** * @generated */ Index: templates/parts/DiagramEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramEditPart.javajet,v retrieving revision 1.5 diff -u -r1.5 DiagramEditPart.javajet --- templates/parts/DiagramEditPart.javajet 19 Jun 2006 19:14:13 -0000 1.5 +++ templates/parts/DiagramEditPart.javajet 1 Aug 2006 13:55:36 -0000 @@ -4,7 +4,65 @@ GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0]; 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(); + +class DiagramEditPartHelper { + private final List myContainedFeatureModelFacetLinks = new LinkedList(); + private final List myContainedTypeModelFacetLinks = new LinkedList(); + public DiagramEditPartHelper(GenDiagram diagram) { + for(Iterator it = diagram.getLinks().iterator(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) { + continue; + } + GenClass containerClass; + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) { + //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link. + containerClass = null; + } else { + containerClass = modelFacet.getContainmentMetaFeature().getGenClass(); + } + } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + containerClass = metaFeature.getGenClass(); + } else { + continue; + } + if (containerClass.getEcoreClass().isSuperTypeOf(diagram.getDomainDiagramElement().getEcoreClass())) { + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + myContainedTypeModelFacetLinks.add(genLink); + } else { + myContainedFeatureModelFacetLinks.add(genLink); + } + } + } + } + + public boolean containsLinks() { + return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks(); + } + + public boolean containsFeatureModelFacetLinks() { + return !myContainedFeatureModelFacetLinks.isEmpty(); + } + + public boolean containsTypeModelFacetLinks() { + return !myContainedTypeModelFacetLinks.isEmpty(); + } + + public Iterator getContainedFeatureModelFacetLinks() { + return myContainedFeatureModelFacetLinks.iterator(); + } + + public Iterator getContainedTypeModelFacetLinks() { + return myContainedTypeModelFacetLinks.iterator(); + } +} +final DiagramEditPartHelper myHelper = new DiagramEditPartHelper(genDiagram); %> <% @@ -65,6 +123,17 @@ return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>) getModel(); } +<%@ include file="registerModel.jetinc"%> + + /** + * @generated + */ + public void addNotify() { + getDiagram().eAdapters().add(updateManager); + getDiagram().getElement().eAdapters().add(domainModelRefresher); + super.addNotify(); + } + /** * @generated */ @@ -143,6 +212,14 @@ } }); installNotationModelRefresher(); +<% +//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links +//if (myHelper.containsLinks()) { +%> + installLinkNotationModelRefresher(); +<% +//} +%> } /** @@ -250,15 +327,35 @@ */ public void activate() { super.activate(); - getDiagram().eAdapters().add(updateManager); - getDiagram().getElement().eAdapters().add(domainModelRefresher); + if (!getDiagram().eAdapters().contains(updateManager)) { + getDiagram().eAdapters().add(updateManager); + } + if (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) { + getDiagram().getElement().eAdapters().add(domainModelRefresher); + } installNotationModelRefresher(); +<% +//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links +//if (myHelper.containsLinks()) { +%> + installLinkNotationModelRefresher(); +<% +//} +%> } /** * @generated */ public void deactivate() { +<% +//link notation model refresher should always be installed/uninstalled for the diagram edit part, because it tracks the uncontained links +//if (myHelper.containsLinks()) { +%> + uninstallLinkNotationModelRefresher(); +<% +//} +%> uninstallNotationModelRefresher(); getDiagram().getElement().eAdapters().remove(domainModelRefresher); getDiagram().eAdapters().remove(updateManager); @@ -271,8 +368,11 @@ String _getViewCode = "getDiagram()"; String _getSemanticElementCode = "getDiagram().getElement()"; boolean isListLayout = false; +final boolean _includeUncontainedLinks = true; %> <%@ include file="notationModelRefresher.jetinc"%> + +<%@ include file="linkNotationModelRefresher.jetinc"%> <% } %> Index: templates/parts/notationModelRefresher.jetinc =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/notationModelRefresher.jetinc,v retrieving revision 1.1 diff -u -r1.1 notationModelRefresher.jetinc --- templates/parts/notationModelRefresher.jetinc 19 Jun 2006 19:14:13 -0000 1.1 +++ templates/parts/notationModelRefresher.jetinc 1 Aug 2006 13:55:37 -0000 @@ -88,41 +88,43 @@ */ private void createFilter() { <% -boolean hasDeclaredFilter = false; -Set genChildFeatures = new LinkedHashSet(); -for (Iterator it = childNodes.iterator(); it.hasNext(); ) { - GenNode nextNode = (GenNode) it.next(); - TypeModelFacet typeModelFacet = nextNode.getModelFacet(); - if (typeModelFacet == null) { - continue; - } - GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature(); - if (genChildFeatures.contains(childMetaFeature)) { - continue; - } - genChildFeatures.add(childMetaFeature); - if (!hasDeclaredFilter) { - hasDeclaredFilter = true; +{ + boolean hasDeclaredFilter = false; + Set genChildFeatures = new LinkedHashSet(); + for (Iterator it = childNodes.iterator(); it.hasNext(); ) { + GenNode nextNode = (GenNode) it.next(); + TypeModelFacet typeModelFacet = nextNode.getModelFacet(); + if (typeModelFacet == null) { + continue; + } + GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature(); + if (genChildFeatures.contains(childMetaFeature)) { + continue; + } + genChildFeatures.add(childMetaFeature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; %> filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childMetaFeature.getFeatureAccessorName()%>()); <% - } else { + } else { %> filter = filter.or(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childMetaFeature.getFeatureAccessorName()%>())); <% - } -} //for + } + } //for %> <% -if (hasDeclaredFilter) { + if (hasDeclaredFilter) { %> filter = filter.and(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>)); <% -} else { + } else { %> filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>); <% -} + } +} //local declaration of hasDeclaredFilter %> <% if (hasConstraintsInChildren) { Index: templates/parts/LinkEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkEditPart.javajet,v retrieving revision 1.6 diff -u -r1.6 LinkEditPart.javajet --- templates/parts/LinkEditPart.javajet 4 Jul 2006 15:44:10 -0000 1.6 +++ templates/parts/LinkEditPart.javajet 1 Aug 2006 13:55:36 -0000 @@ -36,6 +36,8 @@ return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getModel(); } +<%@ include file="registerModel.jetinc"%> + /** * @generated */ Index: templates/editor/VisualIDRegistry.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/VisualIDRegistry.javajet,v retrieving revision 1.3 diff -u -r1.3 VisualIDRegistry.javajet --- templates/editor/VisualIDRegistry.javajet 31 May 2006 15:54:57 -0000 1.3 +++ templates/editor/VisualIDRegistry.javajet 1 Aug 2006 13:55:36 -0000 @@ -171,6 +171,9 @@ * @generated */ public int getLinkWithClassVisualID(EObject domainElement) { + if (domainElement == null) { + return -1; + } EClass domainElementMetaclass = domainElement.eClass(); return getLinkWithClassVisualID(domainElement, domainElementMetaclass); } @@ -290,6 +293,7 @@ } } + final GenExpressionProviderContainer expressionProviders = genDiagram.getEditorGen().getExpressionProviders(); final List javaSelectorFacets = new ArrayList(); final Map __exprEnvVariables = Collections.EMPTY_MAP; Index: templates/commands/RemoveNotationalElementCommand.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/commands/RemoveNotationalElementCommand.javajet,v retrieving revision 1.1 diff -u -r1.1 RemoveNotationalElementCommand.javajet --- templates/commands/RemoveNotationalElementCommand.javajet 19 Jun 2006 19:14:13 -0000 1.1 +++ templates/commands/RemoveNotationalElementCommand.javajet 1 Aug 2006 13:55:36 -0000 @@ -26,6 +26,16 @@ /** * @generated */ + private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> domainElement; + + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> removeEdgeCommands; + + /** + * @generated + */ public RemoveNotationalElementCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> childView) { this.parentView = parentView; this.childView = childView; @@ -34,8 +44,20 @@ /** * @generated */ - public boolean canExecute() { - return parentView.getChildren().contains(childView); + protected boolean prepare() { + if (!parentView.getChildren().contains(childView)) { + return false; + } + removeEdgeCommands = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); + for(<%=importManager.getImportedName("java.util.Iterator")%> it = childView.getSourceEdges().iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next(); + removeEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next)); + } + for(Iterator it = childView.getTargetEdges().iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next(); + removeEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next)); + } + return removeEdgeCommands.canExecute(); } /** @@ -50,6 +72,18 @@ */ public void execute() { parentView.removeChild(childView); + removeEdgeCommands.execute(); + sweepElement(); + } + + /** + * @generated + */ + protected void sweepElement() { + if (childView.isSetElement()) { + domainElement = childView.getElement(); + childView.setElement(null); + } } /** @@ -63,7 +97,32 @@ * @generated */ public void undo() { + restoreElement(); + removeEdgeCommands.undo(); parentView.insertChild(childView); } + + /** + * @generated + */ + protected void restoreElement() { + if (childView.isSetElement()) { + childView.setElement(domainElement); + } + } + + /** + * @generated + */ + protected final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> getChildView() { + return childView; + } + + /** + * @generated + */ + protected final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> getParent() { + return parentView; + } } <%importManager.emitSortedImports();%> Index: templates/commands/CreateNotationalElementCommand.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/commands/CreateNotationalElementCommand.javajet,v retrieving revision 1.1 diff -u -r1.1 CreateNotationalElementCommand.javajet --- templates/commands/CreateNotationalElementCommand.javajet 19 Jun 2006 19:14:13 -0000 1.1 +++ templates/commands/CreateNotationalElementCommand.javajet 1 Aug 2006 13:55:36 -0000 @@ -48,6 +48,13 @@ /** * @generated */ + protected final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> getParent() { + return parent; + } + + /** + * @generated + */ public boolean canExecute() { return createdView != null; } Index: templates/commands/ReplaceNotationalElementCommand.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/commands/ReplaceNotationalElementCommand.javajet,v retrieving revision 1.2 diff -u -r1.2 ReplaceNotationalElementCommand.javajet --- templates/commands/ReplaceNotationalElementCommand.javajet 25 Jun 2006 15:32:29 -0000 1.2 +++ templates/commands/ReplaceNotationalElementCommand.javajet 1 Aug 2006 13:55:36 -0000 @@ -33,7 +33,7 @@ public ReplaceNotationalElementCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, CreateNotationalElementCommand createCommand, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> obsoleteView) { this.createCommand = createCommand; this.obsoleteView = obsoleteView; - this.removeCommand = new RemoveNotationalElementCommand(parentView, obsoleteView); + this.removeCommand = obsoleteView instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> ? new RemoveNotationalEdgeCommand(parentView, obsoleteView) : new RemoveNotationalElementCommand(parentView, obsoleteView); } /** @@ -57,15 +57,14 @@ createCommand.execute(); removeCommand.execute(); <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> createdView = createCommand.getCreatedView(); - createdView.getSourceEdges().addAll(obsoleteView.getSourceEdges()); - createdView.getTargetEdges().addAll(obsoleteView.getTargetEdges()); - if (createdView == null || obsoleteView == null || !createdView.eClass().equals(obsoleteView.eClass())) { - return; - } - if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode().equals(createdView.eClass())) { - copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode_LayoutConstraint()); - } else if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge().equals(createdView.eClass())) { - copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge_Bendpoints()); +// createdView.getSourceEdges().addAll(obsoleteView.getSourceEdges()); +// createdView.getTargetEdges().addAll(obsoleteView.getTargetEdges()); + if (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) { + if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode().equals(createdView.eClass())) { + copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode_LayoutConstraint()); + } else if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge().equals(createdView.eClass())) { + copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge_Bendpoints()); + } } } @@ -89,8 +88,15 @@ */ public void undo() { <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> createdView = createCommand.getCreatedView(); - obsoleteView.getSourceEdges().addAll(createdView.getSourceEdges()); - obsoleteView.getTargetEdges().addAll(createdView.getTargetEdges()); + if (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) { + if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode().equals(createdView.eClass())) { + copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode_LayoutConstraint()); + } else if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge().equals(createdView.eClass())) { + copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge_Bendpoints()); + } + } +// obsoleteView.getSourceEdges().addAll(createdView.getSourceEdges()); +// obsoleteView.getTargetEdges().addAll(createdView.getTargetEdges()); removeCommand.undo(); createCommand.undo(); } Index: src/org/eclipse/gmf/internal/codegen/lite/Generator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java,v retrieving revision 1.10 diff -u -r1.10 Generator.java --- src/org/eclipse/gmf/internal/codegen/lite/Generator.java 3 Jul 2006 17:42:27 -0000 1.10 +++ src/org/eclipse/gmf/internal/codegen/lite/Generator.java 1 Aug 2006 13:55:36 -0000 @@ -144,7 +144,9 @@ generateExpressionProviders(); } internalGenerateJavaClass(myEmitters.getCreateNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "CreateNotationalElementCommand", myDiagram); + internalGenerateJavaClass(myEmitters.getCreateNotationalEdgeCommandGenerator(), myDiagram.getEditCommandsPackageName(), "CreateNotationalEdgeCommand", myDiagram); internalGenerateJavaClass(myEmitters.getRemoveNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "RemoveNotationalElementCommand", myDiagram); + internalGenerateJavaClass(myEmitters.getRemoveNotationalEdgeCommandGenerator(), myDiagram.getEditCommandsPackageName(), "RemoveNotationalEdgeCommand", myDiagram); internalGenerateJavaClass(myEmitters.getReplaceNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReplaceNotationalElementCommand", myDiagram); internalGenerateJavaClass(myEmitters.getReconnectNotationalEdgeSourceCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReconnectNotationalEdgeSourceCommand", myDiagram); internalGenerateJavaClass(myEmitters.getReconnectNotationalEdgeTargetCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReconnectNotationalEdgeTargetCommand", myDiagram); Index: src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java,v retrieving revision 1.7 diff -u -r1.7 CodegenEmitters.java --- src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java 3 Jul 2006 17:42:27 -0000 1.7 +++ src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java 1 Aug 2006 13:55:36 -0000 @@ -24,9 +24,11 @@ import org.eclipse.gmf.internal.common.codegen.JETEmitterAdapter; import org.eclipse.gmf.internal.common.codegen.TextEmitter; +import org.eclipse.gmf.codegen.templates.lite.commands.CreateNotationalEdgeCommandGenerator; import org.eclipse.gmf.codegen.templates.lite.commands.CreateNotationalElementCommandGenerator; import org.eclipse.gmf.codegen.templates.lite.commands.ReconnectNotationalEdgeSourceCommandGenerator; import org.eclipse.gmf.codegen.templates.lite.commands.ReconnectNotationalEdgeTargetCommandGenerator; +import org.eclipse.gmf.codegen.templates.lite.commands.RemoveNotationalEdgeCommandGenerator; import org.eclipse.gmf.codegen.templates.lite.commands.RemoveNotationalElementCommandGenerator; import org.eclipse.gmf.codegen.templates.lite.commands.ReplaceNotationalElementCommandGenerator; import org.eclipse.gmf.codegen.templates.lite.editor.ActionBarContributorGenerator; @@ -129,9 +131,11 @@ put(tr, "/expressions/OCLExpressionFactory.javajet", OCLExpressionFactoryGenerator.class); put(tr, "/expressions/RegexpExpressionFactory.javajet", RegexpExpressionFactoryGenerator.class); put(tr, "/commands/CreateNotationalElementCommand.javajet", CreateNotationalElementCommandGenerator.class); + put(tr, "/commands/CreateNotationalEdgeCommand.javajet", CreateNotationalEdgeCommandGenerator.class); put(tr, "/commands/ReconnectNotationalEdgeSourceCommand.javajet", ReconnectNotationalEdgeSourceCommandGenerator.class); put(tr, "/commands/ReconnectNotationalEdgeTargetCommand.javajet", ReconnectNotationalEdgeTargetCommandGenerator.class); put(tr, "/commands/RemoveNotationalElementCommand.javajet", RemoveNotationalElementCommandGenerator.class); + put(tr, "/commands/RemoveNotationalEdgeCommand.javajet", RemoveNotationalEdgeCommandGenerator.class); put(tr, "/commands/ReplaceNotationalElementCommand.javajet", ReplaceNotationalElementCommandGenerator.class); return tr; } @@ -276,10 +280,18 @@ return retrieve(CreateNotationalElementCommandGenerator.class); } + public TextEmitter getCreateNotationalEdgeCommandGenerator() throws UnexpectedBehaviourException { + return retrieve(CreateNotationalEdgeCommandGenerator.class); + } + public TextEmitter getRemoveNotationalElementCommandGenerator() throws UnexpectedBehaviourException { return retrieve(RemoveNotationalElementCommandGenerator.class); } + public TextEmitter getRemoveNotationalEdgeCommandGenerator() throws UnexpectedBehaviourException { + return retrieve(RemoveNotationalEdgeCommandGenerator.class); + } + public TextEmitter getReplaceNotationalElementCommandGenerator() throws UnexpectedBehaviourException { return retrieve(ReplaceNotationalElementCommandGenerator.class); } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java,v retrieving revision 1.1 diff -u -r1.1 RemoveNotationalElementCommandGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java 19 Jun 2006 19:14:13 -0000 1.1 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java 1 Aug 2006 13:55:32 -0000 @@ -19,10 +19,20 @@ 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 + "\tpublic RemoveNotationalElementCommand("; - protected final String TEXT_7 = " parentView, "; - protected final String TEXT_8 = " childView) {" + NL + "\t\tthis.parentView = parentView;" + NL + "\t\tthis.childView = childView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn parentView.getChildren().contains(childView);" + 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}" + 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\tparentView.insertChild(childView);" + NL + "\t}" + NL + "}"; - protected final String TEXT_9 = NL; + 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\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\tremoveEdgeCommands.execute();" + 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) { @@ -43,12 +53,32 @@ 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(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_8); - importManager.emitSortedImports(); + 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(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java,v retrieving revision 1.1 diff -u -r1.1 CreateNotationalElementCommandGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java 19 Jun 2006 19:14:13 -0000 1.1 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java 1 Aug 2006 13:55:32 -0000 @@ -22,8 +22,9 @@ 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 + "\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_10 = NL; + 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) { @@ -50,8 +51,10 @@ stringBuffer.append(TEXT_8); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_9); - importManager.emitSortedImports(); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_10); + importManager.emitSortedImports(); + stringBuffer.append(TEXT_11); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java,v retrieving revision 1.2 diff -u -r1.2 ReplaceNotationalElementCommandGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java 25 Jun 2006 15:32:29 -0000 1.2 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java 1 Aug 2006 13:55:33 -0000 @@ -20,21 +20,26 @@ 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 = 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_8 = " 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\treturn;" + NL + "\t\t}" + NL + "\t\tif ("; - protected final String TEXT_9 = ".eINSTANCE.getNode().equals(createdView.eClass())) {" + NL + "\t\t\tcopy(obsoleteView, createdView, "; - protected final String TEXT_10 = ".eINSTANCE.getNode_LayoutConstraint());" + NL + "\t\t} else if ("; - protected final String TEXT_11 = ".eINSTANCE.getEdge().equals(createdView.eClass())) {" + NL + "\t\t\tcopy(obsoleteView, createdView, "; - protected final String TEXT_12 = ".eINSTANCE.getEdge_Bendpoints());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void copy("; - protected final String TEXT_13 = " source, "; - protected final String TEXT_14 = " target, "; - protected final String TEXT_15 = " feature) {" + NL + "\t\t"; - protected final String TEXT_16 = " oldValue = ("; - protected final String TEXT_17 = ") 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_18 = " newValue = ("; - protected final String TEXT_19 = ") 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_20 = " createdView = createCommand.getCreatedView();" + 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_21 = NL; + 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) { @@ -57,9 +62,9 @@ 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(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + 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); @@ -67,13 +72,13 @@ stringBuffer.append(TEXT_11); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_12); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + 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.EStructuralFeature")); - stringBuffer.append(TEXT_15); 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); @@ -81,10 +86,20 @@ stringBuffer.append(TEXT_18); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_19); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_20); - importManager.emitSortedImports(); + 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(); } } Index: templates/parts/linkNotationModelRefresher.jetinc =================================================================== RCS file: templates/parts/linkNotationModelRefresher.jetinc diff -N templates/parts/linkNotationModelRefresher.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/parts/linkNotationModelRefresher.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,526 @@ +<% +if (myHelper.containsLinks() || _includeUncontainedLinks) { +%> + /** + * @generated + */ + private void installLinkNotationModelRefresher() { + LinkNotationModelRefresher refresher = getLinkNotationModelRefresher(); + if (refresher.isInstalled()) { + return; + } + <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(<%=_getDiagramCode%>.getElement()); + refresher.install(domainModelEditDomain); + refreshLinkNotationModel(); + } + + /** + * @generated + */ + private void uninstallLinkNotationModelRefresher() { + getLinkNotationModelRefresher().uninstall(); + } + + /** + * @generated + */ + private LinkNotationModelRefresher linkNotationModelRefresher; + + /** + * @generated + */ + private LinkNotationModelRefresher getLinkNotationModelRefresher() { + if (linkNotationModelRefresher == null) { + linkNotationModelRefresher = new LinkNotationModelRefresher(); + } + return linkNotationModelRefresher; + } + + /** + * @generated + */ + private class LinkNotationModelRefresher extends <%=importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")%> { + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> filter; + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain; + + /** + * @generated + */ + public LinkNotationModelRefresher() { + createFilter(); + } +<% + boolean hasConstraintsInContainedLinks = false; + for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) { + hasConstraintsInContainedLinks = true; + break; + } + } + if (hasConstraintsInContainedLinks) { +%> + + /** + * NB: Child links of this element are selected based on constraint declared in <%=genDiagram.getVisualIDRegistryQualifiedClassName()%>. + * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in + * notational model having to be updated. + *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications + * result in such an update. + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> getConstrainedChildLinksFilter() { + return <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.NOT_TOUCH; + } +<% + } + if (_includeUncontainedLinks) { +%> + /** + * Creates a notification filter which filters notifications that may possibly result in uncontained links. + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> createUncontainedLinksFilter() { + return <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET).or( + <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.UNSET).or( + <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.REMOVE).or( + <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.REMOVE_MANY) + ))); + } +<% + } +%> + /** + * Creates a notification filter which filters notifications that may possibly affect the notational model + * @generated + */ + private void createFilter() { +<% + { + boolean hasDeclaredFilter = false; + Set genAffectingFeatures = new LinkedHashSet(); + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (modelFacet == null) { + continue; + } + GenFeature _feature = modelFacet.getChildMetaFeature(); +%> +<%@ include file="notificationFilter.jetinc" %> +<% + _feature = modelFacet.getSourceMetaFeature(); +%> +<%@ include file="notificationFilter.jetinc" %> +<% + _feature = modelFacet.getTargetMetaFeature(); +%> +<%@ include file="notificationFilter.jetinc" %> +<% + } + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature(); +%> +<%@ include file="notificationFilter.jetinc" %> +<% + } + if (hasConstraintsInContainedLinks) { + if (hasDeclaredFilter) { +%> + filter = getConstrainedChildLinksFilter().or(filter); +<% + } else { + hasDeclaredFilter = true; +%> + filter = getConstrainedChildLinksFilter(); +<% + } + } + if (_includeUncontainedLinks) { + if (hasDeclaredFilter) { +%> + filter = filter.or(createUncontainedLinksFilter()); +<% + } else { + hasDeclaredFilter = true; +%> + filter = createUncontainedLinksFilter(); +<% + } + } + if (!hasDeclaredFilter) { +%> + filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.ANY.negated(); +<% + } + } //local declaration of hasDeclaredFilter +%> + } + /** + * @generated + */ + public void install(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain) { + if (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) { + throw new IllegalStateException("Already listening to another editing domain"); + } + this.editingDomain = editingDomain; + this.editingDomain.addResourceSetListener(this); + } + /** + * @generated + */ + public boolean isInstalled() { + return editingDomain != null; + } + + /** + * @generated + */ + public void uninstall() { + if (isInstalled()) { + editingDomain.removeResourceSetListener(this); + editingDomain = null; + } + } + + /** + * @generated + */ + public boolean isPrecommitOnly() { + return true; + } + /** + * @generated + */ + public <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> transactionAboutToCommit(<%=importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")%> event) { + return getRefreshLinkNotationModelCommand(); + } + /** + * @generated + */ + public <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> getFilter() { + return filter; + } + } + + /** + * @generated + */ + protected void refreshLinkNotationModel() { + <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> command = getRefreshLinkNotationModelCommand(); + if (command == null) { + return; + } + <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(<%=_getDiagramCode%>.getElement()); + getViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command)); + } + +<%@include file="linkDescriptor.jetinc"%> + + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> getRefreshLinkNotationModelCommand() { + <%=importManager.getImportedName("java.util.List")%>/**/ semanticChildLinks = getSemanticChildLinks(); + <%=importManager.getImportedName("java.util.List")%>/**/ notationalChildLinks = getNotationalChildLinks(); + final <%=importManager.getImportedName("java.util.Map")%> semanticToNotationalTypeBasedLinks = new <%=importManager.getImportedName("java.util.HashMap")%>(); + final <%=importManager.getImportedName("java.util.Map")%>/*>*/ semanticToNotationalFeatureBasedLinks = new <%=importManager.getImportedName("java.util.HashMap")%>(); + for(<%=importManager.getImportedName("java.util.Iterator")%> it = notationalChildLinks.iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next(); + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextSemantic = next.getElement(); + if (nextSemantic != null) { + semanticToNotationalTypeBasedLinks.put(nextSemantic, next); + } else { + <%=importManager.getImportedName("java.util.List")%> featureBasedLinksForSource = (<%=importManager.getImportedName("java.util.List")%>) semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement()); + if (featureBasedLinksForSource == null) { + featureBasedLinksForSource = new <%=importManager.getImportedName("java.util.LinkedList")%>(); + semanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource); + } + featureBasedLinksForSource.add(next); + } + } + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView = <%=_getDiagramCode%>; + <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> command = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); + for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticChildLinks.iterator(); it.hasNext(); ) { + LinkDescriptor next = (LinkDescriptor) it.next(); + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextLinkElement = next.getLinkElement(); + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> currentEdge; + if (nextLinkElement != null) { + currentEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) semanticToNotationalTypeBasedLinks.remove(nextLinkElement); + } else { + <%=importManager.getImportedName("java.util.List")%> featureBasedLinksForSource = (<%=importManager.getImportedName("java.util.List")%>) semanticToNotationalFeatureBasedLinks.get(next.getSource()); + if (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) { + currentEdge = null; + } else { + currentEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) featureBasedLinksForSource.remove(0); + } + } + int linkVisualID = next.getVisualID(); + if (currentEdge == null) { + if (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) { + command.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next)); + } + } else { + boolean changedSource = currentEdge.getSource().getElement() != next.getSource(); + boolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination(); + boolean changedVID = linkVisualID != <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(currentEdge); + if (!changedSource && !changedTarget) { + if (changedVID) { + <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")%> notationalCommand = getCreateNotationalEdgeCommand(parentView, next); + if (notationalCommand != null) { + command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")%>(parentView, notationalCommand, currentEdge)); + } else { + command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, currentEdge)); + } + } + } else { + if (changedVID) { + command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, currentEdge)); + command.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next)); + } else { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> newSourceView = findView(next.getSource()); + if (changedSource && newSourceView != null) { + command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")%>(currentEdge, newSourceView)); + } + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> newTargetView = findView(next.getDestination()); + if (changedTarget && newTargetView != null) { + command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")%>(currentEdge, newTargetView)); + } + } + } + } + } + for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> obsoleteView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) it.next(); + command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, obsoleteView)); + } + for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("java.util.List")%> obsoleteViews = (<%=importManager.getImportedName("java.util.List")%>) it.next(); + for(<%=importManager.getImportedName("java.util.Iterator")%> obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> obsoleteView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) obsoleteViewsIt.next(); + command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, obsoleteView)); + } + } + return command.getCommandList().isEmpty() ? null : command; + } + + /** + * Finds a notational element that corresponds to the given underlying domain element. + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> findView(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelElement) { + if (modelElement == null) { + return null; + } + <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> editPart = (<%=importManager.getImportedName("org.eclipse.gef.EditPart")%>) getViewer().getEditPartRegistry().get(modelElement); + if (editPart != null && editPart.getModel() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) { + return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) editPart.getModel(); + } + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView = findView(modelElement.eContainer()); + if (parentView != null) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> result = findNode(parentView, modelElement); + if (result != null) { + return result; + } + } + return findEdge(modelElement); + } + + /** + * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> findNode(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelElement) { + for(<%=importManager.getImportedName("java.util.Iterator")%> it = parentView.getChildren().iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) it.next(); + if (!next.isSetElement() || next.getElement() == parentView) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> result = findNode(next, modelElement); + if (result != null) { + return result; + } + } + if (next.isSetElement() && next.getElement() == modelElement) { + return next; + } + } + return null; + } + + /** + * Finds a notational edge that corresponds to the given underlying domain element. + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> findEdge(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelElement) { + for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%=_getDiagramCode%>.getEdges().iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next(); + if (next.isSetElement() && next.getElement() == modelElement) { + return next; + } + } + return null; + } + + /** + * @generated + */ + private <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")%> getCreateNotationalEdgeCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, LinkDescriptor linkDescriptor) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> sourceView = findView(linkDescriptor.getSource()); + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> targetView = findView(linkDescriptor.getDestination()); + if (sourceView == null || targetView == null) { + return null; + } + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createEdge(); + switch (linkDescriptor.getVisualID()) { +<% + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (modelFacet == null) { + continue; + } +%> + case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID: + if (linkDescriptor.getLinkElement() instanceof <%=importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())%>) { + createdEdge.setElement(linkDescriptor.getLinkElement()); + <%=importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())%>.decorateView(createdEdge); + } + break; +<% + } + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); +%> + case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID: + if (linkDescriptor.getLinkElement() == null) { + createdEdge.setElement(null); + <%=importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())%>.decorateView(createdEdge); + } + break; +<% + } +%> + } + if (createdEdge.getType() == null) { + return null; + } + return new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")%>(parentView, createdEdge, sourceView, targetView); + } + + /** + * @generated + */ + private <%=importManager.getImportedName("java.util.List")%> getSemanticChildLinks() { +<%@include file="semanticChildLinks.jetinc"%> + } + + /** + * @generated + */ + private <%=importManager.getImportedName("java.util.List")%> getNotationalChildLinks() { + <%=importManager.getImportedName("java.util.List")%> result = new <%=importManager.getImportedName("java.util.LinkedList")%>(); + <%=importManager.getImportedName("java.util.List")%> allLinks = <%=_getDiagramCode%>.getEdges(); + for(<%=importManager.getImportedName("java.util.Iterator")%> it = allLinks.iterator(); it.hasNext(); ) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next(); +<% + if (_includeUncontainedLinks) { +%> + if (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) { + result.add(next); + continue; + } + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source = next.getSource(); + if (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) { + result.add(next); + continue; + } + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target = next.getTarget(); + if (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) { + result.add(next); + continue; + } +<% + } +%> +<% + if (myHelper.containsFeatureModelFacetLinks()) { +%> + if (!next.isSetElement() || next.getElement() == null) { + if (next.getSource() == <%=_getViewCode%>) { + int linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(next); + switch (linkVID) { +<% + for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); +%> + case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID: +<% + } +%> + result.add(next); + break; + } + } +<% + if (myHelper.containsTypeModelFacetLinks()) { +%> + } else { +<% + } else { +%> + } +<% + } + } + +%> +<% + if (myHelper.containsTypeModelFacetLinks()) { + if (!myHelper.containsFeatureModelFacetLinks()) { +%> + if (next.isSetElement() && next.getElement() != null) { +<% + } +%> + if (next.getElement().eContainer() == <%=_getSemanticElementCode%>) { + int linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(next); + switch (linkVID) { +<% + for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink nextLink = (GenLink) it.next(); +%> + case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID: +<% + } +%> + result.add(next); + break; + } + } + } +<% + } +%> + } + return result; + } + + /** + * Returns whether a notational edge should be created for the given domain element. + * The generated code always returns <%=genDiagram.isSynchronized()%>. + * User can change implementation of this method to handle a more sophisticated logic. + * @generated + */ + private boolean shouldCreateEdge(EObject domainElement) { + return <%=genDiagram.isSynchronized()%>; + } +<% +} +%> Index: src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java =================================================================== RCS file: src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java diff -N src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,81 @@ +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(); + } +} Index: templates/parts/notificationFilter.jetinc =================================================================== RCS file: templates/parts/notificationFilter.jetinc diff -N templates/parts/notificationFilter.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/parts/notificationFilter.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,21 @@ +<% + /* + * input: + * _feature: GenFeature + * genAffectingFeatures : Set + */ + if (_feature == null || genAffectingFeatures.contains(_feature)) { + continue; + } + genAffectingFeatures.add(_feature); + if (!hasDeclaredFilter) { + hasDeclaredFilter = true; +%> + filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=_feature.getFeatureAccessorName()%>()); +<% + } else { +%> + filter = filter.or(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=_feature.getFeatureAccessorName()%>())); +<% + } +%> Index: templates/commands/RemoveNotationalEdgeCommand.javajet =================================================================== RCS file: templates/commands/RemoveNotationalEdgeCommand.javajet diff -N templates/commands/RemoveNotationalEdgeCommand.javajet --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/commands/RemoveNotationalEdgeCommand.javajet 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,66 @@ +<%@ jet package="org.eclipse.gmf.codegen.templates.lite.commands" class="RemoveNotationalEdgeCommandGenerator" + imports="org.eclipse.gmf.common.codegen.*"%> + +<% +ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +%> + +<% +importManager.emitPackageStatement(stringBuffer); +importManager.markImportLocation(stringBuffer); +%> + +/** + * @generated + */ +public class RemoveNotationalEdgeCommand extends RemoveNotationalElementCommand { + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source; + + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target; + + /** + * @generated + */ + public RemoveNotationalEdgeCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> childView) { + super(parentView, childView); + } + + /** + * @generated + */ + public boolean canExecute() { + return getParent() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> && getChildView() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> + && ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>) getParent()).getEdges().contains(getChildView()); + } + + /** + * @generated + */ + public void execute() { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> edgeToRemove = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>)getChildView(); + source = edgeToRemove.getSource(); + target = edgeToRemove.getTarget(); + edgeToRemove.setSource(null); + edgeToRemove.setTarget(null); + ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).removeEdge(edgeToRemove); + sweepElement(); + } + + /** + * @generated + */ + public void undo() { + restoreElement(); + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> edge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>)getChildView(); + ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).insertEdge(edge); + edge.setSource(source); + edge.setTarget(target); + } +} +<%importManager.emitSortedImports();%> Index: src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java =================================================================== RCS file: src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java diff -N src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,78 @@ +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(); + } +} Index: templates/parts/linkDescriptor.jetinc =================================================================== RCS file: templates/parts/linkDescriptor.jetinc diff -N templates/parts/linkDescriptor.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/parts/linkDescriptor.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,71 @@ +<%/*inner class*/%> +/** + * @generated + */ +private static class LinkDescriptor { + + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> mySource; + + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> myDestination; + + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> myLinkElement; + + /** + * @generated + */ + private int myVisualID; + + /** + * @generated + */ + protected LinkDescriptor(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> destination, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> linkElement, int linkVID) { + this(source, destination, linkVID); + myLinkElement = linkElement; + } + + /** + * @generated + */ + private LinkDescriptor(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> destination, int linkVID) { + mySource = source; + myDestination = destination; + myVisualID = linkVID; + } + + /** + * @generated + */ + protected <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> getSource() { + return mySource; + } + + /** + * @generated + */ + protected <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> getDestination() { + return myDestination; + } + + /** + * @generated + */ + protected <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> getLinkElement() { + return myLinkElement; + } + + /** + * @generated + */ + protected int getVisualID() { + return myVisualID; + } +} Index: templates/parts/registerModel.jetinc =================================================================== RCS file: templates/parts/registerModel.jetinc diff -N templates/parts/registerModel.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/parts/registerModel.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,21 @@ + /** + * @generated + */ + protected void registerModel() { + super.registerModel(); + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) getModel(); + if (view != null && view.isSetElement() && view.getElement() != null) { + getViewer().getEditPartRegistry().put(view.getElement(), this); + } + } + + /** + * @generated + */ + protected void unregisterModel() { + super.unregisterModel(); + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) getModel(); + if (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) { + getViewer().getEditPartRegistry().remove(view.getElement()); + } + } Index: templates/commands/CreateNotationalEdgeCommand.javajet =================================================================== RCS file: templates/commands/CreateNotationalEdgeCommand.javajet diff -N templates/commands/CreateNotationalEdgeCommand.javajet --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/commands/CreateNotationalEdgeCommand.javajet 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,64 @@ +<%@ jet package="org.eclipse.gmf.codegen.templates.lite.commands" class="CreateNotationalEdgeCommandGenerator" + imports="org.eclipse.gmf.common.codegen.*"%> + +<% +ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +%> + +<% +importManager.emitPackageStatement(stringBuffer); +importManager.markImportLocation(stringBuffer); +%> + +/** + * @generated + */ +public class CreateNotationalEdgeCommand extends CreateNotationalElementCommand { + /** + * @generated + */ + private final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source; + + /** + * @generated + */ + private final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target; + + /** + * @generated + */ + public CreateNotationalEdgeCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parent, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target) { + super(parent); + this.source = source; + this.target = target; + setCreatedView(createdEdge); + } + + /** + * @generated + */ + public boolean canExecute() { + return super.canExecute() && getParent() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> && getCreatedView() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> && this.source != null && this.target != null; + } + + /** + * @generated + */ + public void execute() { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getCreatedView(); + ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).insertEdge(createdEdge); + createdEdge.setSource(source); + createdEdge.setTarget(target); + } + + /** + * @generated + */ + public void undo() { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getCreatedView(); + ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).removeEdge(createdEdge); + createdEdge.setSource(null); + createdEdge.setTarget(null); + } +} +<%importManager.emitSortedImports();%> Index: templates/parts/semanticChildLinks.jetinc =================================================================== RCS file: templates/parts/semanticChildLinks.jetinc diff -N templates/parts/semanticChildLinks.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/parts/semanticChildLinks.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,148 @@ + <%=importManager.getImportedName("java.util.List")%> result = new <%=importManager.getImportedName("java.util.LinkedList")%>(); +<% +Map genFeature2genLinkMap = new LinkedHashMap(); +for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + GenFeature metaFeature = modelFacet.getChildMetaFeature(); + if (!genFeature2genLinkMap.containsKey(metaFeature)) { + genFeature2genLinkMap.put(metaFeature, new ArrayList()); + } + ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink); +} +Map genFeature2featureGenLinkMap = new LinkedHashMap(); +for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) { + genFeature2featureGenLinkMap.put(metaFeature, new ArrayList()); + } + ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink); +} +if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { +%> + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = <%=_getSemanticElementCode%>; + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue; +<% +} +if (!genFeature2genLinkMap.isEmpty()) { +%> + int linkVID; +<% +} +for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { + Map.Entry nextEntry = (Map.Entry) entries.next(); + GenFeature metaFeature = (GenFeature) nextEntry.getKey(); + Collection genLinksCollection = (Collection) nextEntry.getValue(); + if (metaFeature.isListType()) { +%> + for(<%=importManager.getImportedName("java.util.Iterator")%> it = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>().iterator(); it.hasNext(); ) { + nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next(); +<% + } else { +%> + nextValue = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>(); +<% + } +%> + linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getLinkWithClassVisualID(nextValue); +<% + boolean generateSwitch = genLinksCollection.size() != 1; + if (generateSwitch) { +%> + switch (linkVID) { +<% + } + for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { + GenLink nextLink = (GenLink) genLinksIterator.next(); + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); + if (generateSwitch) { +%> + case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID: { +<% + } else { +%> + if (<%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID == linkVID) { +<% + } + if (modelFacet.getSourceMetaFeature() != null) { +%> + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = ((<%=importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName())%>)nextValue).<%=modelFacet.getSourceMetaFeature().getGetAccessor()%>(); +<% + } else { +%> + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = <%=_getSemanticElementCode%>; +<% + } + if (modelFacet.getTargetMetaFeature() != null) { +%> + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = ((<%=importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName())%>)nextValue).<%=modelFacet.getTargetMetaFeature().getGetAccessor()%>(); +<% + } else { +%> + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = <%=_getSemanticElementCode%>; +<% + } +%> + if (source != null && target != null) { + result.add(new LinkDescriptor(source, target, nextValue, linkVID)); + } +<% + if (generateSwitch) { +%> + break; + } +<% + } else { +%> + } +<% + } +%> +<% + } //iterate over genLinksCollection + if (generateSwitch) { +%> + } +<% + } + if (metaFeature.isListType()) { +%> + } +<% + } +} +for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) { + Map.Entry nextEntry = (Map.Entry) entries.next(); + GenFeature metaFeature = (GenFeature) nextEntry.getKey(); + Collection genLinksCollection = (Collection) nextEntry.getValue(); + if (metaFeature.isListType()) { +%> + for(<%=importManager.getImportedName("java.util.Iterator")%> it = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>().iterator(); it.hasNext(); ) { + nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next(); +<% + } else { +%> + nextValue = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>(); +<% + } +%> + if (nextValue != null) { +<% + for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { + GenLink nextLink = (GenLink) genLinksIterator.next(); +%> + result.add(new LinkDescriptor(modelObject, nextValue, null, <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID)); +<% + } +%> + } +<% + if (metaFeature.isListType()) { +%> + } +<% + } +} +%> + return result;