Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2006-03-19 11:57:17 -0500
committerashatalin2006-03-19 11:57:17 -0500
commit8f284d81b039ad124f6d262faff8096081c99779 (patch)
tree7dfd623441f08d66060c79f9563e858d83595d64
parent6be01a982bfa041d1c170547927d6a963856e758 (diff)
downloadorg.eclipse.gmf-tooling-8f284d81b039ad124f6d262faff8096081c99779.tar.gz
org.eclipse.gmf-tooling-8f284d81b039ad124f6d262faff8096081c99779.tar.xz
org.eclipse.gmf-tooling-8f284d81b039ad124f6d262faff8096081c99779.zip
#128024 Model references are not recognized as links
#131543 Obsolete code should be eliminated
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/models/ecore.gmfgen28
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation2EditPart.java100
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotationEditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_detailsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_source2EditPart.java91
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAttributeEditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass2EditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClassEditPart.java100
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_attributesEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_classannotationsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_nameEditPart.java91
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_operationsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType2EditPart.java100
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataTypeEditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_datatypeannotationsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_name2EditPart.java91
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum2EditPart.java100
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumEditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumLiteralEditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_enumannotationsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_literalsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_name2EditPart.java91
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EOperationEditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage2EditPart.java100
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage3EditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_classesEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_datatypesEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_enumsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_name2EditPart.java91
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packageannotationsEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packagesEditPart.java44
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_name2EditPart.java87
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_nameEditPart.java87
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EStringToStringMapEntryEditPart.java46
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/ITextAwareEditPart.java6
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/TextDirectEditManager.java71
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/ConstrainedToolbarLayoutEditPolicy.java23
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EAnnotation_detailsCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_attributesCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_classannotationsCanonicalEditPolicy.java11
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_operationsCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EDataType_datatypeannotationsCanonicalEditPolicy.java11
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_enumannotationsCanonicalEditPolicy.java11
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_literalsCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackageCanonicalEditPolicy.java412
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_classesCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_datatypesCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_enumsCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packageannotationsCanonicalEditPolicy.java11
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packagesCanonicalEditPolicy.java9
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java183
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java168
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/LabelDirectEditPolicy.java15
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/NonResizableTextEditPolicy.java74
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditor.java4
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditorPlugin.java2
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreInitDiagramFileAction.java853
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreNewDiagramFileWizard.java161
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/AquatoryCanonicalEditPolicy.java351
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortCanonicalEditPolicy.java6
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipCanonicalEditPolicy.java6
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/Ship_CargoCompartmentCanonicalEditPolicy.java17
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java16
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanNewDiagramFileWizard.java315
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java799
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/PluginGenerator.java59
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/ChildContainerCanonicalEditPolicyGenerator.java611
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/DiagramCanonicalEditPolicyGenerator.java1063
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/Plugin.javajet2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/initDiagramContents.jetinc388
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/policies/ChildContainerCanonicalEditPolicy.javajet46
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/policies/DiagramCanonicalEditPolicy.javajet80
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/policies/getSemanticChildrenList.jetinc57
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/policies/refreshSemantic.jetinc298
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/class2PhantomsCollector.jetinc12
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_footer.jetinc4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc10
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_footer.jetinc7
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc23
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_footer.jetinc4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc22
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/createPhantomNodes.jetinc43
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/filterOutExistingPhantoms.jetinc7
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/getDiagram.jetinc6
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/getSemanticChildrenList.jetinc26
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/initDiagramContents.jetinc122
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/linkDescriptor.jetinc102
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/refreshSemanticDiagram.jetinc163
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/refreshSemanticNode.jetinc51
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/storeLinks.jetinc86
91 files changed, 5279 insertions, 3714 deletions
diff --git a/examples/org.eclipse.gmf.ecore.editor/models/ecore.gmfgen b/examples/org.eclipse.gmf.ecore.editor/models/ecore.gmfgen
index 562e671c9..9fc52539f 100644
--- a/examples/org.eclipse.gmf.ecore.editor/models/ecore.gmfgen
+++ b/examples/org.eclipse.gmf.ecore.editor/models/ecore.gmfgen
@@ -8,7 +8,7 @@
<domainDiagramElement href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage"/>
<childNodes visualID="2001" editPartClassName="EAttributeEditPart" itemSemanticEditPolicyClassName="EAttributeItemSemanticEditPolicy" notationViewFactoryClassName="EAttributeViewFactory" canonicalEditPolicyClassName="EAttributeCanonicalEditPolicy" graphicalNodeEditPolicyClassName="EAttributeGraphicalNodeEditPolicy" containers="//@diagram/@compartments.0">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EAttribute"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EClass/eStructuralFeatures"/>
@@ -24,7 +24,7 @@
</childNodes>
<childNodes visualID="2002" editPartClassName="EOperationEditPart" itemSemanticEditPolicyClassName="EOperationItemSemanticEditPolicy" notationViewFactoryClassName="EOperationViewFactory" canonicalEditPolicyClassName="EOperationCanonicalEditPolicy" graphicalNodeEditPolicyClassName="EOperationGraphicalNodeEditPolicy" containers="//@diagram/@compartments.1">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EOperation"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EClass/eOperations"/>
@@ -40,7 +40,7 @@
</childNodes>
<childNodes visualID="2003" editPartClassName="EAnnotationEditPart" itemSemanticEditPolicyClassName="EAnnotationItemSemanticEditPolicy" notationViewFactoryClassName="EAnnotationViewFactory" canonicalEditPolicyClassName="EAnnotationCanonicalEditPolicy" graphicalNodeEditPolicyClassName="EAnnotationGraphicalNodeEditPolicy" containers="//@diagram/@compartments.2 //@diagram/@compartments.7 //@diagram/@compartments.9 //@diagram/@compartments.11">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EAnnotation"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EModelElement/eAnnotations"/>
@@ -56,7 +56,7 @@
</childNodes>
<childNodes visualID="2004" editPartClassName="EClass2EditPart" itemSemanticEditPolicyClassName="EClass2ItemSemanticEditPolicy" notationViewFactoryClassName="EClass2ViewFactory" canonicalEditPolicyClassName="EClass2CanonicalEditPolicy" graphicalNodeEditPolicyClassName="EClass2GraphicalNodeEditPolicy" containers="//@diagram/@compartments.3">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EClass"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eClassifiers"/>
@@ -72,7 +72,7 @@
</childNodes>
<childNodes visualID="2005" editPartClassName="EPackage3EditPart" itemSemanticEditPolicyClassName="EPackage3ItemSemanticEditPolicy" notationViewFactoryClassName="EPackage3ViewFactory" canonicalEditPolicyClassName="EPackage3CanonicalEditPolicy" graphicalNodeEditPolicyClassName="EPackage2GraphicalNodeEditPolicy" containers="//@diagram/@compartments.4">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eSubpackages"/>
@@ -88,7 +88,7 @@
</childNodes>
<childNodes visualID="2006" editPartClassName="EDataTypeEditPart" itemSemanticEditPolicyClassName="EDataTypeItemSemanticEditPolicy" notationViewFactoryClassName="EDataTypeViewFactory" canonicalEditPolicyClassName="EDataTypeCanonicalEditPolicy" graphicalNodeEditPolicyClassName="EDataTypeGraphicalNodeEditPolicy" containers="//@diagram/@compartments.5">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EDataType"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eClassifiers"/>
@@ -104,7 +104,7 @@
</childNodes>
<childNodes visualID="2007" editPartClassName="EEnumEditPart" itemSemanticEditPolicyClassName="EEnumItemSemanticEditPolicy" notationViewFactoryClassName="EEnumViewFactory" canonicalEditPolicyClassName="EEnumCanonicalEditPolicy" graphicalNodeEditPolicyClassName="EEnumGraphicalNodeEditPolicy" containers="//@diagram/@compartments.6">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnum"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eClassifiers"/>
@@ -120,7 +120,7 @@
</childNodes>
<childNodes visualID="2008" editPartClassName="EStringToStringMapEntryEditPart" itemSemanticEditPolicyClassName="EStringToStringMapEntryItemSemanticEditPolicy" notationViewFactoryClassName="EStringToStringMapEntryViewFactory" canonicalEditPolicyClassName="EStringToStringMapEntryCanonicalEditPolicy" graphicalNodeEditPolicyClassName="EStringToStringMapEntryGraphicalNodeEditPolicy" containers="//@diagram/@compartments.8">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EStringToStringMapEntry"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EAnnotation/details"/>
@@ -136,7 +136,7 @@
</childNodes>
<childNodes visualID="2009" editPartClassName="EEnumLiteralEditPart" itemSemanticEditPolicyClassName="EEnumLiteralItemSemanticEditPolicy" notationViewFactoryClassName="EEnumLiteralViewFactory" canonicalEditPolicyClassName="EEnumLiteralCanonicalEditPolicy" graphicalNodeEditPolicyClassName="EEnumLiteralGraphicalNodeEditPolicy" containers="//@diagram/@compartments.10">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="ChildNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class ChildNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public ChildNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;this.setOutline(false);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childChildNode_NameLabelFigure = createFigureChildNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureChildNode_NameLabelFigure(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childChildNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fChildNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureChildNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fChildNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureChildNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fChildNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureChildNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnumLiteral"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnum/eLiterals"/>
@@ -152,7 +152,7 @@
</childNodes>
<topLevelNodes visualID="1001" editPartClassName="EClassEditPart" itemSemanticEditPolicyClassName="EClassItemSemanticEditPolicy" notationViewFactoryClassName="EClassViewFactory" canonicalEditPolicyClassName="EClassCanonicalEditPolicy" compartments="//@diagram/@compartments.0 //@diagram/@compartments.1 //@diagram/@compartments.2" graphicalNodeEditPolicyClassName="EClassGraphicalNodeEditPolicy">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EClass"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eClassifiers"/>
@@ -168,7 +168,7 @@
</topLevelNodes>
<topLevelNodes visualID="1002" editPartClassName="EPackage2EditPart" itemSemanticEditPolicyClassName="EPackage2ItemSemanticEditPolicy" notationViewFactoryClassName="EPackage2ViewFactory" canonicalEditPolicyClassName="EPackage2CanonicalEditPolicy" compartments="//@diagram/@compartments.3 //@diagram/@compartments.4 //@diagram/@compartments.5 //@diagram/@compartments.6 //@diagram/@compartments.7" graphicalNodeEditPolicyClassName="EPackageGraphicalNodeEditPolicy">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eSubpackages"/>
@@ -184,7 +184,7 @@
</topLevelNodes>
<topLevelNodes visualID="1003" editPartClassName="EAnnotation2EditPart" itemSemanticEditPolicyClassName="EAnnotation2ItemSemanticEditPolicy" notationViewFactoryClassName="EAnnotation2ViewFactory" canonicalEditPolicyClassName="EAnnotation2CanonicalEditPolicy" compartments="//@diagram/@compartments.8" graphicalNodeEditPolicyClassName="EAnnotation2GraphicalNodeEditPolicy">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EAnnotation"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EModelElement/eAnnotations"/>
@@ -200,7 +200,7 @@
</topLevelNodes>
<topLevelNodes visualID="1004" editPartClassName="EDataType2EditPart" itemSemanticEditPolicyClassName="EDataType2ItemSemanticEditPolicy" notationViewFactoryClassName="EDataType2ViewFactory" canonicalEditPolicyClassName="EDataType2CanonicalEditPolicy" compartments="//@diagram/@compartments.9" graphicalNodeEditPolicyClassName="EDataType2GraphicalNodeEditPolicy">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EDataType"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eClassifiers"/>
@@ -216,7 +216,7 @@
</topLevelNodes>
<topLevelNodes visualID="1005" editPartClassName="EEnum2EditPart" itemSemanticEditPolicyClassName="EEnum2ItemSemanticEditPolicy" notationViewFactoryClassName="EEnum2ViewFactory" canonicalEditPolicyClassName="EEnum2CanonicalEditPolicy" compartments="//@diagram/@compartments.10 //@diagram/@compartments.11" graphicalNodeEditPolicyClassName="EEnum2GraphicalNodeEditPolicy">
<diagramRunTimeClass href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
+ <viewmap xsi:type="gmfgen:InnerClassViewmap" className="NamedNodeRectangle" classBody="&#xD;&#xA;&#xD;&#xA;/**&#xD;&#xA; * @generated&#xD;&#xA; */&#xD;&#xA;public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private boolean myUseLocalCoordinates;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public NamedNodeRectangle() {&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();&#xD;&#xA;&#x9;&#x9;setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;add(childNamedNode_NameLabelFigure);&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;&#x9;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure; &#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {&#xD;&#xA;&#x9;&#x9;return fNamedNode_NameLabelFigure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {&#xD;&#xA;&#x9;&#x9;fNamedNode_NameLabelFigure = figure;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {&#xD;&#xA;org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#x9;&#x9;return rv;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected boolean useLocalCoordinates() {&#xD;&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;&#xD;&#xA;&#x9;/**&#xD;&#xA;&#x9; * @generated&#xD;&#xA;&#x9; */&#xD;&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xD;&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xD;&#xA;&#x9;}&#xD;&#xA;}&#xD;&#xA;"/>
<modelFacet>
<metaClass href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EEnum"/>
<containmentMetaFeature href="../../../plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore/EPackage/eClassifiers"/>
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation2EditPart.java
index 7d37275a6..304613b63 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation2EditPart.java
@@ -3,6 +3,7 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.emf.ecore.EAnnotation;
@@ -16,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.ecore.edit.policies.EAnnotation2CanonicalEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EAnnotation2GraphicalNodeEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EAnnotation2ItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
@@ -26,6 +28,7 @@ import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdap
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
@@ -55,6 +58,11 @@ public class EAnnotation2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
public EAnnotation2EditPart(View view) {
super(view);
}
@@ -84,6 +92,17 @@ public class EAnnotation2EditPart extends ShapeNodeEditPart {
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EAnnotation2ItemSemanticEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new EAnnotation2GraphicalNodeEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EAnnotation2CanonicalEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ConstrainedToolbarLayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
+ if (child instanceof ITextAwareEditPart) {
+ return new EcoreTextSelectionEditPolicy();
+ }
+ }
+ return super.createChildEditPolicy(child);
+ }
+ });
}
/**
@@ -92,7 +111,25 @@ public class EAnnotation2EditPart extends ShapeNodeEditPart {
protected IFigure createNodeShape() {
NamedNodeRectangle figure = new NamedNodeRectangle();
figure.setUseLocalCoordinates(false);
- return figure;
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public NamedNodeRectangle getPrimaryShape() {
+ return (NamedNodeRectangle) primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof EAnnotation_source2EditPart) {
+ ((EAnnotation_source2EditPart) childEditPart).setLabel(getPrimaryShape().getFigureNamedNode_NameLabelFigure());
+ return true;
+ }
+ return false;
}
/**
@@ -115,15 +152,12 @@ public class EAnnotation2EditPart extends ShapeNodeEditPart {
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
- if (shape.getLayoutManager() == null) {
- shape.setLayoutManager(new StackLayout());
- }
+ contentPane = setupContentPane(shape);
- IFigure shapeContents = new Figure();
- shape.add(shapeContents);
- shapeContents.setLayoutManager(new BorderLayout());
- addContentPane(shapeContents);
- decorateShape(shapeContents);
+ IFigure decorationShape = createDecorationPane();
+ if (decorationShape != null) {
+ figure.add(decorationShape);
+ }
return figure;
}
@@ -131,30 +165,34 @@ public class EAnnotation2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- private void decorateShape(IFigure shapeContents) {
+ private IFigure createDecorationPane() {
View view = (View) getModel();
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if (annotation == null) {
- return;
+ return null;
}
Figure decorationPane = new Figure();
decorationPane.setLayoutManager(new BorderLayout());
- shapeContents.add(decorationPane, BorderLayout.BOTTOM);
- ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"));
- decorationPane.add(imageFigure, BorderLayout.RIGHT);
+ ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"), PositionConstants.EAST);
+ decorationPane.add(imageFigure, BorderLayout.BOTTOM);
+ return decorationPane;
}
/**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ * @param nodeShape instance of generated figure class
* @generated
*/
- protected void addContentPane(IFigure shape) {
- contentPane = new Figure();
- shape.add(contentPane, BorderLayout.CENTER);
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(getMapMode().DPtoLP(5));
- contentPane.setLayoutManager(layout);
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if (nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(getMapMode().DPtoLP(5));
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
}
/**
@@ -177,6 +215,15 @@ public class EAnnotation2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if (!addFixedChild(childEditPart)) {
+ super.addChildVisual(childEditPart, -1);
+ }
+ }
+
+ /**
+ * @generated
+ */
public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {
/**
@@ -189,32 +236,35 @@ public class EAnnotation2EditPart extends ShapeNodeEditPart {
*/
public NamedNodeRectangle() {
- org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
+ org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);
add(childNamedNode_NameLabelFigure);
}
- private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure;
+ /**
+ * @generated
+ */
+ private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure;
/**
* @generated
*/
- public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {
+ public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {
return fNamedNode_NameLabelFigure;
}
/**
* @generated
*/
- protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {
+ protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {
fNamedNode_NameLabelFigure = figure;
}
/**
* @generated
*/
- private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {
+ private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {
org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();
return rv;
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotationEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotationEditPart.java
index 6404751d4..622f8e17e 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotationEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotationEditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EAnnotationItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EAnnotationItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EAnnotationEditPart extends CompartmentEditPart implements ITextAwa
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_detailsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_detailsEditPart.java
index 41893dfc9..2c5b0c966 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_detailsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_detailsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EAnnotation_detailsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EAnnotation_detailsEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EAnnotation_detailsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_source2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_source2EditPart.java
index ab0c2757d..1b2182f41 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_source2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAnnotation_source2EditPart.java
@@ -1,7 +1,7 @@
package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
@@ -10,6 +10,7 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -26,6 +27,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
+
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -42,8 +45,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -76,7 +77,7 @@ import org.eclipse.swt.graphics.Image;
/**
* @generated
*/
-public class EAnnotation_source2EditPart extends GraphicalEditPart implements ITextAwareEditPart {
+public class EAnnotation_source2EditPart extends CompartmentEditPart implements ITextAwareEditPart {
/**
* @generated
@@ -116,17 +117,19 @@ public class EAnnotation_source2EditPart extends GraphicalEditPart implements IT
/**
* @generated
*/
- protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
- defaultText = figure.getText();
- return figure;
+ public Label getLabel() {
+ return (Label) getFigure();
}
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -135,7 +138,7 @@ public class EAnnotation_source2EditPart extends GraphicalEditPart implements IT
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -145,7 +148,7 @@ public class EAnnotation_source2EditPart extends GraphicalEditPart implements IT
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -310,8 +313,8 @@ public class EAnnotation_source2EditPart extends GraphicalEditPart implements IT
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -319,10 +322,8 @@ public class EAnnotation_source2EditPart extends GraphicalEditPart implements IT
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -373,6 +374,10 @@ public class EAnnotation_source2EditPart extends GraphicalEditPart implements IT
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
@@ -488,4 +493,54 @@ public class EAnnotation_source2EditPart extends GraphicalEditPart implements IT
}
super.handleNotificationEvent(event);
}
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ Label label = createLabel();
+ defaultText = label.getText();
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected Label createLabel() {
+ return new NamedNode_NameLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class NamedNode_NameLabelFigure extends org.eclipse.draw2d.Label {
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates;
+
+ /**
+ * @generated
+ */
+ public NamedNode_NameLabelFigure() {
+
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAttributeEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAttributeEditPart.java
index 7a37b13a3..ed5c1f79d 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAttributeEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EAttributeEditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EAttributeItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EAttributeItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EAttributeEditPart extends CompartmentEditPart implements ITextAwar
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass2EditPart.java
index 17e88a734..eac95febe 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass2EditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EClass2ItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EClass2ItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EClass2EditPart extends CompartmentEditPart implements ITextAwareEd
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClassEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClassEditPart.java
index d24db4220..91b854cae 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClassEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClassEditPart.java
@@ -3,6 +3,7 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.emf.ecore.EAnnotation;
@@ -16,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.ecore.edit.policies.EClassCanonicalEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EClassGraphicalNodeEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EClassItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
@@ -26,6 +28,7 @@ import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdap
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
@@ -55,6 +58,11 @@ public class EClassEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
public EClassEditPart(View view) {
super(view);
}
@@ -92,6 +100,17 @@ public class EClassEditPart extends ShapeNodeEditPart {
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EClassItemSemanticEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new EClassGraphicalNodeEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClassCanonicalEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ConstrainedToolbarLayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
+ if (child instanceof ITextAwareEditPart) {
+ return new EcoreTextSelectionEditPolicy();
+ }
+ }
+ return super.createChildEditPolicy(child);
+ }
+ });
}
/**
@@ -100,7 +119,25 @@ public class EClassEditPart extends ShapeNodeEditPart {
protected IFigure createNodeShape() {
NamedNodeRectangle figure = new NamedNodeRectangle();
figure.setUseLocalCoordinates(false);
- return figure;
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public NamedNodeRectangle getPrimaryShape() {
+ return (NamedNodeRectangle) primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof EClass_nameEditPart) {
+ ((EClass_nameEditPart) childEditPart).setLabel(getPrimaryShape().getFigureNamedNode_NameLabelFigure());
+ return true;
+ }
+ return false;
}
/**
@@ -123,15 +160,12 @@ public class EClassEditPart extends ShapeNodeEditPart {
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
- if (shape.getLayoutManager() == null) {
- shape.setLayoutManager(new StackLayout());
- }
+ contentPane = setupContentPane(shape);
- IFigure shapeContents = new Figure();
- shape.add(shapeContents);
- shapeContents.setLayoutManager(new BorderLayout());
- addContentPane(shapeContents);
- decorateShape(shapeContents);
+ IFigure decorationShape = createDecorationPane();
+ if (decorationShape != null) {
+ figure.add(decorationShape);
+ }
return figure;
}
@@ -139,30 +173,34 @@ public class EClassEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- private void decorateShape(IFigure shapeContents) {
+ private IFigure createDecorationPane() {
View view = (View) getModel();
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if (annotation == null) {
- return;
+ return null;
}
Figure decorationPane = new Figure();
decorationPane.setLayoutManager(new BorderLayout());
- shapeContents.add(decorationPane, BorderLayout.BOTTOM);
- ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"));
- decorationPane.add(imageFigure, BorderLayout.RIGHT);
+ ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"), PositionConstants.EAST);
+ decorationPane.add(imageFigure, BorderLayout.BOTTOM);
+ return decorationPane;
}
/**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ * @param nodeShape instance of generated figure class
* @generated
*/
- protected void addContentPane(IFigure shape) {
- contentPane = new Figure();
- shape.add(contentPane, BorderLayout.CENTER);
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(getMapMode().DPtoLP(5));
- contentPane.setLayoutManager(layout);
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if (nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(getMapMode().DPtoLP(5));
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
}
/**
@@ -185,6 +223,15 @@ public class EClassEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if (!addFixedChild(childEditPart)) {
+ super.addChildVisual(childEditPart, -1);
+ }
+ }
+
+ /**
+ * @generated
+ */
public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {
/**
@@ -197,32 +244,35 @@ public class EClassEditPart extends ShapeNodeEditPart {
*/
public NamedNodeRectangle() {
- org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
+ org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);
add(childNamedNode_NameLabelFigure);
}
- private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure;
+ /**
+ * @generated
+ */
+ private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure;
/**
* @generated
*/
- public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {
+ public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {
return fNamedNode_NameLabelFigure;
}
/**
* @generated
*/
- protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {
+ protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {
fNamedNode_NameLabelFigure = figure;
}
/**
* @generated
*/
- private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {
+ private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {
org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();
return rv;
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_attributesEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_attributesEditPart.java
index 3fdccc2ea..24952778c 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_attributesEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_attributesEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EClass_attributesCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EClass_attributesEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClass_attributesCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_classannotationsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_classannotationsEditPart.java
index 19e1ef02d..a4af2b037 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_classannotationsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_classannotationsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EClass_classannotationsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EClass_classannotationsEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClass_classannotationsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_nameEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_nameEditPart.java
index 703b7699f..cc71cd4e7 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_nameEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_nameEditPart.java
@@ -1,7 +1,7 @@
package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
@@ -10,6 +10,7 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -26,6 +27,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
+
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -42,8 +45,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -76,7 +77,7 @@ import org.eclipse.swt.graphics.Image;
/**
* @generated
*/
-public class EClass_nameEditPart extends GraphicalEditPart implements ITextAwareEditPart {
+public class EClass_nameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
/**
* @generated
@@ -116,17 +117,19 @@ public class EClass_nameEditPart extends GraphicalEditPart implements ITextAware
/**
* @generated
*/
- protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
- defaultText = figure.getText();
- return figure;
+ public Label getLabel() {
+ return (Label) getFigure();
}
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -135,7 +138,7 @@ public class EClass_nameEditPart extends GraphicalEditPart implements ITextAware
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -145,7 +148,7 @@ public class EClass_nameEditPart extends GraphicalEditPart implements ITextAware
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -310,8 +313,8 @@ public class EClass_nameEditPart extends GraphicalEditPart implements ITextAware
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -319,10 +322,8 @@ public class EClass_nameEditPart extends GraphicalEditPart implements ITextAware
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -373,6 +374,10 @@ public class EClass_nameEditPart extends GraphicalEditPart implements ITextAware
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
@@ -488,4 +493,54 @@ public class EClass_nameEditPart extends GraphicalEditPart implements ITextAware
}
super.handleNotificationEvent(event);
}
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ Label label = createLabel();
+ defaultText = label.getText();
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected Label createLabel() {
+ return new NamedNode_NameLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class NamedNode_NameLabelFigure extends org.eclipse.draw2d.Label {
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates;
+
+ /**
+ * @generated
+ */
+ public NamedNode_NameLabelFigure() {
+
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_operationsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_operationsEditPart.java
index 9a8761372..4fb1fdd68 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_operationsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EClass_operationsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EClass_operationsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EClass_operationsEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EClass_operationsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType2EditPart.java
index fded35049..cbe10fd62 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType2EditPart.java
@@ -3,6 +3,7 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.emf.ecore.EAnnotation;
@@ -16,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.ecore.edit.policies.EDataType2CanonicalEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EDataType2GraphicalNodeEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EDataType2ItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
@@ -26,6 +28,7 @@ import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdap
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
@@ -55,6 +58,11 @@ public class EDataType2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
public EDataType2EditPart(View view) {
super(view);
}
@@ -84,6 +92,17 @@ public class EDataType2EditPart extends ShapeNodeEditPart {
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EDataType2ItemSemanticEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new EDataType2GraphicalNodeEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EDataType2CanonicalEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ConstrainedToolbarLayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
+ if (child instanceof ITextAwareEditPart) {
+ return new EcoreTextSelectionEditPolicy();
+ }
+ }
+ return super.createChildEditPolicy(child);
+ }
+ });
}
/**
@@ -92,7 +111,25 @@ public class EDataType2EditPart extends ShapeNodeEditPart {
protected IFigure createNodeShape() {
NamedNodeRectangle figure = new NamedNodeRectangle();
figure.setUseLocalCoordinates(false);
- return figure;
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public NamedNodeRectangle getPrimaryShape() {
+ return (NamedNodeRectangle) primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof EDataType_name2EditPart) {
+ ((EDataType_name2EditPart) childEditPart).setLabel(getPrimaryShape().getFigureNamedNode_NameLabelFigure());
+ return true;
+ }
+ return false;
}
/**
@@ -115,15 +152,12 @@ public class EDataType2EditPart extends ShapeNodeEditPart {
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
- if (shape.getLayoutManager() == null) {
- shape.setLayoutManager(new StackLayout());
- }
+ contentPane = setupContentPane(shape);
- IFigure shapeContents = new Figure();
- shape.add(shapeContents);
- shapeContents.setLayoutManager(new BorderLayout());
- addContentPane(shapeContents);
- decorateShape(shapeContents);
+ IFigure decorationShape = createDecorationPane();
+ if (decorationShape != null) {
+ figure.add(decorationShape);
+ }
return figure;
}
@@ -131,30 +165,34 @@ public class EDataType2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- private void decorateShape(IFigure shapeContents) {
+ private IFigure createDecorationPane() {
View view = (View) getModel();
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if (annotation == null) {
- return;
+ return null;
}
Figure decorationPane = new Figure();
decorationPane.setLayoutManager(new BorderLayout());
- shapeContents.add(decorationPane, BorderLayout.BOTTOM);
- ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"));
- decorationPane.add(imageFigure, BorderLayout.RIGHT);
+ ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"), PositionConstants.EAST);
+ decorationPane.add(imageFigure, BorderLayout.BOTTOM);
+ return decorationPane;
}
/**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ * @param nodeShape instance of generated figure class
* @generated
*/
- protected void addContentPane(IFigure shape) {
- contentPane = new Figure();
- shape.add(contentPane, BorderLayout.CENTER);
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(getMapMode().DPtoLP(5));
- contentPane.setLayoutManager(layout);
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if (nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(getMapMode().DPtoLP(5));
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
}
/**
@@ -177,6 +215,15 @@ public class EDataType2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if (!addFixedChild(childEditPart)) {
+ super.addChildVisual(childEditPart, -1);
+ }
+ }
+
+ /**
+ * @generated
+ */
public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {
/**
@@ -189,32 +236,35 @@ public class EDataType2EditPart extends ShapeNodeEditPart {
*/
public NamedNodeRectangle() {
- org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
+ org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);
add(childNamedNode_NameLabelFigure);
}
- private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure;
+ /**
+ * @generated
+ */
+ private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure;
/**
* @generated
*/
- public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {
+ public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {
return fNamedNode_NameLabelFigure;
}
/**
* @generated
*/
- protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {
+ protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {
fNamedNode_NameLabelFigure = figure;
}
/**
* @generated
*/
- private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {
+ private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {
org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();
return rv;
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataTypeEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataTypeEditPart.java
index d64a9e798..82163439d 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataTypeEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataTypeEditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EDataTypeItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EDataTypeItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EDataTypeEditPart extends CompartmentEditPart implements ITextAware
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_datatypeannotationsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_datatypeannotationsEditPart.java
index 3b6864688..c3c3935ad 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_datatypeannotationsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_datatypeannotationsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EDataType_datatypeannotationsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EDataType_datatypeannotationsEditPart extends ListCompartmentEditPa
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EDataType_datatypeannotationsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_name2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_name2EditPart.java
index 821b191fc..d85f1a96e 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_name2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EDataType_name2EditPart.java
@@ -1,7 +1,7 @@
package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
@@ -10,6 +10,7 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -26,6 +27,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
+
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -42,8 +45,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -76,7 +77,7 @@ import org.eclipse.swt.graphics.Image;
/**
* @generated
*/
-public class EDataType_name2EditPart extends GraphicalEditPart implements ITextAwareEditPart {
+public class EDataType_name2EditPart extends CompartmentEditPart implements ITextAwareEditPart {
/**
* @generated
@@ -116,17 +117,19 @@ public class EDataType_name2EditPart extends GraphicalEditPart implements ITextA
/**
* @generated
*/
- protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
- defaultText = figure.getText();
- return figure;
+ public Label getLabel() {
+ return (Label) getFigure();
}
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -135,7 +138,7 @@ public class EDataType_name2EditPart extends GraphicalEditPart implements ITextA
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -145,7 +148,7 @@ public class EDataType_name2EditPart extends GraphicalEditPart implements ITextA
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -310,8 +313,8 @@ public class EDataType_name2EditPart extends GraphicalEditPart implements ITextA
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -319,10 +322,8 @@ public class EDataType_name2EditPart extends GraphicalEditPart implements ITextA
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -373,6 +374,10 @@ public class EDataType_name2EditPart extends GraphicalEditPart implements ITextA
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
@@ -488,4 +493,54 @@ public class EDataType_name2EditPart extends GraphicalEditPart implements ITextA
}
super.handleNotificationEvent(event);
}
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ Label label = createLabel();
+ defaultText = label.getText();
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected Label createLabel() {
+ return new NamedNode_NameLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class NamedNode_NameLabelFigure extends org.eclipse.draw2d.Label {
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates;
+
+ /**
+ * @generated
+ */
+ public NamedNode_NameLabelFigure() {
+
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum2EditPart.java
index ce58b70ca..993164524 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum2EditPart.java
@@ -3,6 +3,7 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.emf.ecore.EAnnotation;
@@ -16,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.ecore.edit.policies.EEnum2CanonicalEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EEnum2GraphicalNodeEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EEnum2ItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
@@ -26,6 +28,7 @@ import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdap
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
@@ -55,6 +58,11 @@ public class EEnum2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
public EEnum2EditPart(View view) {
super(view);
}
@@ -88,6 +96,17 @@ public class EEnum2EditPart extends ShapeNodeEditPart {
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EEnum2ItemSemanticEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new EEnum2GraphicalNodeEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EEnum2CanonicalEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ConstrainedToolbarLayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
+ if (child instanceof ITextAwareEditPart) {
+ return new EcoreTextSelectionEditPolicy();
+ }
+ }
+ return super.createChildEditPolicy(child);
+ }
+ });
}
/**
@@ -96,7 +115,25 @@ public class EEnum2EditPart extends ShapeNodeEditPart {
protected IFigure createNodeShape() {
NamedNodeRectangle figure = new NamedNodeRectangle();
figure.setUseLocalCoordinates(false);
- return figure;
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public NamedNodeRectangle getPrimaryShape() {
+ return (NamedNodeRectangle) primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof EEnum_name2EditPart) {
+ ((EEnum_name2EditPart) childEditPart).setLabel(getPrimaryShape().getFigureNamedNode_NameLabelFigure());
+ return true;
+ }
+ return false;
}
/**
@@ -119,15 +156,12 @@ public class EEnum2EditPart extends ShapeNodeEditPart {
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
- if (shape.getLayoutManager() == null) {
- shape.setLayoutManager(new StackLayout());
- }
+ contentPane = setupContentPane(shape);
- IFigure shapeContents = new Figure();
- shape.add(shapeContents);
- shapeContents.setLayoutManager(new BorderLayout());
- addContentPane(shapeContents);
- decorateShape(shapeContents);
+ IFigure decorationShape = createDecorationPane();
+ if (decorationShape != null) {
+ figure.add(decorationShape);
+ }
return figure;
}
@@ -135,30 +169,34 @@ public class EEnum2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- private void decorateShape(IFigure shapeContents) {
+ private IFigure createDecorationPane() {
View view = (View) getModel();
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if (annotation == null) {
- return;
+ return null;
}
Figure decorationPane = new Figure();
decorationPane.setLayoutManager(new BorderLayout());
- shapeContents.add(decorationPane, BorderLayout.BOTTOM);
- ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"));
- decorationPane.add(imageFigure, BorderLayout.RIGHT);
+ ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"), PositionConstants.EAST);
+ decorationPane.add(imageFigure, BorderLayout.BOTTOM);
+ return decorationPane;
}
/**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ * @param nodeShape instance of generated figure class
* @generated
*/
- protected void addContentPane(IFigure shape) {
- contentPane = new Figure();
- shape.add(contentPane, BorderLayout.CENTER);
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(getMapMode().DPtoLP(5));
- contentPane.setLayoutManager(layout);
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if (nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(getMapMode().DPtoLP(5));
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
}
/**
@@ -181,6 +219,15 @@ public class EEnum2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if (!addFixedChild(childEditPart)) {
+ super.addChildVisual(childEditPart, -1);
+ }
+ }
+
+ /**
+ * @generated
+ */
public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {
/**
@@ -193,32 +240,35 @@ public class EEnum2EditPart extends ShapeNodeEditPart {
*/
public NamedNodeRectangle() {
- org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
+ org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);
add(childNamedNode_NameLabelFigure);
}
- private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure;
+ /**
+ * @generated
+ */
+ private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure;
/**
* @generated
*/
- public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {
+ public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {
return fNamedNode_NameLabelFigure;
}
/**
* @generated
*/
- protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {
+ protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {
fNamedNode_NameLabelFigure = figure;
}
/**
* @generated
*/
- private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {
+ private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {
org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();
return rv;
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumEditPart.java
index 137c3e139..5f375c1d5 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumEditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EEnumItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EEnumItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EEnumEditPart extends CompartmentEditPart implements ITextAwareEdit
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumLiteralEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumLiteralEditPart.java
index 4bf80fa0c..bca5e20c0 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumLiteralEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnumLiteralEditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EEnumLiteralItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EEnumLiteralItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EEnumLiteralEditPart extends CompartmentEditPart implements ITextAw
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_enumannotationsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_enumannotationsEditPart.java
index 9646f21a7..b1e56889d 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_enumannotationsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_enumannotationsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EEnum_enumannotationsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EEnum_enumannotationsEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EEnum_enumannotationsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_literalsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_literalsEditPart.java
index b328580da..702916399 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_literalsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_literalsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EEnum_literalsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EEnum_literalsEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EEnum_literalsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_name2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_name2EditPart.java
index 0519b02b8..ee2e367bd 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_name2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EEnum_name2EditPart.java
@@ -1,7 +1,7 @@
package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
@@ -10,6 +10,7 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -26,6 +27,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
+
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -42,8 +45,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -76,7 +77,7 @@ import org.eclipse.swt.graphics.Image;
/**
* @generated
*/
-public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAwareEditPart {
+public class EEnum_name2EditPart extends CompartmentEditPart implements ITextAwareEditPart {
/**
* @generated
@@ -116,17 +117,19 @@ public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAware
/**
* @generated
*/
- protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
- defaultText = figure.getText();
- return figure;
+ public Label getLabel() {
+ return (Label) getFigure();
}
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -135,7 +138,7 @@ public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAware
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -145,7 +148,7 @@ public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAware
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -310,8 +313,8 @@ public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAware
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -319,10 +322,8 @@ public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAware
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -373,6 +374,10 @@ public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAware
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
@@ -488,4 +493,54 @@ public class EEnum_name2EditPart extends GraphicalEditPart implements ITextAware
}
super.handleNotificationEvent(event);
}
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ Label label = createLabel();
+ defaultText = label.getText();
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected Label createLabel() {
+ return new NamedNode_NameLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class NamedNode_NameLabelFigure extends org.eclipse.draw2d.Label {
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates;
+
+ /**
+ * @generated
+ */
+ public NamedNode_NameLabelFigure() {
+
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EOperationEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EOperationEditPart.java
index 7b33350bd..2bb39ab48 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EOperationEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EOperationEditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EOperationItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EOperationItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EOperationEditPart extends CompartmentEditPart implements ITextAwar
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage2EditPart.java
index 6e2b7570d..b42dd5e2a 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage2EditPart.java
@@ -3,6 +3,7 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.draw2d.BorderLayout;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.emf.ecore.EAnnotation;
@@ -16,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.ecore.edit.policies.EPackage2CanonicalEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EPackage2ItemSemanticEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.EPackageGraphicalNodeEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
@@ -26,6 +28,7 @@ import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdap
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
@@ -55,6 +58,11 @@ public class EPackage2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
public EPackage2EditPart(View view) {
super(view);
}
@@ -100,6 +108,17 @@ public class EPackage2EditPart extends ShapeNodeEditPart {
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EPackage2ItemSemanticEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new EPackageGraphicalNodeEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EPackage2CanonicalEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ConstrainedToolbarLayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
+ if (child instanceof ITextAwareEditPart) {
+ return new EcoreTextSelectionEditPolicy();
+ }
+ }
+ return super.createChildEditPolicy(child);
+ }
+ });
}
/**
@@ -108,7 +127,25 @@ public class EPackage2EditPart extends ShapeNodeEditPart {
protected IFigure createNodeShape() {
NamedNodeRectangle figure = new NamedNodeRectangle();
figure.setUseLocalCoordinates(false);
- return figure;
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public NamedNodeRectangle getPrimaryShape() {
+ return (NamedNodeRectangle) primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if (childEditPart instanceof EPackage_name2EditPart) {
+ ((EPackage_name2EditPart) childEditPart).setLabel(getPrimaryShape().getFigureNamedNode_NameLabelFigure());
+ return true;
+ }
+ return false;
}
/**
@@ -131,15 +168,12 @@ public class EPackage2EditPart extends ShapeNodeEditPart {
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
- if (shape.getLayoutManager() == null) {
- shape.setLayoutManager(new StackLayout());
- }
+ contentPane = setupContentPane(shape);
- IFigure shapeContents = new Figure();
- shape.add(shapeContents);
- shapeContents.setLayoutManager(new BorderLayout());
- addContentPane(shapeContents);
- decorateShape(shapeContents);
+ IFigure decorationShape = createDecorationPane();
+ if (decorationShape != null) {
+ figure.add(decorationShape);
+ }
return figure;
}
@@ -147,30 +181,34 @@ public class EPackage2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- private void decorateShape(IFigure shapeContents) {
+ private IFigure createDecorationPane() {
View view = (View) getModel();
EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
if (annotation == null) {
- return;
+ return null;
}
Figure decorationPane = new Figure();
decorationPane.setLayoutManager(new BorderLayout());
- shapeContents.add(decorationPane, BorderLayout.BOTTOM);
- ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"));
- decorationPane.add(imageFigure, BorderLayout.RIGHT);
+ ImageFigureEx imageFigure = new ImageFigureEx(EcoreDiagramEditorPlugin.getInstance().getBundledImage("icons/shortcut.gif"), PositionConstants.EAST);
+ decorationPane.add(imageFigure, BorderLayout.BOTTOM);
+ return decorationPane;
}
/**
+ * Default implementation treats passed figure as content pane.
+ * Respects layout one may have set for generated figure.
+ * @param nodeShape instance of generated figure class
* @generated
*/
- protected void addContentPane(IFigure shape) {
- contentPane = new Figure();
- shape.add(contentPane, BorderLayout.CENTER);
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(getMapMode().DPtoLP(5));
- contentPane.setLayoutManager(layout);
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ if (nodeShape.getLayoutManager() == null) {
+ ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
+ layout.setSpacing(getMapMode().DPtoLP(5));
+ nodeShape.setLayoutManager(layout);
+ }
+ return nodeShape; // use nodeShape itself as contentPane
}
/**
@@ -193,6 +231,15 @@ public class EPackage2EditPart extends ShapeNodeEditPart {
/**
* @generated
*/
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if (!addFixedChild(childEditPart)) {
+ super.addChildVisual(childEditPart, -1);
+ }
+ }
+
+ /**
+ * @generated
+ */
public class NamedNodeRectangle extends org.eclipse.draw2d.RectangleFigure {
/**
@@ -205,32 +252,35 @@ public class EPackage2EditPart extends ShapeNodeEditPart {
*/
public NamedNodeRectangle() {
- org.eclipse.draw2d.IFigure childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
+ org.eclipse.draw2d.Label childNamedNode_NameLabelFigure = createFigureNamedNode_NameLabelFigure();
setFigureNamedNode_NameLabelFigure(childNamedNode_NameLabelFigure);
add(childNamedNode_NameLabelFigure);
}
- private org.eclipse.draw2d.IFigure fNamedNode_NameLabelFigure;
+ /**
+ * @generated
+ */
+ private org.eclipse.draw2d.Label fNamedNode_NameLabelFigure;
/**
* @generated
*/
- public org.eclipse.draw2d.IFigure getFigureNamedNode_NameLabelFigure() {
+ public org.eclipse.draw2d.Label getFigureNamedNode_NameLabelFigure() {
return fNamedNode_NameLabelFigure;
}
/**
* @generated
*/
- protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.IFigure figure) {
+ protected void setFigureNamedNode_NameLabelFigure(org.eclipse.draw2d.Label figure) {
fNamedNode_NameLabelFigure = figure;
}
/**
* @generated
*/
- private org.eclipse.draw2d.IFigure createFigureNamedNode_NameLabelFigure() {
+ private org.eclipse.draw2d.Label createFigureNamedNode_NameLabelFigure() {
org.eclipse.draw2d.Label rv = new org.eclipse.draw2d.Label();
return rv;
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage3EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage3EditPart.java
index b837361e8..f0cd3a50f 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage3EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage3EditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EPackage3ItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EPackage3ItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EPackage3EditPart extends CompartmentEditPart implements ITextAware
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_classesEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_classesEditPart.java
index f0f6f4ebd..a5a7c484f 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_classesEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_classesEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EPackage_classesCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EPackage_classesEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EPackage_classesCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_datatypesEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_datatypesEditPart.java
index 3c5fa4104..d13da4fc9 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_datatypesEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_datatypesEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EPackage_datatypesCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EPackage_datatypesEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EPackage_datatypesCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_enumsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_enumsEditPart.java
index a592f5c89..9836a98f0 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_enumsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_enumsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EPackage_enumsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EPackage_enumsEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EPackage_enumsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_name2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_name2EditPart.java
index 48e70fc1c..689b24b10 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_name2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_name2EditPart.java
@@ -1,7 +1,7 @@
package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
@@ -10,6 +10,7 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -26,6 +27,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
+
import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -42,8 +45,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -76,7 +77,7 @@ import org.eclipse.swt.graphics.Image;
/**
* @generated
*/
-public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAwareEditPart {
+public class EPackage_name2EditPart extends CompartmentEditPart implements ITextAwareEditPart {
/**
* @generated
@@ -116,17 +117,19 @@ public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAw
/**
* @generated
*/
- protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
- defaultText = figure.getText();
- return figure;
+ public Label getLabel() {
+ return (Label) getFigure();
}
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -135,7 +138,7 @@ public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAw
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -145,7 +148,7 @@ public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAw
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -310,8 +313,8 @@ public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAw
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -319,10 +322,8 @@ public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAw
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -373,6 +374,10 @@ public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAw
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
@@ -488,4 +493,54 @@ public class EPackage_name2EditPart extends GraphicalEditPart implements ITextAw
}
super.handleNotificationEvent(event);
}
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ Label label = createLabel();
+ defaultText = label.getText();
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected Label createLabel() {
+ return new NamedNode_NameLabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class NamedNode_NameLabelFigure extends org.eclipse.draw2d.Label {
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates;
+
+ /**
+ * @generated
+ */
+ public NamedNode_NameLabelFigure() {
+
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packageannotationsEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packageannotationsEditPart.java
index ff9692a95..69d6e0e9e 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packageannotationsEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packageannotationsEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EPackage_packageannotationsCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EPackage_packageannotationsEditPart extends ListCompartmentEditPart
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EPackage_packageannotationsCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packagesEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packagesEditPart.java
index 226b0d14b..bd4676e3c 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packagesEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EPackage_packagesEditPart.java
@@ -2,6 +2,14 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Orientable;
+import org.eclipse.draw2d.ScrollPane;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gmf.ecore.edit.policies.EPackage_packagesCanonicalEditPolicy;
@@ -12,6 +20,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar;
+
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
/**
* @generated
*/
@@ -48,4 +63,33 @@ public class EPackage_packagesEditPart extends ListCompartmentEditPart {
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new EPackage_packagesCanonicalEditPolicy());
}
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public IFigure createFigure() {
+ IMapMode mm = getMapMode();
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure) super.createFigure();
+ if (rcf instanceof ShapeCompartmentFigure) {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new ListScrollBar(Orientable.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new MarginBorder(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new Dimension(SZ, SZ));
+ } else {
+ Insets insets = new Insets(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ Dimension size = new Dimension(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ ScrollPane scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new ListScrollBar(Orientable.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_name2EditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_name2EditPart.java
index b1a3a9133..1eb154329 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_name2EditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_name2EditPart.java
@@ -12,6 +12,7 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.emf.common.notify.Notification;
@@ -26,6 +27,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
+
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
import org.eclipse.gmf.ecore.providers.EcoreSemanticHints;
@@ -41,8 +44,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -127,17 +128,19 @@ public class EReference_name2EditPart extends LabelEditPart implements ITextAwar
/**
* @generated
*/
- protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
- defaultText = figure.getText();
- return figure;
+ public Label getLabel() {
+ return (Label) getFigure();
}
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -146,7 +149,7 @@ public class EReference_name2EditPart extends LabelEditPart implements ITextAwar
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -156,7 +159,7 @@ public class EReference_name2EditPart extends LabelEditPart implements ITextAwar
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -316,8 +319,8 @@ public class EReference_name2EditPart extends LabelEditPart implements ITextAwar
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -325,10 +328,8 @@ public class EReference_name2EditPart extends LabelEditPart implements ITextAwar
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -379,6 +380,10 @@ public class EReference_name2EditPart extends LabelEditPart implements ITextAwar
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
@@ -478,4 +483,54 @@ public class EReference_name2EditPart extends LabelEditPart implements ITextAwar
}
super.handleNotificationEvent(event);
}
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ Label label = createLabel();
+ defaultText = label.getText();
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected Label createLabel() {
+ return new LabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class LabelFigure extends org.eclipse.draw2d.Label {
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates;
+
+ /**
+ * @generated
+ */
+ public LabelFigure() {
+
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_nameEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_nameEditPart.java
index fa02449f1..537a0efbd 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_nameEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EReference_nameEditPart.java
@@ -12,6 +12,7 @@ import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.emf.common.notify.Notification;
@@ -26,6 +27,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
+
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
import org.eclipse.gmf.ecore.providers.EcoreSemanticHints;
@@ -41,8 +44,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -127,17 +128,19 @@ public class EReference_nameEditPart extends LabelEditPart implements ITextAware
/**
* @generated
*/
- protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
- defaultText = figure.getText();
- return figure;
+ public Label getLabel() {
+ return (Label) getFigure();
}
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -146,7 +149,7 @@ public class EReference_nameEditPart extends LabelEditPart implements ITextAware
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -156,7 +159,7 @@ public class EReference_nameEditPart extends LabelEditPart implements ITextAware
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -316,8 +319,8 @@ public class EReference_nameEditPart extends LabelEditPart implements ITextAware
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -325,10 +328,8 @@ public class EReference_nameEditPart extends LabelEditPart implements ITextAware
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -379,6 +380,10 @@ public class EReference_nameEditPart extends LabelEditPart implements ITextAware
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
@@ -478,4 +483,54 @@ public class EReference_nameEditPart extends LabelEditPart implements ITextAware
}
super.handleNotificationEvent(event);
}
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigure() {
+ Label label = createLabel();
+ defaultText = label.getText();
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected Label createLabel() {
+ return new LabelFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class LabelFigure extends org.eclipse.draw2d.Label {
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates;
+
+ /**
+ * @generated
+ */
+ public LabelFigure() {
+
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EStringToStringMapEntryEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EStringToStringMapEntryEditPart.java
index a33022b20..b91bf5dea 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EStringToStringMapEntryEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/EStringToStringMapEntryEditPart.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.parts;
+import java.util.Collections;
import org.eclipse.gef.DragTracker;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.Request;
@@ -10,14 +11,12 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.ecore.edit.policies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-//import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableTextEditPolicy;
-import org.eclipse.gmf.ecore.edit.policies.NonResizableTextEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.notation.View;
-import java.util.Collections;
import java.util.List;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Point;
@@ -34,6 +33,8 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.gmf.ecore.edit.policies.EStringToStringMapEntryItemSemanticEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextNonResizableEditPolicy;
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
@@ -49,8 +50,6 @@ import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
@@ -126,7 +125,7 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new EStringToStringMapEntryItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableTextEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EcoreTextNonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
}
@@ -135,7 +134,7 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
* @generated
*/
protected IFigure createFigure() {
- WrapLabel figure = new WrapLabel();
+ Label figure = new Label();
defaultText = figure.getText();
return figure;
}
@@ -143,8 +142,19 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
/**
* @generated
*/
- public WrapLabel getLabel() {
- return (WrapLabel) getFigure();
+ public Label getLabel() {
+ return (Label) getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(Label figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = figure.getText();
+ registerVisuals();
+ refreshVisuals();
}
/**
@@ -153,7 +163,7 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
protected void refreshUnderline() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextUnderline(style.isUnderline());
+ //getLabel().setTextUnderline(style.isUnderline());
}
}
@@ -163,7 +173,7 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
protected void refreshStrikeThrough() {
FontStyle style = (FontStyle) getPrimaryView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if (style != null) {
- getLabel().setTextStrikeThrough(style.isStrikeThrough());
+ //getLabel().setTextStrikeThrough(style.isStrikeThrough());
}
}
@@ -323,8 +333,8 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
* @generated
*/
protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager.class) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
+ if (getManager().getClass() == TextDirectEditManager.class) {
+ ((TextDirectEditManager) getManager()).show(eventLocation.getSWTPoint());
}
}
@@ -332,10 +342,8 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
* @generated
*/
private void performDirectEdit(char initialCharacter) {
- // Run the TextDirectEditManager show with the initial character
- // This will not send an extra mouse click
- if (getManager() instanceof org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) {
- ((org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager) getManager()).show(initialCharacter);
+ if (getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager) getManager()).show(initialCharacter);
} else {
performDirectEdit();
}
@@ -386,6 +394,10 @@ public class EStringToStringMapEntryEditPart extends CompartmentEditPart impleme
protected void refreshLabel() {
getLabel().setText(getLabelText());
getLabel().setIcon(getLabelIcon());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/ITextAwareEditPart.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/ITextAwareEditPart.java
index e12638bc9..849e2a836 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/ITextAwareEditPart.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/ITextAwareEditPart.java
@@ -2,7 +2,6 @@ package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
@@ -14,11 +13,6 @@ public interface ITextAwareEditPart extends org.eclipse.gef.GraphicalEditPart {
/**
* @generated
*/
- public WrapLabel getLabel();
-
- /**
- * @generated
- */
public String getEditText();
/**
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/TextDirectEditManager.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/TextDirectEditManager.java
index 72288a695..1794b54d5 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/TextDirectEditManager.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/parts/TextDirectEditManager.java
@@ -1,6 +1,8 @@
package org.eclipse.gmf.ecore.edit.parts;
import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.GraphicalEditPart;
@@ -27,6 +29,9 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.gef.EditPolicy;
+
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
/**
* @generated
@@ -56,11 +61,11 @@ public class TextDirectEditManager extends DirectEditManager {
/**
* @generated
*/
- static private class TextCellEditorLocator implements CellEditorLocator {
+ static private class WrapTextCellEditorLocator implements CellEditorLocator {
private WrapLabel wrapLabel;
- public TextCellEditorLocator(WrapLabel wrapLabel) {
+ public WrapTextCellEditorLocator(WrapLabel wrapLabel) {
super();
this.wrapLabel = wrapLabel;
}
@@ -90,8 +95,38 @@ public class TextDirectEditManager extends DirectEditManager {
/**
* @generated
*/
+ static private class TextCellEditorLocator implements CellEditorLocator {
+
+ private Label label;
+
+ public TextCellEditorLocator(Label label) {
+ super();
+ this.label = label;
+ }
+
+ public Label getLabel() {
+ return label;
+ }
+
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text) celleditor.getControl();
+ Rectangle rect = getLabel().getTextBounds().getCopy();
+ getLabel().translateToAbsolute(rect);
+
+ int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
+ rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
+
+ if (!rect.equals(new Rectangle(text.getBounds())))
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+
+ }
+
+ /**
+ * @generated
+ */
public TextDirectEditManager(ITextAwareEditPart source) {
- super(source, getTextCellEditorClass(source), new TextCellEditorLocator(source.getLabel()));
+ super(source, getTextCellEditorClass(source), getCellEditorLocator(source.getFigure()));
}
/**
@@ -104,10 +139,20 @@ public class TextDirectEditManager extends DirectEditManager {
/**
* @generated
*/
+ private static CellEditorLocator getCellEditorLocator(IFigure label) {
+ if (label instanceof Label) {
+ return new TextCellEditorLocator((Label) label);
+ }
+ return new WrapTextCellEditorLocator((WrapLabel) label);
+ }
+
+ /**
+ * @generated
+ */
private static Class getTextCellEditorClass(ITextAwareEditPart source) {
- WrapLabel wrapLabel = source.getLabel();
+ IFigure label = source.getFigure();
- if (wrapLabel.isTextWrapped())
+ if (label instanceof WrapLabel && ((WrapLabel) label).isTextWrapped())
return WrapTextCellEditor.class;
return TextCellEditorEx.class;
@@ -116,7 +161,7 @@ public class TextDirectEditManager extends DirectEditManager {
/**
* @generated
*/
- protected Font getScaledFont(WrapLabel label) {
+ protected Font getScaledFont(IFigure label) {
Font scaledFont = label.getFont();
FontData data = scaledFont.getFontData()[0];
Dimension fontSize = new Dimension(0, MapModeUtil.getMapMode(label).DPtoLP(data.getHeight()));
@@ -141,7 +186,7 @@ public class TextDirectEditManager extends DirectEditManager {
setEditText(textEP.getEditText());
- WrapLabel label = textEP.getLabel();
+ IFigure label = textEP.getFigure();
Assert.isNotNull(label);
Text text = (Text) getCellEditor().getControl();
// scale the font accordingly to the zoom level
@@ -236,10 +281,18 @@ public class TextDirectEditManager extends DirectEditManager {
Text textControl = (Text) cellEditor.getControl();
// Get the Text Edit Part's Figure (WrapLabel)
- WrapLabel label = textEP.getLabel();
+ IFigure label = textEP.getFigure();
Assert.isNotNull(label);
// Set the Figures text
- label.setText(toEdit);
+ if (label instanceof Label) {
+ ((Label) label).setText(toEdit);
+ } else {
+ ((WrapLabel) label).setText(toEdit);
+ }
+ Object pdEditPolicy = textEP.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
// See RATLC00522324
if (cellEditor instanceof TextCellEditorEx) {
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/ConstrainedToolbarLayoutEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/ConstrainedToolbarLayoutEditPolicy.java
deleted file mode 100644
index cd44dc742..000000000
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/ConstrainedToolbarLayoutEditPolicy.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.eclipse.gmf.ecore.edit.policies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.ecore.edit.parts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.TextSelectionEditPolicy;
-
-/**
- * @generated
- */
-public class ConstrainedToolbarLayoutEditPolicy extends org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy {
-
- /**
- * @generated
- */
- protected EditPolicy createChildEditPolicy(EditPart child) {
- if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
- if (child instanceof ITextAwareEditPart)
- return new TextSelectionEditPolicy();
- }
- return super.createChildEditPolicy(child);
- }
-}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EAnnotation_detailsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EAnnotation_detailsCanonicalEditPolicy.java
index 312dcc5f5..ce21b646e 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EAnnotation_detailsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EAnnotation_detailsCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EAnnotation_detailsCanonicalEditPolicy extends CanonicalEditPolicy
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EAnnotation modelElement = (EAnnotation) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getDetails().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EAnnotation) modelObject).getDetails().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2008 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_attributesCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_attributesCanonicalEditPolicy.java
index 701f0faa2..5ac0b36cf 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_attributesCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_attributesCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EClass_attributesCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EClass modelElement = (EClass) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEAttributes().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EClass) modelObject).getEAttributes().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2001 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_classannotationsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_classannotationsCanonicalEditPolicy.java
index 19fd84f60..df6e91b37 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_classannotationsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_classannotationsCanonicalEditPolicy.java
@@ -7,7 +7,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.ecore.part.EcoreVisualIDRegistry;
@@ -22,12 +22,13 @@ public class EClass_classannotationsCanonicalEditPolicy extends CanonicalEditPol
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EClass modelElement = (EClass) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEAnnotations().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2003 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_operationsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_operationsCanonicalEditPolicy.java
index 18a5f7d9c..96ff68a8c 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_operationsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EClass_operationsCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EClass_operationsCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EClass modelElement = (EClass) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEOperations().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EClass) modelObject).getEOperations().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2002 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EDataType_datatypeannotationsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EDataType_datatypeannotationsCanonicalEditPolicy.java
index 2547e22de..0b1f36bff 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EDataType_datatypeannotationsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EDataType_datatypeannotationsCanonicalEditPolicy.java
@@ -7,7 +7,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.ecore.part.EcoreVisualIDRegistry;
@@ -22,12 +22,13 @@ public class EDataType_datatypeannotationsCanonicalEditPolicy extends CanonicalE
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EDataType modelElement = (EDataType) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEAnnotations().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2003 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_enumannotationsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_enumannotationsCanonicalEditPolicy.java
index b10d0978f..4f33ae9a2 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_enumannotationsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_enumannotationsCanonicalEditPolicy.java
@@ -7,7 +7,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.ecore.part.EcoreVisualIDRegistry;
@@ -22,12 +22,13 @@ public class EEnum_enumannotationsCanonicalEditPolicy extends CanonicalEditPolic
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EEnum modelElement = (EEnum) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEAnnotations().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2003 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_literalsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_literalsCanonicalEditPolicy.java
index 516583d0b..39c33a450 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_literalsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EEnum_literalsCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EEnum_literalsCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EEnum modelElement = (EEnum) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getELiterals().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EEnum) modelObject).getELiterals().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2009 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackageCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackageCanonicalEditPolicy.java
index b95f424d5..6ddf990ca 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackageCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackageCanonicalEditPolicy.java
@@ -1,19 +1,50 @@
package org.eclipse.gmf.ecore.edit.policies;
-import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Collection;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;
-import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.emf.ecore.EObject;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.EcorePackage;
+
+import org.eclipse.gef.EditPart;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.ecore.part.EcoreDiagramEditorPlugin;
import org.eclipse.gmf.ecore.part.EcoreVisualIDRegistry;
+import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
+
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+
/**
* @generated
*/
@@ -24,40 +55,41 @@ public class EPackageCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EPackage modelElement = (EPackage) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEClassifiers().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (1001 == nodeVID) {
result.add(nextValue);
}
}
- for (Iterator it = modelElement.getESubpackages().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getESubpackages().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (1002 == nodeVID) {
result.add(nextValue);
}
}
- for (Iterator it = modelElement.getEAnnotations().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (1003 == nodeVID) {
result.add(nextValue);
}
}
- for (Iterator it = modelElement.getEClassifiers().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (1004 == nodeVID) {
result.add(nextValue);
}
}
- for (Iterator it = modelElement.getEClassifiers().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (1005 == nodeVID) {
result.add(nextValue);
}
@@ -77,51 +109,28 @@ public class EPackageCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
* @generated
*/
protected List getSemanticConnectionsList() {
- List result = new LinkedList();
- Diagram diagram = (Diagram) getHost().getModel();
- EPackage modelElement = (EPackage) diagram.getElement();
- for (Iterator diagramElements = modelElement.eContents().iterator(); diagramElements.hasNext();) {
- EObject nextDiagramElement = (EObject) diagramElements.next();
- for (Iterator childElements = nextDiagramElement.eContents().iterator(); childElements.hasNext();) {
- EObject nextChild = (EObject) childElements.next();
- if (EcoreVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextChild) != -1) {
- result.add(nextChild);
- }
- }
- }
- return result;
+ return Collections.EMPTY_LIST;
}
/**
* @generated
*/
protected EObject getSourceElement(EObject relationship) {
- return relationship.eContainer();
+ return null;
}
/**
* @generated
*/
protected EObject getTargetElement(EObject relationship) {
- int vID = EcoreVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(relationship);
- switch (vID) {
- case 3002:
- return ((ETypedElement) relationship).getEType();
- case 3003:
- return ((ETypedElement) relationship).getEType();
- }
return null;
}
/**
- * For now we are skipping links which was generated based on "GenLinkReferenceOnly" classes
- * since they do not handle any domain model objects inside, so we can not process them using
- * CanonicalConnectionEditPolicy class
- *
* @generated
*/
protected boolean shouldIncludeConnection(Edge connector, Collection children) {
- return super.shouldIncludeConnection(connector, children) && connector.getElement() != null;
+ return false;
}
/**
@@ -129,13 +138,320 @@ public class EPackageCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
*/
protected void refreshSemantic() {
super.refreshSemantic();
- refreshReferenceOnlyConnections();
+ refreshConnections();
+ }
+
+ /**
+ * @generated
+ */
+ private Collection myLinkDescriptors = new LinkedList();
+
+ /**
+ * @generated
+ */
+ private Map myEObject2ViewMap = new HashMap();
+
+ /**
+ * @generated
+ */
+ private void refreshConnections() {
+ try {
+ collectAllLinks(getDiagram());
+ Collection existingLinks = new LinkedList(getDiagram().getEdges());
+ for (Iterator diagramLinks = existingLinks.iterator(); diagramLinks.hasNext();) {
+ Edge nextDiagramLink = (Edge) diagramLinks.next();
+ EObject diagramLinkObject = nextDiagramLink.getElement();
+ EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
+ EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
+ int diagramLinkVisualID = getVisualID(nextDiagramLink);
+ for (Iterator modelLinkDescriptors = myLinkDescriptors.iterator(); modelLinkDescriptors.hasNext();) {
+ LinkDescriptor nextLinkDescriptor = (LinkDescriptor) modelLinkDescriptors.next();
+ if (diagramLinkObject == nextLinkDescriptor.getLinkElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination()
+ && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
+ diagramLinks.remove();
+ modelLinkDescriptors.remove();
+ }
+ }
+ }
+ deleteViews(existingLinks.iterator());
+ createConnections(myLinkDescriptors);
+ } finally {
+ myLinkDescriptors.clear();
+ myEObject2ViewMap.clear();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void collectAllLinks(View view) {
+ EObject modelElement = view.getElement();
+ int diagramElementVisualID = getVisualID(view);
+ switch (diagramElementVisualID) {
+ case 1001:
+ case 1002:
+ case 1003:
+ case 1004:
+ case 1005:
+ case 2001:
+ case 2002:
+ case 2003:
+ case 2004:
+ case 2005:
+ case 2006:
+ case 2007:
+ case 2008:
+ case 2009:
+ case 79: {
+ myEObject2ViewMap.put(modelElement, view);
+ storeLinks(modelElement, getDiagram());
+ for (Iterator children = view.getChildren().iterator(); children.hasNext();) {
+ View childView = (View) children.next();
+ collectAllLinks(childView);
+ }
+ return;
+ }
+ default: {
+ return;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void createConnections(Collection linkDescriptors) {
+ if (linkDescriptors.isEmpty()) {
+ return;
+ }
+ for (Iterator linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
+ final LinkDescriptor nextLinkDescriptor = (LinkDescriptor) linkDescriptorsIterator.next();
+ EditPart sourceEditPart = getEditPartFor(nextLinkDescriptor.getSource());
+ EditPart targetEditPart = getEditPartFor(nextLinkDescriptor.getDestination());
+ if (sourceEditPart == null || targetEditPart == null) {
+ continue;
+ }
+ String factoryHint = "";
+ CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), getFactoryHint(
+ nextLinkDescriptor.getSemanticAdapter(), factoryHint), ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
+ CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
+ ccr.setType(RequestConstants.REQ_CONNECTION_START);
+ ccr.setSourceEditPart(sourceEditPart);
+ sourceEditPart.getCommand(ccr);
+ ccr.setTargetEditPart(targetEditPart);
+ ccr.setType(RequestConstants.REQ_CONNECTION_END);
+ Command cmd = targetEditPart.getCommand(ccr);
+ if (cmd != null && cmd.canExecute()) {
+ executeCommand(cmd);
+ IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
+ SetViewMutabilityCommand.makeImmutable(viewAdapter).execute();
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private EditPart getEditPartFor(EObject modelElement) {
+ View view = (View) myEObject2ViewMap.get(modelElement);
+ if (view != null) {
+ return (EditPart) getHost().getViewer().getEditPartRegistry().get(view);
+ }
+ return null;
+ }
+
+ /**
+ *@generated
+ */
+ private void storeLinks(EObject container, Diagram diagram) {
+ EClass containerMetaclass = container.eClass();
+ storeFeatureModelFacetLinks(container, containerMetaclass, diagram);
+ storeTypeModelFacetLinks(container, containerMetaclass);
}
/**
* @generated
*/
- private void refreshReferenceOnlyConnections() {
- // TODO: implement this method
+ private void storeTypeModelFacetLinks(EObject container, EClass containerMetaclass) {
+ if (EcorePackage.eINSTANCE.getEClass().isSuperTypeOf(containerMetaclass)) {
+ for (Iterator values = ((EClass) container).getEStructuralFeatures().iterator(); values.hasNext();) {
+ EObject nextValue = ((EObject) values.next());
+ Object structuralFeatureResult = ((ETypedElement) nextValue).getEType();
+ if (structuralFeatureResult instanceof EObject) {
+ EObject dst = (EObject) structuralFeatureResult;
+ EObject src = container;
+ int linkVID = EcoreVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextValue);
+ if (3002 == linkVID) {
+ myLinkDescriptors.add(new LinkDescriptor(src, dst, nextValue, linkVID));
+ }
+ }
+ }
+ }
+ if (EcorePackage.eINSTANCE.getEClass().isSuperTypeOf(containerMetaclass)) {
+ for (Iterator values = ((EClass) container).getEStructuralFeatures().iterator(); values.hasNext();) {
+ EObject nextValue = ((EObject) values.next());
+ Object structuralFeatureResult = ((ETypedElement) nextValue).getEType();
+ if (structuralFeatureResult instanceof EObject) {
+ EObject dst = (EObject) structuralFeatureResult;
+ EObject src = container;
+ int linkVID = EcoreVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextValue);
+ if (3003 == linkVID) {
+ myLinkDescriptors.add(new LinkDescriptor(src, dst, nextValue, linkVID));
+ }
+ }
+ }
+ }
}
+
+ /**
+ *@generated
+ */
+ private void storeFeatureModelFacetLinks(EObject container, EClass containerMetaclass, Diagram diagram) {
+
+ if (EcorePackage.eINSTANCE.getEAnnotation().isSuperTypeOf(containerMetaclass)) {
+ for (Iterator destinations = ((EAnnotation) container).getReferences().iterator(); destinations.hasNext();) {
+ EObject nextDestination = (EObject) destinations.next();
+ myLinkDescriptors.add(new LinkDescriptor(container, nextDestination, EcoreElementTypes.EAnnotationReferences_3001, 3001));
+
+ }
+ }
+
+ if (EcorePackage.eINSTANCE.getEClass().isSuperTypeOf(containerMetaclass)) {
+ for (Iterator destinations = ((EClass) container).getESuperTypes().iterator(); destinations.hasNext();) {
+ EObject nextDestination = (EObject) destinations.next();
+ myLinkDescriptors.add(new LinkDescriptor(container, nextDestination, EcoreElementTypes.EClassESuperTypes_3004, 3004));
+
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private Diagram getDiagram() {
+ return ((View) getHost().getModel()).getDiagram();
+ }
+
+ /**
+ * @generated
+ */
+ private static int getVisualID(View containerView) {
+ EAnnotation annotation = containerView.getEAnnotation("ViewIdentifier"); //$NON-NLS-1$
+ if (annotation == null) {
+ return -1;
+ }
+ String visualID = (String) annotation.getDetails().get("visualID"); //$NON-NLS-1$
+ if (visualID == null) {
+ return -1;
+ }
+ try {
+ return Integer.parseInt(visualID);
+ } catch (NumberFormatException e) {
+ EcoreDiagramEditorPlugin.getInstance().logError("Unable to parse \"visualID\" annotation: " + visualID, e);
+ }
+ return -1;
+ }
+
+ /**
+ * @generated
+ */
+ private class LinkDescriptor {
+
+ /**
+ * @generated
+ */
+ private EObject mySource;
+
+ /**
+ * @generated
+ */
+ private EObject myDestination;
+
+ /**
+ * @generated
+ */
+ private EObject myLinkElement;
+
+ /**
+ * @generated
+ */
+ private int myVisualID;
+
+ /**
+ * @generated
+ */
+ private IAdaptable mySemanticAdapter;
+
+ /**
+ * @generated
+ */
+ protected LinkDescriptor(EObject source, EObject destination, EObject linkElement, int linkVID) {
+ this(source, destination, linkVID);
+ myLinkElement = linkElement;
+ mySemanticAdapter = new EObjectAdapter(linkElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected LinkDescriptor(EObject source, EObject destination, IElementType elementType, int linkVID) {
+ this(source, destination, linkVID);
+ myLinkElement = null;
+ final IElementType elementTypeCopy = elementType;
+ mySemanticAdapter = new IAdaptable() {
+
+ public Object getAdapter(Class adapter) {
+ if (IElementType.class.equals(adapter)) {
+ return elementTypeCopy;
+ }
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ private LinkDescriptor(EObject source, EObject destination, int linkVID) {
+ mySource = source;
+ myDestination = destination;
+ myVisualID = linkVID;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getSource() {
+ return mySource;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getDestination() {
+ return myDestination;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getLinkElement() {
+ return myLinkElement;
+ }
+
+ /**
+ * @generated
+ */
+ protected int getVisualID() {
+ return myVisualID;
+ }
+
+ /**
+ * @generated
+ */
+ protected IAdaptable getSemanticAdapter() {
+ return mySemanticAdapter;
+ }
+ }
+
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_classesCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_classesCanonicalEditPolicy.java
index 2390e9a23..da9cdbaa8 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_classesCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_classesCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EPackage_classesCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EPackage modelElement = (EPackage) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEClassifiers().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2004 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_datatypesCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_datatypesCanonicalEditPolicy.java
index 9a85b2e42..f4d7b7996 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_datatypesCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_datatypesCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EPackage_datatypesCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EPackage modelElement = (EPackage) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEClassifiers().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2006 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_enumsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_enumsCanonicalEditPolicy.java
index 7fd5b6b7c..ec790f040 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_enumsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_enumsCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EPackage_enumsCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EPackage modelElement = (EPackage) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEClassifiers().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2007 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packageannotationsCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packageannotationsCanonicalEditPolicy.java
index bca8ac979..2ea34272d 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packageannotationsCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packageannotationsCanonicalEditPolicy.java
@@ -7,8 +7,8 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
import org.eclipse.gmf.ecore.part.EcoreVisualIDRegistry;
@@ -22,12 +22,13 @@ public class EPackage_packageannotationsCanonicalEditPolicy extends CanonicalEdi
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EPackage modelElement = (EPackage) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getEAnnotations().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2003 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packagesCanonicalEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packagesCanonicalEditPolicy.java
index 5d7430dde..5936d3350 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packagesCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EPackage_packagesCanonicalEditPolicy.java
@@ -22,12 +22,13 @@ public class EPackage_packagesCanonicalEditPolicy extends CanonicalEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- EPackage modelElement = (EPackage) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getESubpackages().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((EPackage) modelObject).getESubpackages().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2005 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java
new file mode 100644
index 000000000..5fb882305
--- /dev/null
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java
@@ -0,0 +1,183 @@
+package org.eclipse.gmf.ecore.edit.policies;
+
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+
+/**
+ * @generated
+ */
+public class EcoreTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
+
+ /**
+ * @generated
+ */
+ private IFigure selectionFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private IFigure focusFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ protected void showPrimarySelection() {
+ showSelection();
+ showFocus();
+ }
+
+ /**
+ * @generated
+ */
+ protected void showSelection() {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideSelection() {
+ if (selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+
+ /**
+ * @generated
+ */
+ protected void showFocus() {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideFocus() {
+ if (focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getFeedbackLayer() {
+ return getLayer(LayerConstants.SCALED_FEEDBACK_LAYER);
+ }
+
+ /**
+ * @generated
+ */
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if (getHostFigure() instanceof Label) {
+ bounds = ((Label) getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createSelectionFeedbackFigure() {
+ if (getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateLabel(Label target) {
+ Label source = (Label) getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshSelectionFeedback() {
+ if (selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label) selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFocusFeedback() {
+ if (focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ /**
+ * @generated
+ */
+ protected List createSelectionHandles() {
+ MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
+ moveHandle.setBorder(null);
+ moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
+ return Collections.singletonList(moveHandle);
+ }
+}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java
new file mode 100644
index 000000000..d92017640
--- /dev/null
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java
@@ -0,0 +1,168 @@
+package org.eclipse.gmf.ecore.edit.policies;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editpolicies.SelectionEditPolicy;
+
+/**
+ * @generated
+ */
+public class EcoreTextSelectionEditPolicy extends SelectionEditPolicy {
+
+ /**
+ * @generated
+ */
+ private IFigure selectionFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private IFigure focusFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ protected void showPrimarySelection() {
+ showSelection();
+ showFocus();
+ }
+
+ /**
+ * @generated
+ */
+ protected void showSelection() {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideSelection() {
+ if (selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+
+ /**
+ * @generated
+ */
+ protected void showFocus() {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideFocus() {
+ if (focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure getFeedbackLayer() {
+ return getLayer(LayerConstants.SCALED_FEEDBACK_LAYER);
+ }
+
+ /**
+ * @generated
+ */
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if (getHostFigure() instanceof Label) {
+ bounds = ((Label) getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createSelectionFeedbackFigure() {
+ if (getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateLabel(Label target) {
+ Label source = (Label) getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshSelectionFeedback() {
+ if (selectionFeedbackFigure != null) {
+ if (selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label) selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFocusFeedback() {
+ if (focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/LabelDirectEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/LabelDirectEditPolicy.java
index 3740d3444..9d6994e9b 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/LabelDirectEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/LabelDirectEditPolicy.java
@@ -1,5 +1,6 @@
package org.eclipse.gmf.ecore.edit.policies;
+import org.eclipse.draw2d.Label;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.DirectEditPolicy;
@@ -7,10 +8,14 @@ import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.commands.EtoolsProxyCommand;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.ecore.edit.parts.ITextAwareEditPart;
+import org.eclipse.gef.EditPolicy;
+
+import org.eclipse.gmf.ecore.edit.policies.EcoreTextSelectionEditPolicy;
/**
* @generated
@@ -82,6 +87,14 @@ public class LabelDirectEditPolicy extends DirectEditPolicy {
*/
protected void showCurrentEditValue(DirectEditRequest request) {
String value = (String) request.getCellEditor().getValue();
- ((ITextAwareEditPart) getHost()).getLabel().setText(value);
+ if (getHostFigure() instanceof Label) {
+ ((Label) getHostFigure()).setText(value);
+ } else {
+ ((WrapLabel) getHostFigure()).setText(value);
+ }
+ Object pdEditPolicy = getHost().getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof EcoreTextSelectionEditPolicy) {
+ ((EcoreTextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
+ }
}
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/NonResizableTextEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/NonResizableTextEditPolicy.java
deleted file mode 100644
index a65f838b7..000000000
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/NonResizableTextEditPolicy.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.eclipse.gmf.ecore.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-import org.eclipse.gmf.ecore.edit.parts.ITextAwareEditPart;
-
-/**
- * @generated
- */
-public class NonResizableTextEditPolicy extends NonResizableEditPolicyEx {
-
- /**
- * @generated
- */
- private WrapLabel getLabel() {
- return ((ITextAwareEditPart) getHost()).getLabel();
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- getLabel().setFocus(false);
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- getLabel().setSelected(false);
- getLabel().setFocus(false);
- super.hideSelection();
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- getLabel().setFocus(true);
- }
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- super.showPrimarySelection();
- getLabel().setFocus(true);
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- super.showSelection();
- getLabel().setSelected(true);
- getLabel().setFocus(false);
- }
-
- /**
- * @generated
- */
- protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditor.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditor.java
index a210ac04b..e36f2c544 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditor.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditor.java
@@ -44,5 +44,9 @@ public class EcoreDiagramEditor extends FileDiagramEditor implements IGotoMarker
FreeformLayer extLabelsLayer = new FreeformLayer();
extLabelsLayer.setLayoutManager(new DelegatingLayout());
printableLayers.addLayerAfter(extLabelsLayer, EcoreEditPartFactory.EXTERNAL_NODE_LABELS_LAYER, LayerConstants.PRIMARY_LAYER);
+ LayeredPane scalableLayers = (LayeredPane) root.getLayer(LayerConstants.SCALABLE_LAYERS);
+ FreeformLayer scaledFeedbackLayer = new FreeformLayer();
+ scaledFeedbackLayer.setEnabled(false);
+ scalableLayers.addLayerAfter(scaledFeedbackLayer, LayerConstants.SCALED_FEEDBACK_LAYER, DiagramRootEditPart.DECORATION_UNPRINTABLE_LAYER);
}
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditorPlugin.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditorPlugin.java
index fd996ac20..da224d67d 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditorPlugin.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreDiagramEditorPlugin.java
@@ -24,7 +24,6 @@ import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
-import org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager;
import org.eclipse.gmf.runtime.emf.core.internal.util.MetamodelManager;
/**
@@ -65,7 +64,6 @@ public class EcoreDiagramEditorPlugin extends AbstractUIPlugin {
super.start(context);
instance = this;
PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- MSLAdapterFactoryManager.register(new EcoreItemProviderAdapterFactory());
MetamodelManager.register(EcorePackage.eINSTANCE, EcoreEditPlugin.INSTANCE);
EcoreElementTypes.register();
adapterFactory = createAdapterFactory();
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreInitDiagramFileAction.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreInitDiagramFileAction.java
index 23310b65d..3f9b96626 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreInitDiagramFileAction.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreInitDiagramFileAction.java
@@ -1,72 +1,16 @@
package org.eclipse.gmf.ecore.part;
-import java.io.IOException;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.ecore.EcorePackage;
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-import org.eclipse.gmf.ecore.providers.EcoreElementTypes;
-
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -77,11 +21,6 @@ import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-import org.eclipse.ui.ide.IDE;
/**
* @generated
@@ -91,26 +30,6 @@ public class EcoreInitDiagramFileAction implements IObjectActionDelegate, IInput
/**
* @generated
*/
- private static final Integer LINK_KEY_3001 = new Integer(3001);
-
- /**
- * @generated
- */
- private static final Integer LINK_KEY_3002 = new Integer(3002);
-
- /**
- * @generated
- */
- private static final Integer LINK_KEY_3003 = new Integer(3003);
-
- /**
- * @generated
- */
- private static final Integer LINK_KEY_3004 = new Integer(3004);
-
- /**
- * @generated
- */
private IWorkbenchPart myPart;
/**
@@ -126,16 +45,6 @@ public class EcoreInitDiagramFileAction implements IObjectActionDelegate, IInput
/**
* @generated
*/
- private Map myLinkVID2EObjectMap = new HashMap();
-
- /**
- * @generated
- */
- private Map myEObject2NodeMap = new HashMap();
-
- /**
- * @generated
- */
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
myPart = targetPart;
}
@@ -163,7 +72,7 @@ public class EcoreInitDiagramFileAction implements IObjectActionDelegate, IInput
if (!status.isOK()) {
return status.getMessage();
}
- if (mySelectedModelFile.getParent().getFile(new Path(newText).addFileExtension("editorGen.getDiagramFileExtension()")).exists()) {
+ if (mySelectedModelFile.getParent().getFile(new Path(newText).addFileExtension("ecore_diagram")).exists()) {
return "File already exists, choose another name";
}
return null;
@@ -173,7 +82,7 @@ public class EcoreInitDiagramFileAction implements IObjectActionDelegate, IInput
* @generated
*/
public void run(IAction action) {
- NewDiagramFileWizard wizard = new NewDiagramFileWizard();
+ Wizard wizard = new EcoreNewDiagramFileWizard(mySelectedModelFile, myPart.getSite().getPage(), mySelection);
IDialogSettings pluginDialogSettings = EcoreDiagramEditorPlugin.getInstance().getDialogSettings();
IDialogSettings initDiagramFileSettings = pluginDialogSettings.getSection("InisDiagramFile"); //$NON-NLS-1$
if (initDiagramFileSettings == null) {
@@ -189,760 +98,4 @@ public class EcoreInitDiagramFileAction implements IObjectActionDelegate, IInput
dialog.open();
}
- /**
- * @generated
- */
- private class NewDiagramFileWizard extends Wizard {
-
- /**
- * @generated
- */
- private TransactionalEditingDomain myEditingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
-
- /**
- * @generated
- */
- private WizardNewFileCreationPage myFileCreationPage;
-
- /**
- * @generated
- */
- public void addPages() {
- myFileCreationPage = new WizardNewFileCreationPage("Initialize new Ecore diagram file", mySelection);
- myFileCreationPage.setFileName(mySelectedModelFile.getProjectRelativePath().removeFileExtension().addFileExtension("ecore_diagram").lastSegment());
- myFileCreationPage.setTitle("Diagram file");
- myFileCreationPage.setDescription("Create new diagram and initialize it using specified Ecore model content");
- addPage(myFileCreationPage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- final EObject diagramModelObject = load();
- if (diagramModelObject == null) {
- MessageDialog.openError(getShell(), "Error", "Failed to load user model");
- return false;
- }
-
- IFile diagramFile = myFileCreationPage.createNewFile();
- ResourceSet resourceSet = myEditingDomain.getResourceSet();
- final Resource diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFile.getFullPath().toString()));
-
- List affectedFiles = new LinkedList();
- affectedFiles.add(mySelectedModelFile);
- affectedFiles.add(diagramFile);
-
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, "Initializing diagram contents", affectedFiles) { //$NON-NLS-1$
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- int diagramVID = EcoreVisualIDRegistry.INSTANCE.getDiagramVisualID(diagramModelObject);
- if (diagramVID != 79) {
- return CommandResult.newErrorCommandResult("Incorrect model object stored as a root resource object"); //$NON-NLS-1$
- }
- myLinkVID2EObjectMap.put(LINK_KEY_3001, new LinkedList());
- myLinkVID2EObjectMap.put(LINK_KEY_3002, new LinkedList());
- myLinkVID2EObjectMap.put(LINK_KEY_3003, new LinkedList());
- myLinkVID2EObjectMap.put(LINK_KEY_3004, new LinkedList());
- Diagram diagram = ViewService.createDiagram(diagramModelObject, "Ecore", EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- diagramResource.getContents().add(diagram);
- createEPackage_79Children(diagram, diagramModelObject);
- createLinks();
- myLinkVID2EObjectMap.clear();
- myEObject2NodeMap.clear();
- return CommandResult.newOKCommandResult();
- }
- };
-
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
- diagramResource.save(Collections.EMPTY_MAP);
- IDE.openEditor(myPart.getSite().getPage(), diagramFile);
- } catch (ExecutionException e) {
- EcoreDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- } catch (IOException ex) {
- EcoreDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$
- } catch (PartInitException ex) {
- EcoreDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
- }
- return true;
- }
-
- /**
- * @generated
- */
- private EObject load() {
- ResourceSet resourceSet = myEditingDomain.getResourceSet();
- try {
- Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(mySelectedModelFile.getFullPath().toString()), true);
- return (EObject) resource.getContents().get(0);
- } catch (WrappedException ex) {
- EcoreDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + mySelectedModelFile.getFullPath().toString(), ex); //$NON-NLS-1$
- }
- return null;
- }
-
- }
-
- /**
- * @generated
- */
- private void createEClass_1001Children(View viewObject, EObject modelObject) {
- Node nextNode;
- nextNode = getCompartment(viewObject, "attributes");
- if (nextNode != null) {
- createAttributes_5001Children(nextNode, modelObject);
- }
- nextNode = getCompartment(viewObject, "operations");
- if (nextNode != null) {
- createOperations_5002Children(nextNode, modelObject);
- }
- nextNode = getCompartment(viewObject, "class annotations");
- if (nextNode != null) {
- createClass_annotations_5003Children(nextNode, modelObject);
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEPackage_1002Children(View viewObject, EObject modelObject) {
- Node nextNode;
- nextNode = getCompartment(viewObject, "classes");
- if (nextNode != null) {
- createClasses_5004Children(nextNode, modelObject);
- }
- nextNode = getCompartment(viewObject, "packages");
- if (nextNode != null) {
- createPackages_5005Children(nextNode, modelObject);
- }
- nextNode = getCompartment(viewObject, "data types");
- if (nextNode != null) {
- createData_types_5006Children(nextNode, modelObject);
- }
- nextNode = getCompartment(viewObject, "enums");
- if (nextNode != null) {
- createEnums_5007Children(nextNode, modelObject);
- }
- nextNode = getCompartment(viewObject, "package annotations");
- if (nextNode != null) {
- createPackage_annotations_5008Children(nextNode, modelObject);
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEAnnotation_1003Children(View viewObject, EObject modelObject) {
- Node nextNode;
- nextNode = getCompartment(viewObject, "details");
- if (nextNode != null) {
- createDetails_5009Children(nextNode, modelObject);
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEDataType_1004Children(View viewObject, EObject modelObject) {
- Node nextNode;
- nextNode = getCompartment(viewObject, "data type annotations");
- if (nextNode != null) {
- createData_type_annotations_5010Children(nextNode, modelObject);
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEEnum_1005Children(View viewObject, EObject modelObject) {
- Node nextNode;
- nextNode = getCompartment(viewObject, "literals");
- if (nextNode != null) {
- createLiterals_5011Children(nextNode, modelObject);
- }
- nextNode = getCompartment(viewObject, "enum annotations");
- if (nextNode != null) {
- createEnum_annotations_5012Children(nextNode, modelObject);
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEAttribute_2001Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEOperation_2002Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEAnnotation_2003Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEClass_2004Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEPackage_2005Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEDataType_2006Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEEnum_2007Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEStringToStringMapEntry_2008Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEEnumLiteral_2009Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createAttributes_5001Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EClass) modelObject).getEAttributes().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2001 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEAttribute_2001Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createOperations_5002Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EClass) modelObject).getEOperations().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2002 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEOperation_2002Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createClass_annotations_5003Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2003 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEAnnotation_2003Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createClasses_5004Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2004 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEClass_2004Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createPackages_5005Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EPackage) modelObject).getESubpackages().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2005 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEPackage_2005Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createData_types_5006Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2006 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEDataType_2006Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEnums_5007Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2007 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEEnum_2007Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createPackage_annotations_5008Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2003 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEAnnotation_2003Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createDetails_5009Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EAnnotation) modelObject).getDetails().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2008 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEStringToStringMapEntry_2008Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createData_type_annotations_5010Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2003 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEAnnotation_2003Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createLiterals_5011Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EEnum) modelObject).getELiterals().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2009 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEEnumLiteral_2009Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEnum_annotations_5012Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2003 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEAnnotation_2003Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createEPackage_79Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (1001 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEClass_1001Children(nextNode, nextValue);
- }
- }
- for (Iterator values = ((EPackage) modelObject).getESubpackages().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (1002 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEPackage_1002Children(nextNode, nextValue);
- }
- }
- for (Iterator values = ((EModelElement) modelObject).getEAnnotations().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (1003 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEAnnotation_1003Children(nextNode, nextValue);
- }
- }
- for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (1004 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEDataType_1004Children(nextNode, nextValue);
- }
- }
- for (Iterator values = ((EPackage) modelObject).getEClassifiers().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-
- nodeVID = EcoreVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (1005 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createEEnum_1005Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private Node getCompartment(View node, String name) {
- for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
- View nextView = (View) it.next();
- if (nextView instanceof Node && name.equals(nextView.getType())) {
- return (Node) nextView;
- }
- }
- return null;
- }
-
- /**
- *@generated
- */
- private void storeLinks(EObject container, Diagram diagram) {
- EClass containerMetaclass = container.eClass();
- storeFeatureModelFacetLinks(container, containerMetaclass, diagram);
- storeTypeModelFacetLinks(container, containerMetaclass, diagram);
- }
-
- /**
- * @generated
- */
- private void storeTypeModelFacetLinks(EObject container, EClass containerMetaclass, Diagram diagram) {
- if (-1 != containerMetaclass.getFeatureID(EcorePackage.eINSTANCE.getEClass_EStructuralFeatures())) {
- Object featureValue = ((EClass) container).getEStructuralFeatures();
- for (Iterator values = ((Collection) featureValue).iterator(); values.hasNext();) {
- EObject nextValue = ((EObject) values.next());
- int linkVID = EcoreVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextValue);
- if (3002 == linkVID) {
- Object structuralFeatureResult = ((ETypedElement) nextValue).getEType();
- if (structuralFeatureResult instanceof EObject) {
- EObject dst = (EObject) structuralFeatureResult;
- ((Collection) myLinkVID2EObjectMap.get(LINK_KEY_3002)).add(new LinkDescriptor(container, dst, nextValue, diagram));
- }
- }
- }
- }
- if (-1 != containerMetaclass.getFeatureID(EcorePackage.eINSTANCE.getEClass_EStructuralFeatures())) {
- Object featureValue = ((EClass) container).getEStructuralFeatures();
- for (Iterator values = ((Collection) featureValue).iterator(); values.hasNext();) {
- EObject nextValue = ((EObject) values.next());
- int linkVID = EcoreVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextValue);
- if (3003 == linkVID) {
- Object structuralFeatureResult = ((ETypedElement) nextValue).getEType();
- if (structuralFeatureResult instanceof EObject) {
- EObject dst = (EObject) structuralFeatureResult;
- ((Collection) myLinkVID2EObjectMap.get(LINK_KEY_3003)).add(new LinkDescriptor(container, dst, nextValue, diagram));
- }
- }
- }
- }
- }
-
- /**
- *@generated
- */
- private void storeFeatureModelFacetLinks(EObject container, EClass containerMetaclass, Diagram diagram) {
- if (-1 != containerMetaclass.getFeatureID(EcorePackage.eINSTANCE.getEAnnotation_References())) {
- Object structuralFeatureResult = ((EAnnotation) container).getReferences();
- for (Iterator destinations = ((Collection) structuralFeatureResult).iterator(); destinations.hasNext();) {
- EObject nextDestination = (EObject) destinations.next();
- ((Collection) myLinkVID2EObjectMap.get(LINK_KEY_3001)).add(new LinkDescriptor(container, nextDestination, EcoreElementTypes.EAnnotationReferences_3001, diagram));
- }
- }
- if (-1 != containerMetaclass.getFeatureID(EcorePackage.eINSTANCE.getEClass_ESuperTypes())) {
- Object structuralFeatureResult = ((EClass) container).getESuperTypes();
- for (Iterator destinations = ((Collection) structuralFeatureResult).iterator(); destinations.hasNext();) {
- EObject nextDestination = (EObject) destinations.next();
- ((Collection) myLinkVID2EObjectMap.get(LINK_KEY_3004)).add(new LinkDescriptor(container, nextDestination, EcoreElementTypes.EClassESuperTypes_3004, diagram));
- }
- }
- }
-
- /**
- * @generated
- */
- private void createLinks() {
- Collection linkElements;
- linkElements = (Collection) myLinkVID2EObjectMap.get(LINK_KEY_3001);
- for (Iterator it = linkElements.iterator(); it.hasNext();) {
- LinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();
- Edge edge = (Edge) ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), "", ViewUtil.APPEND,
- EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if (edge != null) {
- edge.setSource((Node) myEObject2NodeMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((Node) myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));
- }
- }
- linkElements = (Collection) myLinkVID2EObjectMap.get(LINK_KEY_3002);
- for (Iterator it = linkElements.iterator(); it.hasNext();) {
- LinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();
- Edge edge = (Edge) ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), "", ViewUtil.APPEND,
- EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if (edge != null) {
- edge.setSource((Node) myEObject2NodeMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((Node) myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));
- }
- }
- linkElements = (Collection) myLinkVID2EObjectMap.get(LINK_KEY_3003);
- for (Iterator it = linkElements.iterator(); it.hasNext();) {
- LinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();
- Edge edge = (Edge) ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), "", ViewUtil.APPEND,
- EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if (edge != null) {
- edge.setSource((Node) myEObject2NodeMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((Node) myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));
- }
- }
- linkElements = (Collection) myLinkVID2EObjectMap.get(LINK_KEY_3004);
- for (Iterator it = linkElements.iterator(); it.hasNext();) {
- LinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();
- Edge edge = (Edge) ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), "", ViewUtil.APPEND,
- EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if (edge != null) {
- edge.setSource((Node) myEObject2NodeMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((Node) myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));
- }
- }
- }
-
- /**
- * @generated
- */
- private class LinkDescriptor {
-
- /**
- * @generated
- */
- private EObject mySource;
-
- /**
- * @generated
- */
- private EObject myDestination;
-
- /**
- * @generated
- */
- private IAdaptable mySemanticAdapter;
-
- /**
- * @generated
- */
- private Diagram myDiagram;
-
- /**
- * @generated
- */
- protected LinkDescriptor(EObject source, EObject destination, EObject linkElement, Diagram diagram) {
- this(source, destination, diagram);
- mySemanticAdapter = new EObjectAdapter(linkElement);
- }
-
- /**
- * @generated
- */
- protected LinkDescriptor(EObject source, EObject destination, IElementType elementType, Diagram diagram) {
- this(source, destination, diagram);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new IAdaptable() {
-
- public Object getAdapter(Class adapter) {
- if (IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- private LinkDescriptor(EObject source, EObject destination, Diagram diagram) {
- mySource = source;
- myDestination = destination;
- myDiagram = diagram;
- }
-
- /**
- * @generated
- */
- protected EObject getSource() {
- return mySource;
- }
-
- /**
- * @generated
- */
- protected EObject getDestination() {
- return myDestination;
- }
-
- /**
- * @generated
- */
- protected Diagram getDiagram() {
- return myDiagram;
- }
-
- /**
- * @generated
- */
- protected IAdaptable getSemanticAdapter() {
- return mySemanticAdapter;
- }
- }
-}
+} \ No newline at end of file
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreNewDiagramFileWizard.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreNewDiagramFileWizard.java
new file mode 100644
index 000000000..73f458737
--- /dev/null
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/EcoreNewDiagramFileWizard.java
@@ -0,0 +1,161 @@
+package org.eclipse.gmf.ecore.part;
+
+import java.io.IOException;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+
+import org.eclipse.core.resources.IFile;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.common.util.WrappedException;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+
+import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * @generated
+ */
+public class EcoreNewDiagramFileWizard extends Wizard {
+
+ /**
+ * @generated
+ */
+ private TransactionalEditingDomain myEditingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+
+ /**
+ * @generated
+ */
+ private WizardNewFileCreationPage myFileCreationPage;
+
+ /**
+ * @generated
+ */
+ private IFile mySelectedModelFile;
+
+ /**
+ * @generated
+ */
+ private IWorkbenchPage myWorkbenchPage;
+
+ /**
+ * @generated
+ */
+ private IStructuredSelection mySelection;
+
+ /**
+ * @generated
+ */
+ public EcoreNewDiagramFileWizard(IFile selectedModelFile, IWorkbenchPage workbenchPage, IStructuredSelection selection) {
+ mySelectedModelFile = selectedModelFile;
+ myWorkbenchPage = workbenchPage;
+ mySelection = selection;
+ }
+
+ /**
+ * @generated
+ */
+ public void addPages() {
+ myFileCreationPage = new WizardNewFileCreationPage("Initialize new Ecore diagram file", mySelection);
+ myFileCreationPage.setFileName(mySelectedModelFile.getProjectRelativePath().removeFileExtension().addFileExtension("ecore_diagram").lastSegment());
+ myFileCreationPage.setTitle("Diagram file");
+ myFileCreationPage.setDescription("Create new diagram and initialize it using specified Ecore model content");
+ addPage(myFileCreationPage);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean performFinish() {
+ final EObject diagramModelObject = load();
+ if (diagramModelObject == null) {
+ MessageDialog.openError(getShell(), "Error", "Failed to load user model");
+ return false;
+ }
+
+ IFile diagramFile = myFileCreationPage.createNewFile();
+ ResourceSet resourceSet = myEditingDomain.getResourceSet();
+ final Resource diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFile.getFullPath().toString()));
+
+ List affectedFiles = new LinkedList();
+ affectedFiles.add(mySelectedModelFile);
+ affectedFiles.add(diagramFile);
+
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, "Initializing diagram contents", affectedFiles) { //$NON-NLS-1$
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ int diagramVID = EcoreVisualIDRegistry.INSTANCE.getDiagramVisualID(diagramModelObject);
+ if (diagramVID != 79) {
+ return CommandResult.newErrorCommandResult("Incorrect model object stored as a root resource object"); //$NON-NLS-1$
+ }
+ Diagram diagram = ViewService.createDiagram(diagramModelObject, "Ecore", EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ diagramResource.getContents().add(diagram);
+ return CommandResult.newOKCommandResult();
+ }
+ };
+
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
+ diagramResource.save(Collections.EMPTY_MAP);
+ IDE.openEditor(myWorkbenchPage, diagramFile);
+ } catch (ExecutionException e) {
+ EcoreDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
+ } catch (IOException ex) {
+ EcoreDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$
+ } catch (PartInitException ex) {
+ EcoreDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
+ }
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ private EObject load() {
+ ResourceSet resourceSet = myEditingDomain.getResourceSet();
+ try {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(mySelectedModelFile.getFullPath().toString()), true);
+ return (EObject) resource.getContents().get(0);
+ } catch (WrappedException ex) {
+ EcoreDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + mySelectedModelFile.getFullPath().toString(), ex); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+} \ No newline at end of file
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/AquatoryCanonicalEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/AquatoryCanonicalEditPolicy.java
index e0eec6acd..f251ae0f0 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/AquatoryCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/AquatoryCanonicalEditPolicy.java
@@ -11,19 +11,38 @@
*/
package org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Collection;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.examples.taipan.Aquatory;
import org.eclipse.gmf.examples.taipan.Route;
-
+import org.eclipse.gmf.examples.taipan.Ship;
+import org.eclipse.gmf.examples.taipan.TaiPanPackage;
+import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanDiagramEditorPlugin;
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
+import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
@@ -35,19 +54,20 @@ public class AquatoryCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- Aquatory modelElement = (Aquatory) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getPorts().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((Aquatory) modelObject).getPorts().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (1001 == nodeVID) {
result.add(nextValue);
}
}
- for (Iterator it = modelElement.getShips().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((Aquatory) modelObject).getShips().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (1002 == nodeVID) {
result.add(nextValue);
}
@@ -67,37 +87,20 @@ public class AquatoryCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
* @generated
*/
protected List getSemanticConnectionsList() {
- List result = new LinkedList();
- Diagram diagram = (Diagram) getHost().getModel();
- Aquatory modelElement = (Aquatory) diagram.getElement();
- for (Iterator diagramElements = modelElement.eContents().iterator(); diagramElements.hasNext();) {
- EObject nextDiagramElement = (EObject) diagramElements.next();
- for (Iterator childElements = nextDiagramElement.eContents().iterator(); childElements.hasNext();) {
- EObject nextChild = (EObject) childElements.next();
- if (TaiPanVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextChild) != -1) {
- result.add(nextChild);
- }
- }
- }
- return result;
+ return Collections.EMPTY_LIST;
}
/**
* @generated
*/
protected EObject getSourceElement(EObject relationship) {
- return relationship.eContainer();
+ return null;
}
/**
* @generated
*/
protected EObject getTargetElement(EObject relationship) {
- int vID = TaiPanVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(relationship);
- switch (vID) {
- case 3002:
- return ((Route) relationship).getDestination();
- }
return null;
}
@@ -109,7 +112,7 @@ public class AquatoryCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
* @generated
*/
protected boolean shouldIncludeConnection(Edge connector, Collection children) {
- return super.shouldIncludeConnection(connector, children) && connector.getElement() != null;
+ return false;
}
/**
@@ -117,13 +120,289 @@ public class AquatoryCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
*/
protected void refreshSemantic() {
super.refreshSemantic();
- refreshReferenceOnlyConnections();
+ refreshConnections();
}
/**
* @generated
*/
- private void refreshReferenceOnlyConnections() {
- // TODO: implement this method
+ private Collection myLinkDescriptors = new LinkedList();
+
+ /**
+ * @generated
+ */
+ private Map myEObject2ViewMap = new HashMap();
+
+ /**
+ * @generated
+ */
+ private void refreshConnections() {
+ try {
+ collectAllLinks(getDiagram());
+ Collection existingLinks = new LinkedList(getDiagram().getEdges());
+ for (Iterator diagramLinks = existingLinks.iterator(); diagramLinks.hasNext();) {
+ Edge nextDiagramLink = (Edge) diagramLinks.next();
+ EObject diagramLinkObject = nextDiagramLink.getElement();
+ EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
+ EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
+ int diagramLinkVisualID = getVisualID(nextDiagramLink);
+ for (Iterator modelLinkDescriptors = myLinkDescriptors.iterator(); modelLinkDescriptors.hasNext();) {
+ LinkDescriptor nextLinkDescriptor = (LinkDescriptor) modelLinkDescriptors.next();
+ if (diagramLinkObject == nextLinkDescriptor.getLinkElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination()
+ && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
+ diagramLinks.remove();
+ modelLinkDescriptors.remove();
+ }
+ }
+ }
+ deleteViews(existingLinks.iterator());
+ createConnections(myLinkDescriptors);
+ } finally {
+ myLinkDescriptors.clear();
+ myEObject2ViewMap.clear();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void collectAllLinks(View view) {
+ EObject modelElement = view.getElement();
+ int diagramElementVisualID = getVisualID(view);
+ switch (diagramElementVisualID) {
+ case 1001:
+ case 1002:
+ case 2001:
+ case 79: {
+ myEObject2ViewMap.put(modelElement, view);
+ storeLinks(modelElement, getDiagram());
+ for (Iterator children = view.getChildren().iterator(); children.hasNext();) {
+ View childView = (View) children.next();
+ collectAllLinks(childView);
+ }
+ return;
+ }
+ default: {
+ return;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void createConnections(Collection linkDescriptors) {
+ if (linkDescriptors.isEmpty()) {
+ return;
+ }
+ for (Iterator linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
+ final LinkDescriptor nextLinkDescriptor = (LinkDescriptor) linkDescriptorsIterator.next();
+ EditPart sourceEditPart = getEditPartFor(nextLinkDescriptor.getSource());
+ EditPart targetEditPart = getEditPartFor(nextLinkDescriptor.getDestination());
+ if (sourceEditPart == null || targetEditPart == null) {
+ continue;
+ }
+ String factoryHint = "";
+ CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), getFactoryHint(
+ nextLinkDescriptor.getSemanticAdapter(), factoryHint), ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost()).getDiagramPreferencesHint());
+ CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
+ ccr.setType(RequestConstants.REQ_CONNECTION_START);
+ ccr.setSourceEditPart(sourceEditPart);
+ sourceEditPart.getCommand(ccr);
+ ccr.setTargetEditPart(targetEditPart);
+ ccr.setType(RequestConstants.REQ_CONNECTION_END);
+ Command cmd = targetEditPart.getCommand(ccr);
+ if (cmd != null && cmd.canExecute()) {
+ executeCommand(cmd);
+ IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
+ SetViewMutabilityCommand.makeImmutable(viewAdapter).execute();
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private EditPart getEditPartFor(EObject modelElement) {
+ View view = (View) myEObject2ViewMap.get(modelElement);
+ if (view != null) {
+ return (EditPart) getHost().getViewer().getEditPartRegistry().get(view);
+ }
+ return null;
+ }
+
+ /**
+ *@generated
+ */
+ private void storeLinks(EObject container, Diagram diagram) {
+ EClass containerMetaclass = container.eClass();
+ storeFeatureModelFacetLinks(container, containerMetaclass, diagram);
+ storeTypeModelFacetLinks(container, containerMetaclass);
}
+
+ /**
+ * @generated
+ */
+ private void storeTypeModelFacetLinks(EObject container, EClass containerMetaclass) {
+ if (TaiPanPackage.eINSTANCE.getAquatory().isSuperTypeOf(containerMetaclass)) {
+ for (Iterator values = ((Aquatory) container).getRoutes().iterator(); values.hasNext();) {
+ EObject nextValue = ((EObject) values.next());
+ Object structuralFeatureResult = ((Route) nextValue).getDestination();
+ if (structuralFeatureResult instanceof EObject) {
+ EObject dst = (EObject) structuralFeatureResult;
+ structuralFeatureResult = ((Route) nextValue).getSource();
+ if (structuralFeatureResult instanceof EObject) {
+ EObject src = (EObject) structuralFeatureResult;
+ int linkVID = TaiPanVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextValue);
+ if (3002 == linkVID) {
+ myLinkDescriptors.add(new LinkDescriptor(src, dst, nextValue, linkVID));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ *@generated
+ */
+ private void storeFeatureModelFacetLinks(EObject container, EClass containerMetaclass, Diagram diagram) {
+
+ if (TaiPanPackage.eINSTANCE.getShip().isSuperTypeOf(containerMetaclass)) {
+ EObject nextDestination = (EObject) ((Ship) container).getDestination();
+ myLinkDescriptors.add(new LinkDescriptor(container, nextDestination, TaiPanElementTypes.ShipDestination_3001, 3001));
+
+ }
+
+ }
+
+ /**
+ * @generated
+ */
+ private Diagram getDiagram() {
+ return ((View) getHost().getModel()).getDiagram();
+ }
+
+ /**
+ * @generated
+ */
+ private static int getVisualID(View containerView) {
+ EAnnotation annotation = containerView.getEAnnotation("ViewIdentifier"); //$NON-NLS-1$
+ if (annotation == null) {
+ return -1;
+ }
+ String visualID = (String) annotation.getDetails().get("visualID"); //$NON-NLS-1$
+ if (visualID == null) {
+ return -1;
+ }
+ try {
+ return Integer.parseInt(visualID);
+ } catch (NumberFormatException e) {
+ TaiPanDiagramEditorPlugin.getInstance().logError("Unable to parse \"visualID\" annotation: " + visualID, e);
+ }
+ return -1;
+ }
+
+ /**
+ * @generated
+ */
+ private class LinkDescriptor {
+
+ /**
+ * @generated
+ */
+ private EObject mySource;
+
+ /**
+ * @generated
+ */
+ private EObject myDestination;
+
+ /**
+ * @generated
+ */
+ private EObject myLinkElement;
+
+ /**
+ * @generated
+ */
+ private int myVisualID;
+
+ /**
+ * @generated
+ */
+ private IAdaptable mySemanticAdapter;
+
+ /**
+ * @generated
+ */
+ protected LinkDescriptor(EObject source, EObject destination, EObject linkElement, int linkVID) {
+ this(source, destination, linkVID);
+ myLinkElement = linkElement;
+ mySemanticAdapter = new EObjectAdapter(linkElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected LinkDescriptor(EObject source, EObject destination, IElementType elementType, int linkVID) {
+ this(source, destination, linkVID);
+ myLinkElement = null;
+ final IElementType elementTypeCopy = elementType;
+ mySemanticAdapter = new IAdaptable() {
+
+ public Object getAdapter(Class adapter) {
+ if (IElementType.class.equals(adapter)) {
+ return elementTypeCopy;
+ }
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ private LinkDescriptor(EObject source, EObject destination, int linkVID) {
+ mySource = source;
+ myDestination = destination;
+ myVisualID = linkVID;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getSource() {
+ return mySource;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getDestination() {
+ return myDestination;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getLinkElement() {
+ return myLinkElement;
+ }
+
+ /**
+ * @generated
+ */
+ protected int getVisualID() {
+ return myVisualID;
+ }
+
+ /**
+ * @generated
+ */
+ protected IAdaptable getSemanticAdapter() {
+ return mySemanticAdapter;
+ }
+ }
+
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortCanonicalEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortCanonicalEditPolicy.java
index 3e44f0c69..a949479f1 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/PortCanonicalEditPolicy.java
@@ -11,13 +11,13 @@
*/
package org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipCanonicalEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipCanonicalEditPolicy.java
index dfbf02ef4..3a25ff90d 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/ShipCanonicalEditPolicy.java
@@ -11,13 +11,13 @@
*/
package org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/Ship_CargoCompartmentCanonicalEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/Ship_CargoCompartmentCanonicalEditPolicy.java
index 93707cac3..506158f91 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/Ship_CargoCompartmentCanonicalEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/edit/policies/Ship_CargoCompartmentCanonicalEditPolicy.java
@@ -11,18 +11,16 @@
*/
package org.eclipse.gmf.examples.taipan.gmf.editor.edit.policies;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
-
import org.eclipse.gmf.examples.taipan.Ship;
-
import org.eclipse.gmf.examples.taipan.gmf.editor.part.TaiPanVisualIDRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
@@ -34,12 +32,13 @@ public class Ship_CargoCompartmentCanonicalEditPolicy extends CanonicalEditPolic
*/
protected List getSemanticChildrenList() {
List result = new LinkedList();
- Ship modelElement = (Ship) ((View) getHost().getModel()).getElement();
+ EObject modelObject = ((View) getHost().getModel()).getElement();
+ View viewObject = (View) getHost().getModel();
EObject nextValue;
int nodeVID;
- for (Iterator it = modelElement.getCargo().iterator(); it.hasNext();) {
- nextValue = (EObject) it.next();
- nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
+ for (Iterator values = ((Ship) modelObject).getCargo().iterator(); values.hasNext();) {
+ nextValue = (EObject) values.next();
+ nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
if (2001 == nodeVID) {
result.add(nextValue);
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java
index be1110ee0..fd74525ab 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanDiagramEditorPlugin.java
@@ -16,27 +16,22 @@ import java.util.List;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
import org.eclipse.gmf.examples.taipan.TaiPanPackage;
-
import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
-
import org.eclipse.gmf.examples.taipan.provider.TaiPanEditPlugin;
import org.eclipse.gmf.examples.taipan.provider.TaiPanItemProviderAdapterFactory;
-
-import org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
import org.eclipse.gmf.runtime.emf.core.internal.util.MetamodelManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
/**
* @generated
@@ -76,7 +71,6 @@ public class TaiPanDiagramEditorPlugin extends AbstractUIPlugin {
super.start(context);
instance = this;
PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- MSLAdapterFactoryManager.register(new TaiPanItemProviderAdapterFactory());
MetamodelManager.register(TaiPanPackage.eINSTANCE, TaiPanEditPlugin.INSTANCE);
TaiPanElementTypes.register();
adapterFactory = createAdapterFactory();
diff --git a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanNewDiagramFileWizard.java b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanNewDiagramFileWizard.java
index 7bba74661..e14eb8e85 100644
--- a/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanNewDiagramFileWizard.java
+++ b/examples/org.eclipse.gmf.examples.taipan.gmf.editor/src/org/eclipse/gmf/examples/taipan/gmf/editor/part/TaiPanNewDiagramFileWizard.java
@@ -12,73 +12,33 @@
package org.eclipse.gmf.examples.taipan.gmf.editor.part;
import java.io.IOException;
-
-import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import org.eclipse.core.commands.ExecutionException;
-
import org.eclipse.core.commands.operations.OperationHistoryFactory;
-
import org.eclipse.core.resources.IFile;
-
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
-
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.WrappedException;
-
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
-
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
-
import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-import org.eclipse.gmf.examples.taipan.Aquatory;
-import org.eclipse.gmf.examples.taipan.Route;
-import org.eclipse.gmf.examples.taipan.Ship;
-import org.eclipse.gmf.examples.taipan.TaiPanPackage;
-
-import org.eclipse.gmf.examples.taipan.gmf.editor.providers.TaiPanElementTypes;
-
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-
import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-
import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-
import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-
import org.eclipse.jface.dialogs.MessageDialog;
-
import org.eclipse.jface.viewers.IStructuredSelection;
-
import org.eclipse.jface.wizard.Wizard;
-
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
-
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
import org.eclipse.ui.ide.IDE;
/**
@@ -158,7 +118,6 @@ public class TaiPanNewDiagramFileWizard extends Wizard {
}
Diagram diagram = ViewService.createDiagram(diagramModelObject, "TaiPan", TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
diagramResource.getContents().add(diagram);
- initDiagramContents(diagram, diagramModelObject);
return CommandResult.newOKCommandResult();
}
};
@@ -191,278 +150,4 @@ public class TaiPanNewDiagramFileWizard extends Wizard {
return null;
}
- /**
- * @generated
- */
- private static final Integer LINK_KEY_3001 = new Integer(3001);
-
- /**
- * @generated
- */
- private static final Integer LINK_KEY_3002 = new Integer(3002);
-
- /**
- * @generated
- */
- private Map myLinkVID2EObjectMap = new HashMap();
-
- /**
- * @generated
- */
- private Map myEObject2NodeMap = new HashMap();
-
- /**
- * @generated
- */
- private void initDiagramContents(Diagram diagram, EObject diagramModelObject) {
- myLinkVID2EObjectMap.put(LINK_KEY_3001, new LinkedList());
- myLinkVID2EObjectMap.put(LINK_KEY_3002, new LinkedList());
- createAquatory_79Children(diagram, diagramModelObject);
- createLinks();
- }
-
- /**
- * @generated
- */
- private void createPort_1001Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createShip_1002Children(View viewObject, EObject modelObject) {
- Node nextNode;
- nextNode = getCompartment(viewObject, "CargoCompartment");
- if (nextNode != null) {
- createCargoCompartment_5001Children(nextNode, modelObject);
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createItem_2001Children(View viewObject, EObject modelObject) {
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private void createCargoCompartment_5001Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((Ship) modelObject).getCargo().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
- nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (2001 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createItem_2001Children(nextNode, nextValue);
- }
- }
- }
-
- /**
- * @generated
- */
- private void createAquatory_79Children(View viewObject, EObject modelObject) {
- EObject nextValue;
- Node nextNode;
- int nodeVID;
- for (Iterator values = ((Aquatory) modelObject).getPorts().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
- nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (1001 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createPort_1001Children(nextNode, nextValue);
- }
- }
- for (Iterator values = ((Aquatory) modelObject).getShips().iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
- nodeVID = TaiPanVisualIDRegistry.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (1002 == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- createShip_1002Children(nextNode, nextValue);
- }
- }
- storeLinks(modelObject, viewObject.getDiagram());
- }
-
- /**
- * @generated
- */
- private Node getCompartment(View node, String name) {
- for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
- View nextView = (View) it.next();
- if (nextView instanceof Node && name.equals(nextView.getType())) {
- return (Node) nextView;
- }
- }
- return null;
- }
-
- /**
- *@generated
- */
- private void storeLinks(EObject container, Diagram diagram) {
- EClass containerMetaclass = container.eClass();
- storeFeatureModelFacetLinks(container, containerMetaclass, diagram);
- storeTypeModelFacetLinks(container, containerMetaclass, diagram);
- }
-
- /**
- * @generated
- */
- private void storeTypeModelFacetLinks(EObject container, EClass containerMetaclass, Diagram diagram) {
- if (TaiPanPackage.eINSTANCE.getAquatory().isSuperTypeOf(containerMetaclass)) {
- for (Iterator values = ((Aquatory) container).getRoutes().iterator(); values.hasNext();) {
- EObject nextValue = ((EObject) values.next());
- Object structuralFeatureResult = ((Route) nextValue).getDestination();
- if (structuralFeatureResult instanceof EObject) {
- EObject dst = (EObject) structuralFeatureResult;
- structuralFeatureResult = ((Route) nextValue).getSource();
- if (structuralFeatureResult instanceof EObject) {
- EObject src = (EObject) structuralFeatureResult;
- int linkVID = TaiPanVisualIDRegistry.INSTANCE.getLinkWithClassVisualID(nextValue);
- if (3002 == linkVID) {
- ((Collection) myLinkVID2EObjectMap.get(LINK_KEY_3002)).add(new LinkDescriptor(src, dst, nextValue, diagram));
- }
- }
- }
- }
- }
- }
-
- /**
- *@generated
- */
- private void storeFeatureModelFacetLinks(EObject container, EClass containerMetaclass, Diagram diagram) {
- if (TaiPanPackage.eINSTANCE.getShip().isSuperTypeOf(containerMetaclass)) {
- if (((Ship) container).getDestination() instanceof EObject) {
- EObject nextDestination = (EObject) ((Ship) container).getDestination();
- ((Collection) myLinkVID2EObjectMap.get(LINK_KEY_3001)).add(new LinkDescriptor(container, nextDestination, TaiPanElementTypes.ShipDestination_3001, diagram));
- }
- }
- }
-
- /**
- * @generated
- */
- private void createLinks() {
- Collection linkElements;
- linkElements = (Collection) myLinkVID2EObjectMap.get(LINK_KEY_3001);
- for (Iterator it = linkElements.iterator(); it.hasNext();) {
- LinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();
- Edge edge = (Edge) ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), "", ViewUtil.APPEND,
- TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if (edge != null) {
- edge.setSource((Node) myEObject2NodeMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((Node) myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));
- }
- }
- linkElements = (Collection) myLinkVID2EObjectMap.get(LINK_KEY_3002);
- for (Iterator it = linkElements.iterator(); it.hasNext();) {
- LinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();
- Edge edge = (Edge) ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), "", ViewUtil.APPEND,
- TaiPanDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if (edge != null) {
- edge.setSource((Node) myEObject2NodeMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((Node) myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));
- }
- }
- }
-
- /**
- * @generated
- */
- private class LinkDescriptor {
-
- /**
- * @generated
- */
- private EObject mySource;
-
- /**
- * @generated
- */
- private EObject myDestination;
-
- /**
- * @generated
- */
- private IAdaptable mySemanticAdapter;
-
- /**
- * @generated
- */
- private Diagram myDiagram;
-
- /**
- * @generated
- */
- protected LinkDescriptor(EObject source, EObject destination, EObject linkElement, Diagram diagram) {
- this(source, destination, diagram);
- mySemanticAdapter = new EObjectAdapter(linkElement);
- }
-
- /**
- * @generated
- */
- protected LinkDescriptor(EObject source, EObject destination, IElementType elementType, Diagram diagram) {
- this(source, destination, diagram);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new IAdaptable() {
-
- public Object getAdapter(Class adapter) {
- if (IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- private LinkDescriptor(EObject source, EObject destination, Diagram diagram) {
- mySource = source;
- myDestination = destination;
- myDiagram = diagram;
- }
-
- /**
- * @generated
- */
- protected EObject getSource() {
- return mySource;
- }
-
- /**
- * @generated
- */
- protected EObject getDestination() {
- return myDestination;
- }
-
- /**
- * @generated
- */
- protected Diagram getDiagram() {
- return myDiagram;
- }
-
- /**
- * @generated
- */
- protected IAdaptable getSemanticAdapter() {
- return mySemanticAdapter;
- }
- }
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java
index cebcee6e6..033ef788e 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java
@@ -41,127 +41,191 @@ public class NewDiagramFileWizardGenerator {
protected final String TEXT_22 = NL + "\t\ttry {" + NL + "\t\t\tResource resource = resourceSet.getResource(URI.createPlatformResourceURI(mySelectedModelFile.getFullPath().toString()), true);" + NL + "\t\t\treturn (EObject) resource.getContents().get(0);" + NL + "\t\t} catch (WrappedException ex) {" + NL + "\t\t\t";
protected final String TEXT_23 = ".getInstance().logError(\"Unable to load resource: \" + mySelectedModelFile.getFullPath().toString(), ex); //$NON-NLS-1$" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}";
protected final String TEXT_24 = NL;
- protected final String TEXT_25 = NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static final Integer LINK_KEY_";
- protected final String TEXT_26 = " = new Integer(";
- protected final String TEXT_27 = ");";
- protected final String TEXT_28 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_29 = " myLinkVID2EObjectMap = new ";
- protected final String TEXT_30 = "();" + NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_31 = " myEObject2NodeMap = new ";
- protected final String TEXT_32 = "();" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void initDiagramContents(Diagram diagram, EObject diagramModelObject) {";
- protected final String TEXT_33 = NL + "\tmyLinkVID2EObjectMap.put(LINK_KEY_";
- protected final String TEXT_34 = ", new LinkedList());";
- protected final String TEXT_35 = NL + "\tcreate";
- protected final String TEXT_36 = "Children(diagram, diagramModelObject);";
- protected final String TEXT_37 = NL + "\tResource resource = diagramModelObject.eResource();" + NL + "\tfor (";
- protected final String TEXT_38 = " it = resource.getContents().iterator(); it.hasNext();) {" + NL + "\t\tEObject nextResourceObject = (EObject) it.next();" + NL + "\t\tif (nextResourceObject == diagramModelObject) {" + NL + "\t\t\tcontinue;" + NL + "\t\t}" + NL + "\t\tint nodeVID = ";
- protected final String TEXT_39 = ".INSTANCE.getNodeVisualID(diagram, nextResourceObject, \"\");" + NL + "\t\t";
- protected final String TEXT_40 = " nextNode;" + NL + "\t\tswitch (nodeVID) {";
- protected final String TEXT_41 = NL + "\t\tcase ";
- protected final String TEXT_42 = ":" + NL + "\t\t\tnextNode = ViewService.createNode(diagram, nextResourceObject, null, ";
+ protected final String TEXT_25 = NL;
+ protected final String TEXT_26 = NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
+ protected final String TEXT_27 = " myLinkDescriptors = new ";
+ protected final String TEXT_28 = "();" + NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
+ protected final String TEXT_29 = " myEObject2NodeMap = new ";
+ protected final String TEXT_30 = "();" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void initDiagramContents(";
+ protected final String TEXT_31 = " diagram, ";
+ protected final String TEXT_32 = " diagramModelObject) {" + NL + "\tcreate";
+ protected final String TEXT_33 = "Children(diagram, diagramModelObject);";
+ protected final String TEXT_34 = NL;
+ protected final String TEXT_35 = " resource = diagramModelObject.eResource();" + NL + "for (";
+ protected final String TEXT_36 = " it = resource.getContents().iterator(); it.hasNext();) {" + NL + "\t";
+ protected final String TEXT_37 = " nextResourceObject = (";
+ protected final String TEXT_38 = ") it.next();" + NL + "\tif (nextResourceObject == diagramModelObject) {" + NL + "\t\tcontinue;" + NL + "\t}" + NL + "\tint nodeVID = ";
+ protected final String TEXT_39 = ".INSTANCE.getNodeVisualID(diagram, nextResourceObject, \"\");" + NL + "\tswitch (nodeVID) {";
+ protected final String TEXT_40 = NL + "\t\tcase ";
+ protected final String TEXT_41 = ": {" + NL + "\t\t\t";
+ protected final String TEXT_42 = " nextNode = ViewService.createNode(diagram, nextResourceObject, null, ";
protected final String TEXT_43 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\t\tmyEObject2NodeMap.put(nextResourceObject, nextNode);" + NL + "\t\t\tcreate";
- protected final String TEXT_44 = "Children(nextNode, nextResourceObject);" + NL + "\t\t\tbreak;";
- protected final String TEXT_45 = NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_46 = "\t\t" + NL + "\t\tcreateLinks();" + NL + "\t}";
- protected final String TEXT_47 = "\t" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
- protected final String TEXT_48 = "Children(";
- protected final String TEXT_49 = " viewObject, EObject modelObject) {";
- protected final String TEXT_50 = NL + "\tEObject nextValue;" + NL + "\t";
- protected final String TEXT_51 = " nextNode;" + NL + "\tint nodeVID;";
- protected final String TEXT_52 = NL + "\t";
- protected final String TEXT_53 = " nextNode;";
- protected final String TEXT_54 = NL + "\tfor (";
- protected final String TEXT_55 = " values = ";
- protected final String TEXT_56 = ".iterator(); values.hasNext();) {" + NL + "\t\tnextValue = (EObject) values.next();";
- protected final String TEXT_57 = NL + "\tnextValue = ";
- protected final String TEXT_58 = ";";
- protected final String TEXT_59 = NL + "\tnodeVID = ";
- protected final String TEXT_60 = ".INSTANCE.getNodeVisualID(viewObject, nextValue, \"\");" + NL + "\tif (";
- protected final String TEXT_61 = " == nodeVID) {" + NL + "\t\tnextNode = ViewService.createNode(viewObject, nextValue, null, ";
- protected final String TEXT_62 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\tmyEObject2NodeMap.put(nextValue, nextNode);" + NL + "\t\tcreate";
- protected final String TEXT_63 = "Children(nextNode, nextValue);" + NL + "\t}";
- protected final String TEXT_64 = NL + "\t}";
- protected final String TEXT_65 = NL + "\tnextNode = getCompartment(viewObject, \"";
- protected final String TEXT_66 = "\");" + NL + "\tif (nextNode != null) {" + NL + "\t\tcreate";
- protected final String TEXT_67 = "Children(nextNode, modelObject);" + NL + "\t}";
- protected final String TEXT_68 = NL + "\tstoreLinks(modelObject, viewObject.getDiagram());";
- protected final String TEXT_69 = NL + "}";
- protected final String TEXT_70 = NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_71 = " getCompartment(";
- protected final String TEXT_72 = " node, String name) {" + NL + "\tfor (";
- protected final String TEXT_73 = " it = node.getChildren().iterator(); it.hasNext();) {" + NL + "\t\t";
- protected final String TEXT_74 = " nextView = (";
- protected final String TEXT_75 = ") it.next();" + NL + "\t\tif (nextView instanceof ";
- protected final String TEXT_76 = " && name.equals(nextView.getType())) {" + NL + "\t\t\treturn (";
- protected final String TEXT_77 = ") nextView;" + NL + "\t\t}" + NL + "\t}" + NL + "\treturn null;" + NL + "}";
- protected final String TEXT_78 = NL + NL + "/**" + NL + " *@generated" + NL + " */" + NL + "private void storeLinks(EObject container, Diagram diagram) {" + NL + "\t";
- protected final String TEXT_79 = " containerMetaclass = container.eClass();" + NL + "\tstoreFeatureModelFacetLinks(container, containerMetaclass, diagram);" + NL + "\tstoreTypeModelFacetLinks(container, containerMetaclass, diagram);" + NL + "}" + NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void storeTypeModelFacetLinks(EObject container, ";
- protected final String TEXT_80 = " containerMetaclass, Diagram diagram) {\t";
- protected final String TEXT_81 = "\t\t" + NL + "\tif (";
- protected final String TEXT_82 = ".eINSTANCE.get";
- protected final String TEXT_83 = "().isSuperTypeOf(containerMetaclass)) {";
- protected final String TEXT_84 = "\t\t" + NL + "\t\tfor (";
- protected final String TEXT_85 = " values = ";
- protected final String TEXT_86 = ".iterator(); values.hasNext();) {" + NL + "\t\t\tEObject nextValue = ((EObject) values.next());";
- protected final String TEXT_87 = NL + "\t\tEObject nextValue = (EObject) ";
- protected final String TEXT_88 = ";";
- protected final String TEXT_89 = NL + "\t\tObject structuralFeatureResult = ";
- protected final String TEXT_90 = ";" + NL + "\t\tif (structuralFeatureResult instanceof EObject) {" + NL + "\t\t\tEObject dst = (EObject) structuralFeatureResult;";
- protected final String TEXT_91 = NL + "\t\t\tstructuralFeatureResult = ";
- protected final String TEXT_92 = ";" + NL + "\t\t\tif (structuralFeatureResult instanceof EObject) {" + NL + "\t\t\t\tEObject src = (EObject) structuralFeatureResult;";
- protected final String TEXT_93 = NL + "\t\t\tEObject src = nextValue;";
- protected final String TEXT_94 = NL + "\t\t\tint linkVID = ";
- protected final String TEXT_95 = ".INSTANCE.getLinkWithClassVisualID(nextValue);" + NL + "\t\t\tif (";
- protected final String TEXT_96 = " == linkVID) {" + NL + "\t\t\t\t((";
- protected final String TEXT_97 = ") myLinkVID2EObjectMap.get(LINK_KEY_";
- protected final String TEXT_98 = ")).add(new LinkDescriptor(src, dst, nextValue, diagram));" + NL + "\t\t\t}";
- protected final String TEXT_99 = NL + "\t\t\t}";
- protected final String TEXT_100 = NL + "\t\t}";
- protected final String TEXT_101 = NL + "\t\t}";
- protected final String TEXT_102 = NL + "\t}";
- protected final String TEXT_103 = NL + "}" + NL + "" + NL + "/**" + NL + " *@generated" + NL + " */" + NL + "private void storeFeatureModelFacetLinks(EObject container, ";
- protected final String TEXT_104 = " containerMetaclass, Diagram diagram) {";
- protected final String TEXT_105 = NL + "\tif (";
- protected final String TEXT_106 = ".eINSTANCE.get";
- protected final String TEXT_107 = "().isSuperTypeOf(containerMetaclass)) {";
- protected final String TEXT_108 = NL + "\t\tfor (";
- protected final String TEXT_109 = " destinations = ";
- protected final String TEXT_110 = ".iterator(); destinations.hasNext();) {" + NL + "\t\t\tEObject nextDestination = (EObject) destinations.next();";
- protected final String TEXT_111 = NL + "\t\tif (";
- protected final String TEXT_112 = " instanceof EObject) {" + NL + "\t\t\tEObject nextDestination = (EObject) ";
- protected final String TEXT_113 = ";";
- protected final String TEXT_114 = NL + "\t\t\t((";
- protected final String TEXT_115 = ") myLinkVID2EObjectMap.get(LINK_KEY_";
- protected final String TEXT_116 = ")).add(new LinkDescriptor(container, nextDestination, ";
- protected final String TEXT_117 = ".";
- protected final String TEXT_118 = ", diagram));";
- protected final String TEXT_119 = NL + "\t\t\tint nodeVID = ";
- protected final String TEXT_120 = ".INSTANCE.getNodeVisualID(diagram, nextDestination, \"\");" + NL + "\t\t\tif (";
- protected final String TEXT_121 = " == nodeVID) {" + NL + "\t\t\t\t";
- protected final String TEXT_122 = " nextNode = ViewService.createNode(diagram, nextDestination, null, ";
- protected final String TEXT_123 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\t\t\tmyEObject2NodeMap.put(nextDestination, nextNode);" + NL + "\t\t\t\tcreate";
- protected final String TEXT_124 = "Children(nextNode, nextDestination);" + NL + "\t\t\t}";
- protected final String TEXT_125 = NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_126 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void createLinks() {";
- protected final String TEXT_127 = NL + "\t";
- protected final String TEXT_128 = " linkElements;";
- protected final String TEXT_129 = NL + "\tlinkElements = (";
- protected final String TEXT_130 = ") myLinkVID2EObjectMap.get(LINK_KEY_";
- protected final String TEXT_131 = ");" + NL + "\tfor (";
- protected final String TEXT_132 = " it = linkElements.iterator(); it.hasNext();) {" + NL + "\t\tLinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();" + NL + "\t\t";
- protected final String TEXT_133 = " edge = (";
- protected final String TEXT_134 = ") ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), \"\", ";
- protected final String TEXT_135 = ".APPEND, ";
- protected final String TEXT_136 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\tif (edge != null) {" + NL + "\t\t\tedge.setSource((";
- protected final String TEXT_137 = ") myEObject2NodeMap.get(nextLinkDescriptor.getSource()));" + NL + "\t\t\tedge.setTarget((";
- protected final String TEXT_138 = ") myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));" + NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_139 = NL + "}" + NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private class LinkDescriptor {" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate EObject mySource;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate EObject myDestination;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate IAdaptable mySemanticAdapter;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate Diagram myDiagram;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor(EObject source, EObject destination, EObject linkElement, Diagram diagram) {" + NL + "\t\tthis(source, destination, diagram);" + NL + "\t\tmySemanticAdapter = new ";
- protected final String TEXT_140 = "(linkElement);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor(EObject source, EObject destination, ";
- protected final String TEXT_141 = " elementType, Diagram diagram) {" + NL + "\t\tthis(source, destination, diagram);" + NL + "\t\tfinal ";
- protected final String TEXT_142 = " elementTypeCopy = elementType;" + NL + "\t\tmySemanticAdapter = new ";
- protected final String TEXT_143 = "() {" + NL + "\t\t\tpublic Object getAdapter(Class adapter) {" + NL + "\t\t\t\tif (";
- protected final String TEXT_144 = ".class.equals(adapter)) {" + NL + "\t\t\t\t\treturn elementTypeCopy;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor(EObject source, EObject destination, Diagram diagram) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyDiagram = diagram;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected EObject getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected EObject getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected Diagram getDiagram() {" + NL + "\t\treturn myDiagram;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected IAdaptable getSemanticAdapter() {" + NL + "\t\treturn mySemanticAdapter;" + NL + "\t}" + NL + "}";
- protected final String TEXT_145 = "\t" + NL + "" + NL + "}";
+ protected final String TEXT_44 = "Children(nextNode, nextResourceObject);" + NL + "\t\t\tbreak;" + NL + "\t\t}";
+ protected final String TEXT_45 = NL;
+ protected final String TEXT_46 = "\t}" + NL + "}";
+ protected final String TEXT_47 = "\t\t" + NL + "\tcreateLinks(diagram);" + NL + "}";
+ protected final String TEXT_48 = "\t" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
+ protected final String TEXT_49 = "Children(";
+ protected final String TEXT_50 = " viewObject, ";
+ protected final String TEXT_51 = " modelObject) {";
+ protected final String TEXT_52 = NL;
+ protected final String TEXT_53 = "\t";
+ protected final String TEXT_54 = " nextValue;" + NL + "\tint nodeVID;";
+ protected final String TEXT_55 = "\tfor (";
+ protected final String TEXT_56 = " values = ";
+ protected final String TEXT_57 = ".iterator(); values.hasNext();) {" + NL + "\t\tnextValue = (";
+ protected final String TEXT_58 = ") values.next();";
+ protected final String TEXT_59 = NL + "\tnextValue = ";
+ protected final String TEXT_60 = ";";
+ protected final String TEXT_61 = NL + "\tnodeVID = ";
+ protected final String TEXT_62 = ".INSTANCE.getNodeVisualID(viewObject, nextValue, \"\");" + NL + "\tif (";
+ protected final String TEXT_63 = " == nodeVID) {" + NL + "\t\t";
+ protected final String TEXT_64 = " nextNode = ViewService.createNode(viewObject, nextValue, null, ";
+ protected final String TEXT_65 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\tmyEObject2NodeMap.put(nextValue, nextNode);" + NL + "\t\tcreate";
+ protected final String TEXT_66 = "Children(nextNode, nextValue);";
+ protected final String TEXT_67 = NL;
+ protected final String TEXT_68 = "\t}";
+ protected final String TEXT_69 = NL + "\t}";
+ protected final String TEXT_70 = NL + "\t";
+ protected final String TEXT_71 = " nextCompartment = getCompartment(viewObject, ";
+ protected final String TEXT_72 = ");" + NL + "\tif (nextCompartment != null) {" + NL + "\t\tcreate";
+ protected final String TEXT_73 = "Children(nextCompartment, modelObject);" + NL + "\t}";
+ protected final String TEXT_74 = NL + "\tstoreLinks(modelObject, viewObject.getDiagram());";
+ protected final String TEXT_75 = NL + "}";
+ protected final String TEXT_76 = NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
+ protected final String TEXT_77 = " getCompartment(";
+ protected final String TEXT_78 = " node, String name) {" + NL + "\tfor (";
+ protected final String TEXT_79 = " it = node.getChildren().iterator(); it.hasNext();) {" + NL + "\t\t";
+ protected final String TEXT_80 = " nextView = (";
+ protected final String TEXT_81 = ") it.next();" + NL + "\t\tif (nextView instanceof ";
+ protected final String TEXT_82 = " && name.equals(nextView.getType())) {" + NL + "\t\t\treturn (";
+ protected final String TEXT_83 = ") nextView;" + NL + "\t\t}" + NL + "\t}" + NL + "\treturn null;" + NL + "}";
+ protected final String TEXT_84 = NL;
+ protected final String TEXT_85 = NL;
+ protected final String TEXT_86 = "/**" + NL + " *@generated" + NL + " */" + NL + "private void storeLinks(";
+ protected final String TEXT_87 = " container, ";
+ protected final String TEXT_88 = " diagram) {" + NL + "\t";
+ protected final String TEXT_89 = " containerMetaclass = container.eClass();" + NL + "\tstoreFeatureModelFacetLinks(container, containerMetaclass, diagram);" + NL + "\tstoreTypeModelFacetLinks(container, containerMetaclass);" + NL + "}" + NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void storeTypeModelFacetLinks(";
+ protected final String TEXT_90 = " container, ";
+ protected final String TEXT_91 = " containerMetaclass) {\t";
+ protected final String TEXT_92 = "\t\t" + NL + "\tif (";
+ protected final String TEXT_93 = ".eINSTANCE.get";
+ protected final String TEXT_94 = "().isSuperTypeOf(containerMetaclass)) {";
+ protected final String TEXT_95 = "\t\t" + NL + "\t\tfor (";
+ protected final String TEXT_96 = " values = ";
+ protected final String TEXT_97 = ".iterator(); values.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_98 = " nextValue = ((";
+ protected final String TEXT_99 = ") values.next());";
+ protected final String TEXT_100 = NL + "\t\t";
+ protected final String TEXT_101 = " nextValue = (";
+ protected final String TEXT_102 = ") ";
+ protected final String TEXT_103 = ";";
+ protected final String TEXT_104 = NL + "\t\tObject structuralFeatureResult = ";
+ protected final String TEXT_105 = ";" + NL + "\t\tif (structuralFeatureResult instanceof ";
+ protected final String TEXT_106 = ") {" + NL + "\t\t\t";
+ protected final String TEXT_107 = " dst = (";
+ protected final String TEXT_108 = ") structuralFeatureResult;";
+ protected final String TEXT_109 = NL + "\t\t\tstructuralFeatureResult = ";
+ protected final String TEXT_110 = ";" + NL + "\t\t\tif (structuralFeatureResult instanceof ";
+ protected final String TEXT_111 = ") {" + NL + "\t\t\t\t";
+ protected final String TEXT_112 = " src = (";
+ protected final String TEXT_113 = ") structuralFeatureResult;";
+ protected final String TEXT_114 = NL + "\t\t\t";
+ protected final String TEXT_115 = " src = container;";
+ protected final String TEXT_116 = NL + "\t\t\tint linkVID = ";
+ protected final String TEXT_117 = ".INSTANCE.getLinkWithClassVisualID(nextValue);" + NL + "\t\t\tif (";
+ protected final String TEXT_118 = " == linkVID) {" + NL + "\t\t\t\tmyLinkDescriptors.add(new LinkDescriptor(src, dst, nextValue, linkVID));" + NL + "\t\t\t}";
+ protected final String TEXT_119 = NL + "\t\t\t}";
+ protected final String TEXT_120 = NL + "\t\t}";
+ protected final String TEXT_121 = NL + "\t\t}";
+ protected final String TEXT_122 = NL + "\t}";
+ protected final String TEXT_123 = NL + "}" + NL + "" + NL + "/**" + NL + " *@generated" + NL + " */" + NL + "private void storeFeatureModelFacetLinks(";
+ protected final String TEXT_124 = " container, ";
+ protected final String TEXT_125 = " containerMetaclass, Diagram diagram) {";
+ protected final String TEXT_126 = NL;
+ protected final String TEXT_127 = "\tif (";
+ protected final String TEXT_128 = ".eINSTANCE.get";
+ protected final String TEXT_129 = "().isSuperTypeOf(containerMetaclass)) {";
+ protected final String TEXT_130 = NL + "\t\tfor (";
+ protected final String TEXT_131 = " destinations = ";
+ protected final String TEXT_132 = ".iterator(); destinations.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_133 = " nextDestination = (";
+ protected final String TEXT_134 = ") destinations.next();";
+ protected final String TEXT_135 = NL + "\t\t";
+ protected final String TEXT_136 = " nextDestination = (";
+ protected final String TEXT_137 = ") ";
+ protected final String TEXT_138 = ";";
+ protected final String TEXT_139 = NL + "\t\tint nodeVID = ";
+ protected final String TEXT_140 = ".INSTANCE.getNodeVisualID(diagram, nextDestination, \"\");" + NL + "\t\tif (";
+ protected final String TEXT_141 = " == nodeVID) {";
+ protected final String TEXT_142 = NL + "\t\tmyLinkDescriptors.add(new LinkDescriptor(container, nextDestination, ";
+ protected final String TEXT_143 = ".";
+ protected final String TEXT_144 = ", ";
+ protected final String TEXT_145 = "));";
+ protected final String TEXT_146 = NL + "\t\t";
+ protected final String TEXT_147 = " nextNode = ViewService.createNode(diagram, nextDestination, null, ";
+ protected final String TEXT_148 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\tmyEObject2NodeMap.put(nextDestination, nextNode);" + NL + "\t\tcreate";
+ protected final String TEXT_149 = "Children(nextNode, nextDestination);";
+ protected final String TEXT_150 = NL;
+ protected final String TEXT_151 = NL + "\t\t}";
+ protected final String TEXT_152 = NL + "\t\t}";
+ protected final String TEXT_153 = NL + "\t}";
+ protected final String TEXT_154 = NL;
+ protected final String TEXT_155 = "\tif (";
+ protected final String TEXT_156 = ".eINSTANCE.get";
+ protected final String TEXT_157 = "().isSuperTypeOf(containerMetaclass)) {";
+ protected final String TEXT_158 = NL + "\t\tfor (";
+ protected final String TEXT_159 = " destinations = ";
+ protected final String TEXT_160 = ".iterator(); destinations.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_161 = " nextDestination = (";
+ protected final String TEXT_162 = ") destinations.next();";
+ protected final String TEXT_163 = NL + "\t\t";
+ protected final String TEXT_164 = " nextDestination = (";
+ protected final String TEXT_165 = ") ";
+ protected final String TEXT_166 = ";";
+ protected final String TEXT_167 = NL + "\t\tint nodeVID = ";
+ protected final String TEXT_168 = ".INSTANCE.getNodeVisualID(diagram, nextDestination, \"\");" + NL + "\t\tif (";
+ protected final String TEXT_169 = " == nodeVID) {";
+ protected final String TEXT_170 = NL + "\t\tmyLinkDescriptors.add(new LinkDescriptor(container, nextDestination, ";
+ protected final String TEXT_171 = ".";
+ protected final String TEXT_172 = ", ";
+ protected final String TEXT_173 = "));";
+ protected final String TEXT_174 = NL;
+ protected final String TEXT_175 = NL + "\t\t}";
+ protected final String TEXT_176 = NL + "\t\t}";
+ protected final String TEXT_177 = NL + "\t}";
+ protected final String TEXT_178 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void createLinks(";
+ protected final String TEXT_179 = " diagram) {" + NL + "\tfor (";
+ protected final String TEXT_180 = " it = myLinkDescriptors.iterator(); it.hasNext();) {" + NL + "\t\tLinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();" + NL + "\t\t";
+ protected final String TEXT_181 = " edge = (";
+ protected final String TEXT_182 = ") ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), diagram, \"\", ";
+ protected final String TEXT_183 = ".APPEND, ";
+ protected final String TEXT_184 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\tif (edge != null) {" + NL + "\t\t\tedge.setSource((";
+ protected final String TEXT_185 = ") myEObject2NodeMap.get(nextLinkDescriptor.getSource()));" + NL + "\t\t\tedge.setTarget((";
+ protected final String TEXT_186 = ") myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));" + NL + "\t\t}" + NL + "\t}" + NL + "}" + NL;
+ protected final String TEXT_187 = NL;
+ protected final String TEXT_188 = "/**" + NL + " * @generated" + NL + " */" + NL + "private class LinkDescriptor {" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_189 = " mySource;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_190 = " myDestination;" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_191 = " myLinkElement;" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate int myVisualID;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_192 = " mySemanticAdapter;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor(";
+ protected final String TEXT_193 = " source, ";
+ protected final String TEXT_194 = " destination, ";
+ protected final String TEXT_195 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t\tmySemanticAdapter = new ";
+ protected final String TEXT_196 = "(linkElement);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor(";
+ protected final String TEXT_197 = " source, ";
+ protected final String TEXT_198 = " destination, ";
+ protected final String TEXT_199 = " elementType, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = null;" + NL + "\t\tfinal ";
+ protected final String TEXT_200 = " elementTypeCopy = elementType;" + NL + "\t\tmySemanticAdapter = new ";
+ protected final String TEXT_201 = "() {" + NL + "\t\t\tpublic Object getAdapter(Class adapter) {" + NL + "\t\t\t\tif (";
+ protected final String TEXT_202 = ".class.equals(adapter)) {" + NL + "\t\t\t\t\treturn elementTypeCopy;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor(";
+ protected final String TEXT_203 = " source, ";
+ protected final String TEXT_204 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_205 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_206 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_207 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_208 = " getSemanticAdapter() {" + NL + "\t\treturn mySemanticAdapter;" + NL + "\t}" + NL + "}";
+ protected final String TEXT_209 = "\t" + NL + "" + NL + "}";
protected final String getFeatureValueGetter(String containerName, GenFeature feature, boolean isContainerEObject, ImportAssistant importManager) {
StringBuffer result = new StringBuffer();
@@ -264,7 +328,7 @@ public class NewDiagramFileWizardGenerator {
StringBuffer stringBuffer = new StringBuffer();
// TODO: move this attribute to the genmodel
-final boolean isSynchronizedDiagram = false;
+final boolean isSynchronizedDiagram = true;
final GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
@@ -362,6 +426,8 @@ if (!isSynchronizedDiagram) {
List genLinks = genDiagram.getLinks();
+ stringBuffer.append(TEXT_25);
+
// Collecting all phantom elements
Map genClass2Phantom = new LinkedHashMap();
for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
@@ -373,55 +439,44 @@ for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevel
genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
}
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_25);
- stringBuffer.append(nextLink.getVisualID());
stringBuffer.append(TEXT_26);
- stringBuffer.append(nextLink.getVisualID());
+ stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_27);
-
-}
-
+ stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
stringBuffer.append(TEXT_28);
stringBuffer.append(importManager.getImportedName("java.util.Map"));
stringBuffer.append(TEXT_29);
stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
stringBuffer.append(TEXT_30);
- stringBuffer.append(importManager.getImportedName("java.util.Map"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
stringBuffer.append(TEXT_31);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_32);
-
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
-
+ stringBuffer.append(genDiagram.getUniqueIdentifier());
stringBuffer.append(TEXT_33);
- stringBuffer.append(nextLink.getVisualID());
stringBuffer.append(TEXT_34);
-}
+if (!genClass2Phantom.isEmpty()) {
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
stringBuffer.append(TEXT_35);
- stringBuffer.append(genDiagram.getUniqueIdentifier());
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_36);
-
-if (!genClass2Phantom.isEmpty()) {
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_37);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_38);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
stringBuffer.append(TEXT_39);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_40);
+ }
for (Iterator phantoms = genClass2Phantom.values().iterator(); phantoms.hasNext();) {
GenTopLevelNode phantomNode = (GenTopLevelNode) phantoms.next();
- stringBuffer.append(TEXT_41);
+ stringBuffer.append(TEXT_40);
stringBuffer.append(phantomNode.getVisualID());
+ stringBuffer.append(TEXT_41);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
stringBuffer.append(TEXT_42);
stringBuffer.append(pluginActivatorClass);
stringBuffer.append(TEXT_43);
@@ -432,124 +487,141 @@ if (!genClass2Phantom.isEmpty()) {
stringBuffer.append(TEXT_45);
-}
-// TODO: remove "createLinks()" method - this task should be done by canonicalEditPolicies
+if (!genClass2Phantom.isEmpty()) {
stringBuffer.append(TEXT_46);
+ }
+
+// TODO: remove "createLinks()" method - this task should be done by canonicalEditPolicies
+
+ stringBuffer.append(TEXT_47);
boolean generateGetCompartment = false;
for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.hasNext();) {
GenContainerBase nextContainer = (GenContainerBase) containers.next();
- stringBuffer.append(TEXT_47);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
stringBuffer.append(TEXT_48);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(nextContainer.getUniqueIdentifier());
stringBuffer.append(TEXT_49);
-
- if (nextContainer.getContainedNodes().size() > 0) {
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_50);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_51);
-
- } else if (nextContainer instanceof GenNode && ((GenNode) nextContainer).getCompartments().size() > 0) {
-
+ {
+ List genNodes = nextContainer.getContainedNodes();
+ for (int nodeIndex = 0; nodeIndex < genNodes.size(); nodeIndex++) {
stringBuffer.append(TEXT_52);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_53);
- }
+GenNode nextNode = (GenNode) genNodes.get(nodeIndex);
+TypeModelFacet typeModelFacet = nextNode.getModelFacet();
+if (typeModelFacet.isPhantomElement()) {
+// Skipping top-level phantoms
+ continue;
+}
+GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- for (Iterator children = nextContainer.getContainedNodes().iterator(); children.hasNext();) {
- GenNode nextChild = (GenNode) children.next();
- TypeModelFacet typeModelFacet = nextChild.getModelFacet();
- if (typeModelFacet.isPhantomElement()) {
-// Skipping top-leve phantoms
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (childMetaFeature.isListType()) {
+if (nodeIndex == 0) {
+ stringBuffer.append(TEXT_53);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_54);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_55);
- stringBuffer.append(getFeatureValueGetter("modelObject", childMetaFeature, true, importManager));
- stringBuffer.append(TEXT_56);
- } else {
+}
- stringBuffer.append(TEXT_57);
+if (childMetaFeature.isListType()) {
+
+ stringBuffer.append(TEXT_55);
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_56);
stringBuffer.append(getFeatureValueGetter("modelObject", childMetaFeature, true, importManager));
+ stringBuffer.append(TEXT_57);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_58);
-
- }
-
+ } else {
stringBuffer.append(TEXT_59);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(getFeatureValueGetter("modelObject", childMetaFeature, true, importManager));
stringBuffer.append(TEXT_60);
- stringBuffer.append(nextChild.getVisualID());
+ }
stringBuffer.append(TEXT_61);
- stringBuffer.append(pluginActivatorClass);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
stringBuffer.append(TEXT_62);
- stringBuffer.append(nextChild.getUniqueIdentifier());
+ stringBuffer.append(nextNode.getVisualID());
stringBuffer.append(TEXT_63);
-
- if (childMetaFeature.isListType()) {
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
stringBuffer.append(TEXT_64);
-
- }
+ stringBuffer.append(pluginActivatorClass);
+ stringBuffer.append(TEXT_65);
+ stringBuffer.append(nextNode.getUniqueIdentifier());
+ stringBuffer.append(TEXT_66);
+ stringBuffer.append(TEXT_67);
+ stringBuffer.append(TEXT_68);
+ if (childMetaFeature.isListType()) {
+ stringBuffer.append(TEXT_69);
+ }
+ }
}
-
+
if (nextContainer instanceof GenNode) {
GenNode nextNode = (GenNode) nextContainer;
- for (Iterator compartments = nextNode.getCompartments().iterator(); compartments.hasNext();) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
+ for (int i = 0; i < nextNode.getCompartments().size(); i++) {
generateGetCompartment = true;
+ GenCompartment nextCompartment = (GenCompartment) nextNode.getCompartments().get(i);
+ String semanticHintsClassName = importManager.getImportedName(genDiagram.getSemanticHintsQualifiedClassName());
+ String compartmentViewId = semanticHintsClassName + '.' + nextNode.getUniqueIdentifier() + "Compartments." + nextCompartment.getSemanticHintFieldName();
- stringBuffer.append(TEXT_65);
- stringBuffer.append(nextCompartment.getTitle());
- stringBuffer.append(TEXT_66);
+ stringBuffer.append(TEXT_70);
+ stringBuffer.append(i == 0 ? importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node") : "");
+ stringBuffer.append(TEXT_71);
+ stringBuffer.append(compartmentViewId);
+ stringBuffer.append(TEXT_72);
stringBuffer.append(nextCompartment.getUniqueIdentifier());
- stringBuffer.append(TEXT_67);
+ stringBuffer.append(TEXT_73);
}
}
if (false == nextContainer instanceof GenCompartment) {
- stringBuffer.append(TEXT_68);
+ stringBuffer.append(TEXT_74);
}
- stringBuffer.append(TEXT_69);
+ stringBuffer.append(TEXT_75);
}
if (generateGetCompartment) {
- stringBuffer.append(TEXT_70);
+ stringBuffer.append(TEXT_76);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_71);
+ stringBuffer.append(TEXT_77);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_72);
+ stringBuffer.append(TEXT_78);
stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_73);
+ stringBuffer.append(TEXT_79);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_74);
+ stringBuffer.append(TEXT_80);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_75);
+ stringBuffer.append(TEXT_81);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_76);
+ stringBuffer.append(TEXT_82);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_77);
+ stringBuffer.append(TEXT_83);
}
- stringBuffer.append(TEXT_78);
+ stringBuffer.append(TEXT_84);
+ boolean createPhantoms = true;
+ stringBuffer.append(TEXT_85);
+ stringBuffer.append(TEXT_86);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_87);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
+ stringBuffer.append(TEXT_88);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
- stringBuffer.append(TEXT_79);
+ stringBuffer.append(TEXT_89);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_90);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
- stringBuffer.append(TEXT_80);
+ stringBuffer.append(TEXT_91);
for (Iterator it = genLinks.iterator(); it.hasNext();) {
GenLink nextLink = (GenLink) it.next();
@@ -557,161 +629,284 @@ for (Iterator it = genLinks.iterator(); it.hasNext();) {
TypeLinkModelFacet typeLinkModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
GenFeature childMetaFeature = typeLinkModelFacet.getChildMetaFeature();
- stringBuffer.append(TEXT_81);
+ stringBuffer.append(TEXT_92);
stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_82);
+ stringBuffer.append(TEXT_93);
stringBuffer.append(childMetaFeature.getGenClass().getClassifierAccessorName());
- stringBuffer.append(TEXT_83);
+ stringBuffer.append(TEXT_94);
if (childMetaFeature.isListType()) {
- stringBuffer.append(TEXT_84);
+ stringBuffer.append(TEXT_95);
stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_85);
+ stringBuffer.append(TEXT_96);
stringBuffer.append(getFeatureValueGetter("container", childMetaFeature, true, importManager));
- stringBuffer.append(TEXT_86);
+ stringBuffer.append(TEXT_97);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_98);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_99);
} else {
- stringBuffer.append(TEXT_87);
+ stringBuffer.append(TEXT_100);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_101);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_102);
stringBuffer.append(getFeatureValueGetter("container", childMetaFeature, true, importManager));
- stringBuffer.append(TEXT_88);
+ stringBuffer.append(TEXT_103);
}
- stringBuffer.append(TEXT_89);
+ stringBuffer.append(TEXT_104);
stringBuffer.append(getFeatureValueGetter("nextValue", typeLinkModelFacet.getTargetMetaFeature(), true, importManager));
- stringBuffer.append(TEXT_90);
+ stringBuffer.append(TEXT_105);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_106);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_107);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_108);
if (typeLinkModelFacet.getSourceMetaFeature() != null) {
- stringBuffer.append(TEXT_91);
+ stringBuffer.append(TEXT_109);
stringBuffer.append(getFeatureValueGetter("nextValue", typeLinkModelFacet.getSourceMetaFeature(), true, importManager));
- stringBuffer.append(TEXT_92);
+ stringBuffer.append(TEXT_110);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_111);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_112);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_113);
} else {
- stringBuffer.append(TEXT_93);
+ stringBuffer.append(TEXT_114);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_115);
}
- stringBuffer.append(TEXT_94);
+ stringBuffer.append(TEXT_116);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_95);
- stringBuffer.append(nextLink.getVisualID());
- stringBuffer.append(TEXT_96);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_97);
+ stringBuffer.append(TEXT_117);
stringBuffer.append(nextLink.getVisualID());
- stringBuffer.append(TEXT_98);
+ stringBuffer.append(TEXT_118);
if (typeLinkModelFacet.getSourceMetaFeature() != null) {
- stringBuffer.append(TEXT_99);
+ stringBuffer.append(TEXT_119);
}
- stringBuffer.append(TEXT_100);
+ stringBuffer.append(TEXT_120);
if (childMetaFeature.isListType()) {
- stringBuffer.append(TEXT_101);
+ stringBuffer.append(TEXT_121);
}
- stringBuffer.append(TEXT_102);
+ stringBuffer.append(TEXT_122);
}
}
- stringBuffer.append(TEXT_103);
+ stringBuffer.append(TEXT_123);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_124);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
- stringBuffer.append(TEXT_104);
+ stringBuffer.append(TEXT_125);
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
- if (nextLink.getModelFacet() instanceof FeatureModelFacet) {
- FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
- GenFeature genFeature = linkFMF.getMetaFeature();
- GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
+for (int linkIndex = 0; linkIndex < genLinks.size(); linkIndex++) {
+ boolean phantomsOnly = true;
- stringBuffer.append(TEXT_105);
+ stringBuffer.append(TEXT_126);
+
+GenLink nextLink = (GenLink) genLinks.get(linkIndex);
+if (false == nextLink.getModelFacet() instanceof FeatureModelFacet) {
+ continue;
+}
+FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
+GenFeature genFeature = linkFMF.getMetaFeature();
+GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
+if (phantomsOnly ? (!genFeature.isContains() || phantomNode == null) : (genFeature.isContains())) {
+// Processing only features which are isPhantoms == phantomsOnly
+ continue;
+}
+
+ stringBuffer.append(TEXT_127);
stringBuffer.append(importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_106);
+ stringBuffer.append(TEXT_128);
stringBuffer.append(genFeature.getGenClass().getClassifierAccessorName());
- stringBuffer.append(TEXT_107);
- if (genFeature.isListType()) {
- stringBuffer.append(TEXT_108);
+ stringBuffer.append(TEXT_129);
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_130);
stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_109);
- stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
- stringBuffer.append(TEXT_110);
- } else {
- stringBuffer.append(TEXT_111);
+ stringBuffer.append(TEXT_131);
stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
- stringBuffer.append(TEXT_112);
+ stringBuffer.append(TEXT_132);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_133);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_134);
+ } else {
+ stringBuffer.append(TEXT_135);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_136);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_137);
stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
- stringBuffer.append(TEXT_113);
- }
- stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_115);
- stringBuffer.append(nextLink.getVisualID());
- stringBuffer.append(TEXT_116);
- stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
- stringBuffer.append(TEXT_117);
- stringBuffer.append(nextLink.getUniqueIdentifier());
- stringBuffer.append(TEXT_118);
- if (genFeature.isContains() && phantomNode != null) {
- stringBuffer.append(TEXT_119);
+ stringBuffer.append(TEXT_138);
+ }
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_139);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_120);
+ stringBuffer.append(TEXT_140);
stringBuffer.append(phantomNode.getVisualID());
- stringBuffer.append(TEXT_121);
+ stringBuffer.append(TEXT_141);
+ }
+ stringBuffer.append(TEXT_142);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
+ stringBuffer.append(TEXT_143);
+ stringBuffer.append(nextLink.getUniqueIdentifier());
+ stringBuffer.append(TEXT_144);
+ stringBuffer.append(nextLink.getVisualID());
+ stringBuffer.append(TEXT_145);
+ if (createPhantoms) {
+ stringBuffer.append(TEXT_146);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_122);
+ stringBuffer.append(TEXT_147);
stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_123);
+ stringBuffer.append(TEXT_148);
stringBuffer.append(phantomNode.getUniqueIdentifier());
- stringBuffer.append(TEXT_124);
- }
- stringBuffer.append(TEXT_125);
+ stringBuffer.append(TEXT_149);
+ }
+ stringBuffer.append(TEXT_150);
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_151);
+ }
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_152);
+ }
+ stringBuffer.append(TEXT_153);
- }
}
- stringBuffer.append(TEXT_126);
-
-if (genLinks.size() > 0) {
+for (int linkIndex = 0; linkIndex < genLinks.size(); linkIndex++) {
+ boolean phantomsOnly = false;
- stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_128);
+ stringBuffer.append(TEXT_154);
+GenLink nextLink = (GenLink) genLinks.get(linkIndex);
+if (false == nextLink.getModelFacet() instanceof FeatureModelFacet) {
+ continue;
+}
+FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
+GenFeature genFeature = linkFMF.getMetaFeature();
+GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
+if (phantomsOnly ? (!genFeature.isContains() || phantomNode == null) : (genFeature.isContains())) {
+// Processing only features which are isPhantoms == phantomsOnly
+ continue;
}
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_130);
+ stringBuffer.append(TEXT_155);
+ stringBuffer.append(importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName()));
+ stringBuffer.append(TEXT_156);
+ stringBuffer.append(genFeature.getGenClass().getClassifierAccessorName());
+ stringBuffer.append(TEXT_157);
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_158);
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_159);
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
+ stringBuffer.append(TEXT_160);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_161);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_162);
+ } else {
+ stringBuffer.append(TEXT_163);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_164);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_165);
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
+ stringBuffer.append(TEXT_166);
+ }
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_167);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(TEXT_168);
+ stringBuffer.append(phantomNode.getVisualID());
+ stringBuffer.append(TEXT_169);
+ }
+ stringBuffer.append(TEXT_170);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
+ stringBuffer.append(TEXT_171);
+ stringBuffer.append(nextLink.getUniqueIdentifier());
+ stringBuffer.append(TEXT_172);
stringBuffer.append(nextLink.getVisualID());
- stringBuffer.append(TEXT_131);
+ stringBuffer.append(TEXT_173);
+ stringBuffer.append(TEXT_174);
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_175);
+ }
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_176);
+ }
+ stringBuffer.append(TEXT_177);
+ }
+ stringBuffer.append(TEXT_178);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
+ stringBuffer.append(TEXT_179);
stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_132);
+ stringBuffer.append(TEXT_180);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_133);
+ stringBuffer.append(TEXT_181);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_134);
+ stringBuffer.append(TEXT_182);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
- stringBuffer.append(TEXT_135);
+ stringBuffer.append(TEXT_183);
stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_136);
+ stringBuffer.append(TEXT_184);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_137);
+ stringBuffer.append(TEXT_185);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_138);
-
-}
-
- stringBuffer.append(TEXT_139);
+ stringBuffer.append(TEXT_186);
+ stringBuffer.append(TEXT_187);
+
+// an inner class
+
+ stringBuffer.append(TEXT_188);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_189);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_190);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_191);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(TEXT_192);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_193);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_194);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_195);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter"));
- stringBuffer.append(TEXT_140);
+ stringBuffer.append(TEXT_196);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_197);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_198);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
- stringBuffer.append(TEXT_141);
+ stringBuffer.append(TEXT_199);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
- stringBuffer.append(TEXT_142);
+ stringBuffer.append(TEXT_200);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
- stringBuffer.append(TEXT_143);
+ stringBuffer.append(TEXT_201);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
- stringBuffer.append(TEXT_144);
+ stringBuffer.append(TEXT_202);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_203);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_204);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_205);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_206);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_207);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(TEXT_208);
}
- stringBuffer.append(TEXT_145);
+ stringBuffer.append(TEXT_209);
importManager.emitSortedImports();
return stringBuffer.toString();
}
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/PluginGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/PluginGenerator.java
index f8c1e585a..61fc691d6 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/PluginGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/PluginGenerator.java
@@ -27,21 +27,19 @@ public class PluginGenerator
protected final String TEXT_8 = " instance;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ComposedAdapterFactory adapterFactory;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
protected final String TEXT_9 = "() {" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void start(BundleContext context) throws Exception {" + NL + "\t\tsuper.start(context);" + NL + "\t\tinstance = this;" + NL + "\t\tPreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());";
protected final String TEXT_10 = NL + "\t\t";
- protected final String TEXT_11 = ".register(new ";
- protected final String TEXT_12 = "());" + NL + "\t\t";
- protected final String TEXT_13 = ".register(";
- protected final String TEXT_14 = ".eINSTANCE, ";
- protected final String TEXT_15 = ".INSTANCE);";
- protected final String TEXT_16 = NL + "\t\t";
- protected final String TEXT_17 = ".register();" + NL + "\t\tadapterFactory = createAdapterFactory();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void stop(BundleContext context) throws Exception {" + NL + "\t\tadapterFactory.dispose();" + NL + "\t\tadapterFactory = null;" + NL + "\t\tinstance = null;" + NL + "\t\tsuper.stop(context);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static ";
- protected final String TEXT_18 = " getInstance() {" + NL + "\t\treturn instance;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ComposedAdapterFactory createAdapterFactory() {" + NL + "\t\tList factories = new ArrayList();" + NL + "\t\tfillItemProviderFactories(factories);" + NL + "\t\treturn new ComposedAdapterFactory(factories);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void fillItemProviderFactories(List factories) {";
- protected final String TEXT_19 = NL + "\t\tfactories.add(new ";
- protected final String TEXT_20 = "());";
- protected final String TEXT_21 = NL + "\t\tfactories.add(new ResourceItemProviderAdapterFactory());" + NL + "\t\tfactories.add(new ReflectiveItemProviderAdapterFactory());" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getItemProvidersAdapterFactory() {" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ImageDescriptor getItemImageDescriptor(Object item) {" + NL + "\t\tIItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(item, IItemLabelProvider.class);" + NL + "\t\tif (labelProvider != null) {";
- protected final String TEXT_22 = NL + "\t\t\treturn ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns an image descriptor for the image file at the given" + NL + "\t * plug-in relative path." + NL + "\t *" + NL + "\t * @generated" + NL + "\t * @param path the path" + NL + "\t * @return the image descriptor" + NL + "\t */" + NL + "\tpublic static ImageDescriptor getBundledImageDescriptor(String path) {" + NL + "\t\treturn AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Returns an image for the image file at the given plug-in relative path." + NL + "\t * Client do not need to dispose this image. Images will be disposed automatically." + NL + "\t *" + NL + "\t * @generated" + NL + "\t * @param path the path" + NL + "\t * @return image instance" + NL + "\t */" + NL + "\tpublic Image getBundledImage(String path) {" + NL + "\t\tImage image = getImageRegistry().get(path);" + NL + "\t\tif (image == null) {" + NL + "\t\t\tgetImageRegistry().put(path, getBundledImageDescriptor(path));" + NL + "\t\t\timage = getImageRegistry().get(path);" + NL + "\t\t}" + NL + "\t\treturn image;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logError(String error) {" + NL + "\t\tlogError(error, null);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @param throwable actual error or null could be passed" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logError(String error, Throwable throwable) {" + NL + "\t\tif (error == null && throwable != null) {" + NL + "\t\t\terror = throwable.getMessage();" + NL + "\t\t}" + NL + "\t\tgetLog().log(new Status(IStatus.ERROR, ";
- protected final String TEXT_23 = ".ID, IStatus.OK, error, throwable));" + NL + "\t\tdebug(error, throwable);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logInfo(String message) {" + NL + "\t\tlogInfo(message, null);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @param throwable actual error or null could be passed" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logInfo(String message, Throwable throwable) {" + NL + "\t\tif (message == null && message != null) {" + NL + "\t\t\tmessage = throwable.getMessage();" + NL + "\t\t}" + NL + "\t\tgetLog().log(new Status(IStatus.INFO, ";
- protected final String TEXT_24 = ".ID, IStatus.OK, message, throwable));" + NL + "\t\tdebug(message, throwable);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void debug(String message, Throwable throwable) {" + NL + "\t\tif (!isDebugging()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (message != null) {" + NL + "\t\t\tSystem.err.println(message);" + NL + "\t\t}" + NL + "\t\tif (throwable != null) {" + NL + "\t\t\tthrowable.printStackTrace();" + NL + "\t\t}" + NL + "\t}" + NL + "\t" + NL + "}";
- protected final String TEXT_25 = NL;
+ protected final String TEXT_11 = ".register(";
+ protected final String TEXT_12 = ".eINSTANCE, ";
+ protected final String TEXT_13 = ".INSTANCE);";
+ protected final String TEXT_14 = NL + "\t\t";
+ protected final String TEXT_15 = ".register();" + NL + "\t\tadapterFactory = createAdapterFactory();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void stop(BundleContext context) throws Exception {" + NL + "\t\tadapterFactory.dispose();" + NL + "\t\tadapterFactory = null;" + NL + "\t\tinstance = null;" + NL + "\t\tsuper.stop(context);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static ";
+ protected final String TEXT_16 = " getInstance() {" + NL + "\t\treturn instance;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ComposedAdapterFactory createAdapterFactory() {" + NL + "\t\tList factories = new ArrayList();" + NL + "\t\tfillItemProviderFactories(factories);" + NL + "\t\treturn new ComposedAdapterFactory(factories);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void fillItemProviderFactories(List factories) {";
+ protected final String TEXT_17 = NL + "\t\tfactories.add(new ";
+ protected final String TEXT_18 = "());";
+ protected final String TEXT_19 = NL + "\t\tfactories.add(new ResourceItemProviderAdapterFactory());" + NL + "\t\tfactories.add(new ReflectiveItemProviderAdapterFactory());" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getItemProvidersAdapterFactory() {" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ImageDescriptor getItemImageDescriptor(Object item) {" + NL + "\t\tIItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory.adapt(item, IItemLabelProvider.class);" + NL + "\t\tif (labelProvider != null) {";
+ protected final String TEXT_20 = NL + "\t\t\treturn ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns an image descriptor for the image file at the given" + NL + "\t * plug-in relative path." + NL + "\t *" + NL + "\t * @generated" + NL + "\t * @param path the path" + NL + "\t * @return the image descriptor" + NL + "\t */" + NL + "\tpublic static ImageDescriptor getBundledImageDescriptor(String path) {" + NL + "\t\treturn AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Returns an image for the image file at the given plug-in relative path." + NL + "\t * Client do not need to dispose this image. Images will be disposed automatically." + NL + "\t *" + NL + "\t * @generated" + NL + "\t * @param path the path" + NL + "\t * @return image instance" + NL + "\t */" + NL + "\tpublic Image getBundledImage(String path) {" + NL + "\t\tImage image = getImageRegistry().get(path);" + NL + "\t\tif (image == null) {" + NL + "\t\t\tgetImageRegistry().put(path, getBundledImageDescriptor(path));" + NL + "\t\t\timage = getImageRegistry().get(path);" + NL + "\t\t}" + NL + "\t\treturn image;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logError(String error) {" + NL + "\t\tlogError(error, null);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @param throwable actual error or null could be passed" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logError(String error, Throwable throwable) {" + NL + "\t\tif (error == null && throwable != null) {" + NL + "\t\t\terror = throwable.getMessage();" + NL + "\t\t}" + NL + "\t\tgetLog().log(new Status(IStatus.ERROR, ";
+ protected final String TEXT_21 = ".ID, IStatus.OK, error, throwable));" + NL + "\t\tdebug(error, throwable);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logInfo(String message) {" + NL + "\t\tlogInfo(message, null);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @param throwable actual error or null could be passed" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void logInfo(String message, Throwable throwable) {" + NL + "\t\tif (message == null && message != null) {" + NL + "\t\t\tmessage = throwable.getMessage();" + NL + "\t\t}" + NL + "\t\tgetLog().log(new Status(IStatus.INFO, ";
+ protected final String TEXT_22 = ".ID, IStatus.OK, message, throwable));" + NL + "\t\tdebug(message, throwable);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void debug(String message, Throwable throwable) {" + NL + "\t\tif (!isDebugging()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (message != null) {" + NL + "\t\t\tSystem.err.println(message);" + NL + "\t\t}" + NL + "\t\tif (throwable != null) {" + NL + "\t\t\tthrowable.printStackTrace();" + NL + "\t\t}" + NL + "\t}" + NL + "\t" + NL + "}";
+ protected final String TEXT_23 = NL;
public String generate(Object argument)
{
@@ -76,47 +74,42 @@ if (copyrightText != null && copyrightText.trim().length() > 0) {
for (int i = 0; i < genPackages.size(); i++) {
GenPackage genPackage = (GenPackage) genPackages.get(i);
- String domainPackageIPAFInterfaceName = importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName());
String domainPackageInterfaceName = importManager.getImportedName(genPackage.getQualifiedPackageInterfaceName());
String domainPackageEditPluginClassName = importManager.getImportedName(genPackage.getQualifiedEditPluginClassName());
stringBuffer.append(TEXT_10);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager"));
- stringBuffer.append(TEXT_11);
- stringBuffer.append(domainPackageIPAFInterfaceName);
- stringBuffer.append(TEXT_12);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.internal.util.MetamodelManager"));
- stringBuffer.append(TEXT_13);
+ stringBuffer.append(TEXT_11);
stringBuffer.append(domainPackageInterfaceName);
- stringBuffer.append(TEXT_14);
+ stringBuffer.append(TEXT_12);
stringBuffer.append(domainPackageEditPluginClassName);
- stringBuffer.append(TEXT_15);
+ stringBuffer.append(TEXT_13);
}
- stringBuffer.append(TEXT_16);
+ stringBuffer.append(TEXT_14);
stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
- stringBuffer.append(TEXT_17);
+ stringBuffer.append(TEXT_15);
stringBuffer.append(genPlugin.getActivatorClassName());
- stringBuffer.append(TEXT_18);
+ stringBuffer.append(TEXT_16);
for (int i = 0; i < genPackages.size(); i++) {
GenPackage genPackage = (GenPackage) genPackages.get(i);
- stringBuffer.append(TEXT_19);
+ stringBuffer.append(TEXT_17);
stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName()));
- stringBuffer.append(TEXT_20);
+ stringBuffer.append(TEXT_18);
}
- stringBuffer.append(TEXT_21);
+ stringBuffer.append(TEXT_19);
// XXX dependency org.eclipse.emf.edit.ui is for ExtendedImageRegistry only.
// FIXME move image registry to plugin class code
- stringBuffer.append(TEXT_22);
+ stringBuffer.append(TEXT_20);
stringBuffer.append(genPlugin.getActivatorClassName());
- stringBuffer.append(TEXT_23);
+ stringBuffer.append(TEXT_21);
stringBuffer.append(genPlugin.getActivatorClassName());
- stringBuffer.append(TEXT_24);
+ stringBuffer.append(TEXT_22);
importManager.emitSortedImports();
- stringBuffer.append(TEXT_25);
+ stringBuffer.append(TEXT_23);
return stringBuffer.toString();
}
}
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/ChildContainerCanonicalEditPolicyGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/ChildContainerCanonicalEditPolicyGenerator.java
index b66137b7f..0e3c9e193 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/ChildContainerCanonicalEditPolicyGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/ChildContainerCanonicalEditPolicyGenerator.java
@@ -24,125 +24,113 @@ public class ChildContainerCanonicalEditPolicyGenerator {
protected final String TEXT_5 = ";" + NL;
protected final String TEXT_6 = NL + "import org.eclipse.core.runtime.IAdaptable;" + NL + "import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;" + NL + "import org.eclipse.gmf.runtime.notation.View;";
protected final String TEXT_7 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_8 = " extends CanonicalEditPolicy {";
+ protected final String TEXT_8 = " extends CanonicalEditPolicy {" + NL;
protected final String TEXT_9 = NL;
- protected final String TEXT_10 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_11 = " getSemanticChildrenList() {" + NL + "\t\t\tList result = new ";
- protected final String TEXT_12 = "();";
- protected final String TEXT_13 = NL + "\t\t\t";
- protected final String TEXT_14 = " modelElement = (";
- protected final String TEXT_15 = ") ((View) getHost().getModel()).getElement();" + NL + "\t\t\t";
- protected final String TEXT_16 = " nextValue;" + NL + "\t\t\tint nodeVID;";
- protected final String TEXT_17 = "\t" + NL + "\t\t\tfor (";
- protected final String TEXT_18 = " it = ";
- protected final String TEXT_19 = ".iterator(); it.hasNext();) {" + NL + "\t\t\t\tnextValue = (";
- protected final String TEXT_20 = ") it.next();";
- protected final String TEXT_21 = NL + "\t\t\tnextValue = ";
- protected final String TEXT_22 = ";";
- protected final String TEXT_23 = NL + "\t\t\tnodeVID = ";
- protected final String TEXT_24 = ".INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, \"\");" + NL + "\t\t\tif (";
- protected final String TEXT_25 = " == nodeVID) {" + NL + "\t\t\t\tresult.add(nextValue);" + NL + "\t\t\t}";
- protected final String TEXT_26 = NL + "\t\t\t}";
- protected final String TEXT_27 = "\t\t\t" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldDeleteView(View view) {" + NL + "\t\t\t";
- protected final String TEXT_28 = " domainModelElement = view.getElement();" + NL + "\t\t\treturn domainModelElement != null && domainModelElement != ((View) getHost().getModel()).getElement() && super.shouldDeleteView(view);" + NL + "\t\t}";
- protected final String TEXT_29 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getFactoryHint(IAdaptable elementAdapter) {" + NL + "\t\treturn \"\";" + NL + "\t}";
- protected final String TEXT_30 = NL;
- protected final String TEXT_31 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected void refreshSemantic() {" + NL + "\tsuper.refreshSemantic();";
- protected final String TEXT_32 = NL + "\trefreshReferenceOnlyConnections();";
- protected final String TEXT_33 = NL + "\trefreshPhantoms();";
- protected final String TEXT_34 = NL + "}";
- protected final String TEXT_35 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private class PhantomLinkInfo {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate EObject myDst;" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate int myIndex;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String myType;" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_36 = " myElementType;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PhantomLinkInfo(EObject dst, int index, String linkType, ";
- protected final String TEXT_37 = " elementType) {" + NL + "\t\tmyDst = dst;" + NL + "\t\tmyIndex = index;" + NL + "\t\tmyType = linkType;" + NL + "\t\tmyElementType = elementType;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PhantomLinkInfo(EObject dst, String linkType, ";
- protected final String TEXT_38 = " elementType) {" + NL + "\t\tthis(dst, 0, linkType, elementType);" + NL + "\t}" + NL + "" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void refreshPhantoms() {" + NL + "\t";
- protected final String TEXT_39 = " phantomNodes = new ";
- protected final String TEXT_40 = "();" + NL + "\t";
- protected final String TEXT_41 = " phantomLinks = new ";
- protected final String TEXT_42 = "();" + NL + "\t";
- protected final String TEXT_43 = " modelElement = (";
- protected final String TEXT_44 = ") ((";
- protected final String TEXT_45 = ") getHost().getModel()).getElement();" + NL + "\t";
- protected final String TEXT_46 = " modelElementMetaclass = modelElement.eClass();" + NL + "\t";
- protected final String TEXT_47 = " eObject2ViewMap = new ";
- protected final String TEXT_48 = "();";
- protected final String TEXT_49 = NL + "\tif (-1 != modelElementMetaclass.getFeatureID(";
- protected final String TEXT_50 = ".eINSTANCE.get";
- protected final String TEXT_51 = "())) {";
- protected final String TEXT_52 = NL + "\t\tint linkIndex = 0;" + NL + "\t\tfor (";
- protected final String TEXT_53 = " values = ";
- protected final String TEXT_54 = ".iterator(); values.hasNext(); linkIndex++) {" + NL + "\t\t\tEObject nextValue = (EObject) values.next();";
- protected final String TEXT_55 = NL + "\t\tEObject nextValue = ";
- protected final String TEXT_56 = ";";
- protected final String TEXT_57 = NL + "\t\tint nodeVID = ";
- protected final String TEXT_58 = ".INSTANCE.getNodeVisualID(getDiagram(), nextValue, \"\");" + NL + "\t\tif (";
- protected final String TEXT_59 = " == nodeVID) {" + NL + "\t\t\tphantomNodes.add(nextValue);" + NL + "\t\t\tphantomLinks.add(new PhantomLinkInfo(nextValue";
- protected final String TEXT_60 = ", linkIndex";
- protected final String TEXT_61 = ", ";
- protected final String TEXT_62 = ".";
- protected final String TEXT_63 = ", ";
- protected final String TEXT_64 = ".";
- protected final String TEXT_65 = "));" + NL + "\t\t}";
- protected final String TEXT_66 = NL + "\t\t}";
- protected final String TEXT_67 = NL + "\t}";
- protected final String TEXT_68 = NL + NL + "\tfor (Iterator resourceObjects = modelElement.eResource().getContents().iterator(); resourceObjects.hasNext();) {" + NL + "\t\tEObject nextResourceEObject = (EObject) resourceObjects.next();" + NL + "\t\tif (nextResourceEObject != modelElement) {" + NL + "\t\t\tphantomNodes.add(nextResourceEObject);" + NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_69 = NL + NL + "\tfor (Iterator diagramNodes = getDiagram().getChildren().iterator(); diagramNodes.hasNext();) {" + NL + "\t\t";
- protected final String TEXT_70 = " nextView = (";
- protected final String TEXT_71 = ") diagramNodes.next();" + NL + "\t\tEObject nextViewElement = nextView.getElement();" + NL + "\t\tif (phantomNodes.contains(nextViewElement)) {" + NL + "\t\t\tphantomNodes.remove(nextViewElement);" + NL + "\t\t\teObject2ViewMap.put(nextViewElement, nextView);" + NL + "\t\t}\t" + NL + "\t}" + NL + "\t" + NL + "\tfor (Iterator diagramEdges = getDiagram().getEdges().iterator(); diagramEdges.hasNext();) {" + NL + "\t\t";
- protected final String TEXT_72 = " nextEdge = (";
- protected final String TEXT_73 = ") diagramEdges.next();" + NL + "\t\tif (nextEdge.getSource().getElement() != modelElement) {" + NL + "\t\t\tcontinue;" + NL + "\t\t}" + NL + "\t\tEObject target = nextEdge.getTarget().getElement();" + NL + "\t\tString linkType = nextEdge.getType();" + NL + "\t\tfor (Iterator linkInfos = phantomLinks.iterator(); linkInfos.hasNext();) {" + NL + "\t\t\tPhantomLinkInfo nextLinkInfo = (PhantomLinkInfo) linkInfos.next();" + NL + "\t\t\tif (nextLinkInfo.myDst == target && nextLinkInfo.myType.equals(linkType)) {" + NL + "\t\t\t\tlinkInfos.remove();" + NL + "\t\t\t\tbreak;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "\t" + NL + "\tcreatePhantomNodes(phantomNodes, eObject2ViewMap);" + NL + "\tcreatePhantomLinks(phantomLinks, eObject2ViewMap);" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void createPhantomNodes(";
- protected final String TEXT_74 = " nodes, ";
- protected final String TEXT_75 = " eObject2ViewMap) {" + NL + "\tif (nodes.isEmpty()) {" + NL + "\t\treturn;" + NL + "\t}" + NL + "\t";
- protected final String TEXT_76 = " descriptors = new ";
- protected final String TEXT_77 = "();" + NL + "\tfor (Iterator elements = nodes.iterator(); elements.hasNext();) {" + NL + "\t\tEObject element = (EObject)elements.next();" + NL + "\t\tCreateViewRequest.ViewDescriptor descriptor = getViewDescriptor(element);" + NL + "\t\tdescriptors.add(descriptor);" + NL + "\t}" + NL + "\t";
- protected final String TEXT_78 = " request = getCreateViewRequest(descriptors);" + NL + "\t";
- protected final String TEXT_79 = " diagramEditPart = getDiagramEditPart();" + NL + "\t";
- protected final String TEXT_80 = " cmd = diagramEditPart.getCommand(request);" + NL + "\tif (cmd == null) {" + NL + "\t\t";
- protected final String TEXT_81 = " cc = new ";
- protected final String TEXT_82 = "(";
- protected final String TEXT_83 = ".AddCommand_Label);" + NL + "\t\tfor (Iterator descriptorsIterator = descriptors.iterator(); descriptorsIterator.hasNext();) {" + NL + "\t\t\t";
- protected final String TEXT_84 = ".ViewDescriptor descriptor = (";
- protected final String TEXT_85 = ".ViewDescriptor) descriptorsIterator.next();" + NL + "\t\t\t";
- protected final String TEXT_86 = " createCommand = new ";
- protected final String TEXT_87 = "(((";
- protected final String TEXT_88 = ") getHost()).getEditingDomain(), descriptor, getDiagram());" + NL + "\t\t\tcc.compose(createCommand);" + NL + "\t\t}" + NL + "\t\tcmd = new ";
- protected final String TEXT_89 = "(cc);" + NL + "\t}\t" + NL + "\t" + NL + "\tif ( cmd != null && cmd.canExecute() ) {" + NL + "\t\t";
- protected final String TEXT_90 = ".makeMutable(new ";
- protected final String TEXT_91 = "(((";
- protected final String TEXT_92 = ") diagramEditPart).getNotationView())).execute();" + NL + "\t\texecuteCommand(cmd);" + NL + "\t\t";
- protected final String TEXT_93 = " adapters = (";
- protected final String TEXT_94 = ") request.getNewObject();" + NL + "\t\tmakeViewsImmutable(adapters);" + NL + "\t\tfor (Iterator viewAdapters = adapters.iterator(); viewAdapters.hasNext();) {" + NL + "\t\t\t";
- protected final String TEXT_95 = " createdView = (";
- protected final String TEXT_96 = ") ((";
- protected final String TEXT_97 = ") viewAdapters.next()).getAdapter(";
- protected final String TEXT_98 = ".class);" + NL + "\t\t\tif (createdView.getElement() != null) {" + NL + "\t\t\t\teObject2ViewMap.put(createdView.getElement(), createdView);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "\tdiagramEditPart.refresh();" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void createPhantomLinks(";
- protected final String TEXT_99 = " linkInfos, ";
- protected final String TEXT_100 = " eObject2ViewMap) {" + NL + "\tif (linkInfos.isEmpty()) {" + NL + "\t\treturn;" + NL + "\t}" + NL + "\tfor (Iterator linkInfoIterator = linkInfos.iterator(); linkInfoIterator.hasNext();) {" + NL + "\t\tfinal PhantomLinkInfo nextLinkInfo = (PhantomLinkInfo) linkInfoIterator.next();" + NL + "\t\t";
- protected final String TEXT_101 = " dstView = (";
- protected final String TEXT_102 = ") eObject2ViewMap.get(nextLinkInfo.myDst);" + NL + "\t\tif (dstView == null) {" + NL + "\t\t\tcontinue;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_103 = " targetEditPart = (";
- protected final String TEXT_104 = ") getHost().getViewer().getEditPartRegistry().get(dstView);\t\t" + NL + "\t\t";
- protected final String TEXT_105 = " sourceEditPart = getHost();" + NL + "\t\tString factoryHint = \"\";" + NL + "\t\t";
- protected final String TEXT_106 = " adapter = new ";
- protected final String TEXT_107 = "() {" + NL + "\t\t\tpublic Object getAdapter(Class adapter) {" + NL + "\t\t\t\tif (";
- protected final String TEXT_108 = ".class.isAssignableFrom(adapter)) {" + NL + "\t\t\t\t\treturn nextLinkInfo.myElementType;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\t" + NL + "\t\t";
- protected final String TEXT_109 = ".ConnectionViewDescriptor descriptor = new ";
- protected final String TEXT_110 = ".ConnectionViewDescriptor(adapter, getFactoryHint(adapter, factoryHint), ";
- protected final String TEXT_111 = ".APPEND, false, ((";
- protected final String TEXT_112 = ") getHost()).getDiagramPreferencesHint());" + NL + "\t\t";
- protected final String TEXT_113 = " ccr = new ";
- protected final String TEXT_114 = "(descriptor);" + NL + "\t\tccr.setType(";
- protected final String TEXT_115 = ".REQ_CONNECTION_START);" + NL + "\t\tccr.setSourceEditPart(sourceEditPart);" + NL + "\t\tsourceEditPart.getCommand(ccr);" + NL + "\t\tccr.setTargetEditPart(targetEditPart);" + NL + "\t\tccr.setType(";
- protected final String TEXT_116 = ".REQ_CONNECTION_END);" + NL + "\t\t";
- protected final String TEXT_117 = " cmd = targetEditPart.getCommand(ccr);" + NL + "\t\tif (cmd != null && cmd.canExecute()) {" + NL + "\t\t\texecuteCommand(cmd);" + NL + "\t\t\t";
- protected final String TEXT_118 = " viewAdapter = (";
- protected final String TEXT_119 = ") ccr.getNewObject();" + NL + "\t\t\t";
- protected final String TEXT_120 = ".makeImmutable(viewAdapter).execute();" + NL + "\t\t}" + NL + "\t}" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_121 = " getDiagram() {" + NL + "\treturn ((View) getHost().getModel()).getDiagram();" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_122 = " getDiagramEditPart() {" + NL + "\treturn (";
- protected final String TEXT_123 = ") getHost().getViewer().getEditPartRegistry().get(getDiagram());" + NL + "}";
- protected final String TEXT_124 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void refreshReferenceOnlyConnections() {" + NL + "// TODO: implement this method" + NL + "}";
- protected final String TEXT_125 = NL + NL + "}";
- protected final String TEXT_126 = NL;
+ protected final String TEXT_10 = "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
+ protected final String TEXT_11 = " getSemanticChildrenList() {" + NL + "\t";
+ protected final String TEXT_12 = " result = new ";
+ protected final String TEXT_13 = "();";
+ protected final String TEXT_14 = NL + "\t";
+ protected final String TEXT_15 = " modelObject = ((";
+ protected final String TEXT_16 = ") getHost().getModel()).getElement();" + NL + "\t";
+ protected final String TEXT_17 = " viewObject = (";
+ protected final String TEXT_18 = ") getHost().getModel();";
+ protected final String TEXT_19 = NL;
+ protected final String TEXT_20 = "\t";
+ protected final String TEXT_21 = " nextValue;" + NL + "\tint nodeVID;";
+ protected final String TEXT_22 = "\tfor (";
+ protected final String TEXT_23 = " values = ";
+ protected final String TEXT_24 = ".iterator(); values.hasNext();) {" + NL + "\t\tnextValue = (";
+ protected final String TEXT_25 = ") values.next();";
+ protected final String TEXT_26 = NL + "\tnextValue = ";
+ protected final String TEXT_27 = ";";
+ protected final String TEXT_28 = NL + "\tnodeVID = ";
+ protected final String TEXT_29 = ".INSTANCE.getNodeVisualID(viewObject, nextValue, \"\");" + NL + "\tif (";
+ protected final String TEXT_30 = " == nodeVID) {" + NL + "\t\tresult.add(nextValue);";
+ protected final String TEXT_31 = NL;
+ protected final String TEXT_32 = "\t}";
+ protected final String TEXT_33 = NL + "\t}";
+ protected final String TEXT_34 = NL + "\treturn result;" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected boolean shouldDeleteView(";
+ protected final String TEXT_35 = " view) {" + NL + "\t";
+ protected final String TEXT_36 = " domainModelElement = view.getElement();" + NL + "\treturn domainModelElement != null && domainModelElement != ((";
+ protected final String TEXT_37 = ") getHost().getModel()).getElement() && super.shouldDeleteView(view);" + NL + "}";
+ protected final String TEXT_38 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_39 = " getSemanticChildrenList() {" + NL + "\t\treturn ";
+ protected final String TEXT_40 = ".EMPTY_LIST;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean shouldDeleteView(View view) {" + NL + "\t\treturn ";
+ protected final String TEXT_41 = ".resolveSemanticElement(view) == null;" + NL + "\t}";
+ protected final String TEXT_42 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getFactoryHint(IAdaptable elementAdapter) {" + NL + "\t\treturn \"\";" + NL + "\t}" + NL + "\t";
+ protected final String TEXT_43 = NL;
+ protected final String TEXT_44 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshSemantic() {" + NL + "\t\tsuper.refreshSemantic();" + NL + "\t\trefreshPhantoms();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void refreshPhantoms() {" + NL + "\t\t";
+ protected final String TEXT_45 = " phantomNodes = new ";
+ protected final String TEXT_46 = "();" + NL + "\t\t";
+ protected final String TEXT_47 = " container = ((";
+ protected final String TEXT_48 = ") getHost().getModel()).getElement();" + NL + "\t\t";
+ protected final String TEXT_49 = " containerMetaclass = container.eClass();" + NL + "\t\t";
+ protected final String TEXT_50 = " diagram = getDiagram();";
+ protected final String TEXT_51 = NL;
+ protected final String TEXT_52 = "\tif (";
+ protected final String TEXT_53 = ".eINSTANCE.get";
+ protected final String TEXT_54 = "().isSuperTypeOf(containerMetaclass)) {";
+ protected final String TEXT_55 = NL + "\t\tfor (";
+ protected final String TEXT_56 = " destinations = ";
+ protected final String TEXT_57 = ".iterator(); destinations.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_58 = " nextDestination = (";
+ protected final String TEXT_59 = ") destinations.next();";
+ protected final String TEXT_60 = NL + "\t\t";
+ protected final String TEXT_61 = " nextDestination = (";
+ protected final String TEXT_62 = ") ";
+ protected final String TEXT_63 = ";";
+ protected final String TEXT_64 = NL + "\t\tint nodeVID = ";
+ protected final String TEXT_65 = ".INSTANCE.getNodeVisualID(diagram, nextDestination, \"\");" + NL + "\t\tif (";
+ protected final String TEXT_66 = " == nodeVID) {";
+ protected final String TEXT_67 = NL + "\t\t\tphantomNodes.add(nextDestination);";
+ protected final String TEXT_68 = NL;
+ protected final String TEXT_69 = NL + "\t\t}";
+ protected final String TEXT_70 = NL + "\t\t}";
+ protected final String TEXT_71 = NL + "\t}";
+ protected final String TEXT_72 = NL;
+ protected final String TEXT_73 = NL;
+ protected final String TEXT_74 = "for (";
+ protected final String TEXT_75 = " diagramNodes = getDiagram().getChildren().iterator(); diagramNodes.hasNext();) {" + NL + "\t";
+ protected final String TEXT_76 = " nextView = (";
+ protected final String TEXT_77 = ") diagramNodes.next();" + NL + "\t";
+ protected final String TEXT_78 = " nextViewElement = nextView.getElement();" + NL + "\tif (phantomNodes.contains(nextViewElement)) {" + NL + "\t\tphantomNodes.remove(nextViewElement);" + NL + "\t}\t" + NL + "}" + NL + "\t\tcreatePhantomNodes(phantomNodes);" + NL + "\t}" + NL + "\t";
+ protected final String TEXT_79 = NL;
+ protected final String TEXT_80 = "/**" + NL + " * @generated" + NL + " */" + NL + "private void createPhantomNodes(";
+ protected final String TEXT_81 = " nodes) {" + NL + "\tif (nodes.isEmpty()) {" + NL + "\t\treturn;" + NL + "\t}" + NL + "\t";
+ protected final String TEXT_82 = " descriptors = new ";
+ protected final String TEXT_83 = "();" + NL + "\tfor (";
+ protected final String TEXT_84 = " elements = nodes.iterator(); elements.hasNext();) {" + NL + "\t\t";
+ protected final String TEXT_85 = " element = (";
+ protected final String TEXT_86 = ")elements.next();" + NL + "\t\t";
+ protected final String TEXT_87 = ".ViewDescriptor descriptor = getViewDescriptor(element);" + NL + "\t\tdescriptors.add(descriptor);" + NL + "\t}" + NL + "\t";
+ protected final String TEXT_88 = " diagram = getDiagram();" + NL + "\t";
+ protected final String TEXT_89 = " diagramEditPart = getDiagramEditPart();" + NL + "\t" + NL + "\t";
+ protected final String TEXT_90 = " request = getCreateViewRequest(descriptors);" + NL + "\t";
+ protected final String TEXT_91 = " cmd = diagramEditPart.getCommand(request);" + NL + "\tif (cmd == null) {" + NL + "\t\t";
+ protected final String TEXT_92 = " cc = new ";
+ protected final String TEXT_93 = "(";
+ protected final String TEXT_94 = ".AddCommand_Label);" + NL + "\t\tfor (";
+ protected final String TEXT_95 = " descriptorsIterator = descriptors.iterator(); descriptorsIterator.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_96 = ".ViewDescriptor descriptor = (";
+ protected final String TEXT_97 = ".ViewDescriptor) descriptorsIterator.next();" + NL + "\t\t\t";
+ protected final String TEXT_98 = " createCommand = new ";
+ protected final String TEXT_99 = "(((";
+ protected final String TEXT_100 = ") getHost()).getEditingDomain(), descriptor, diagram);" + NL + "\t\t\tcc.compose(createCommand);" + NL + "\t\t}" + NL + "\t\tcmd = new ";
+ protected final String TEXT_101 = "(cc);" + NL + "\t}\t" + NL + "\t" + NL + "\tif ( cmd != null && cmd.canExecute() ) {" + NL + "\t\t";
+ protected final String TEXT_102 = ".makeMutable(new ";
+ protected final String TEXT_103 = "(((";
+ protected final String TEXT_104 = ") diagramEditPart).getNotationView())).execute();" + NL + "\t\texecuteCommand(cmd);" + NL + "\t\t";
+ protected final String TEXT_105 = " adapters = (";
+ protected final String TEXT_106 = ") request.getNewObject();" + NL + "\t\tmakeViewsImmutable(adapters);" + NL + "\t}" + NL + "\tdiagramEditPart.refresh();" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
+ protected final String TEXT_107 = " getDiagramEditPart() {" + NL + "\treturn (";
+ protected final String TEXT_108 = ") getHost().getViewer().getEditPartRegistry().get(getDiagram());" + NL + "}" + NL;
+ protected final String TEXT_109 = NL;
+ protected final String TEXT_110 = "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
+ protected final String TEXT_111 = " getDiagram() {" + NL + "\treturn ((";
+ protected final String TEXT_112 = ") getHost().getModel()).getDiagram();" + NL + "}";
+ protected final String TEXT_113 = NL + NL + "}";
+ protected final String TEXT_114 = NL;
protected final String getFeatureValueGetter(String containerName, GenFeature feature, boolean isContainerEObject, ImportAssistant importManager) {
StringBuffer result = new StringBuffer();
@@ -244,6 +232,9 @@ public class ChildContainerCanonicalEditPolicyGenerator {
{
StringBuffer stringBuffer = new StringBuffer();
+// TODO: move this attribute to the genmodel
+final boolean isSynchronizedDiagram = true;
+
GenChildContainer genContainer = (GenChildContainer) ((Object[]) argument)[0];
GenDiagram genDiagram = genContainer.getDiagram();
@@ -266,352 +257,274 @@ if (copyrightText != null && copyrightText.trim().length() > 0) {
stringBuffer.append(genContainer.getCanonicalEditPolicyClassName());
stringBuffer.append(TEXT_8);
-{
- Collection genNodes = genContainer.getChildNodes();
- GenNode containerNode;
- if (genContainer instanceof GenCompartment) {
- containerNode = ((GenCompartment) genContainer).getNode();
- } else if (genContainer instanceof GenNode) {
- containerNode = (GenNode) genContainer;
- } else {
- throw new IllegalArgumentException(String.valueOf(genContainer));
- }
- GenClass modelElementInterface = containerNode.getModelFacet().getMetaClass();
+if (isSynchronizedDiagram) {
+ List genNodes = genContainer.getChildNodes();
stringBuffer.append(TEXT_9);
stringBuffer.append(TEXT_10);
stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_11);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_12);
+ stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ stringBuffer.append(TEXT_13);
-if (genNodes.size() > 0) {
- String modelElementInterfaceName = importManager.getImportedName(modelElementInterface.getQualifiedInterfaceName());
+for (int nodeIndex = 0; nodeIndex < genNodes.size(); nodeIndex++) {
+ if (nodeIndex == 0) {
- stringBuffer.append(TEXT_13);
- stringBuffer.append(modelElementInterfaceName);
stringBuffer.append(TEXT_14);
- stringBuffer.append(modelElementInterfaceName);
- stringBuffer.append(TEXT_15);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_15);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_16);
-
-}
-
-
-for (Iterator it = genNodes.iterator(); it.hasNext();) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet.isPhantomElement()) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (childMetaFeature.isListType()) {
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_17);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_18);
- stringBuffer.append(getFeatureValueGetter("modelElement", childMetaFeature, false, importManager));
+ }
stringBuffer.append(TEXT_19);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_20);
- } else {
+GenNode nextNode = (GenNode) genNodes.get(nodeIndex);
+TypeModelFacet typeModelFacet = nextNode.getModelFacet();
+if (typeModelFacet.isPhantomElement()) {
+// Skipping top-level phantoms
+ continue;
+}
+GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
+
+if (nodeIndex == 0) {
+ stringBuffer.append(TEXT_20);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_21);
- stringBuffer.append(getFeatureValueGetter("modelElement", childMetaFeature, false, importManager));
- stringBuffer.append(TEXT_22);
- }
+}
+
+if (childMetaFeature.isListType()) {
+ stringBuffer.append(TEXT_22);
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(getFeatureValueGetter("modelObject", childMetaFeature, true, importManager));
stringBuffer.append(TEXT_24);
- stringBuffer.append(nextNode.getVisualID());
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_25);
-
- if (childMetaFeature.isListType()) {
-
+ } else {
stringBuffer.append(TEXT_26);
-
- }
-}
-
+ stringBuffer.append(getFeatureValueGetter("modelObject", childMetaFeature, true, importManager));
stringBuffer.append(TEXT_27);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_28);
}
+ stringBuffer.append(TEXT_28);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
stringBuffer.append(TEXT_29);
-
-if (genContainer instanceof GenNode) {
- GenClass domainMetaclass = ((GenNode) genContainer).getModelFacet().getMetaClass();
- GenContainerBase genContainerBase = genContainer;
-
+ stringBuffer.append(nextNode.getVisualID());
stringBuffer.append(TEXT_30);
-
-boolean isDiagram = genContainerBase instanceof GenDiagram;
-
-Collection phantomLinks = new ArrayList();
-for (Iterator it = genDiagram.getLinks().iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
- if (nextLink.getModelFacet() instanceof FeatureModelFacet) {
- FeatureModelFacet nextModelFacet = (FeatureModelFacet) nextLink.getModelFacet();
- if (nextModelFacet.getMetaFeature().isContains()) {
- phantomLinks.add(nextLink);
- }
- }
-}
-
-if (phantomLinks.size() > 0 || isDiagram) {
-
stringBuffer.append(TEXT_31);
-
- if (isDiagram) {
-
stringBuffer.append(TEXT_32);
-
- }
-
- if (phantomLinks.size() > 0) {
-
+ if (childMetaFeature.isListType()) {
stringBuffer.append(TEXT_33);
-
- }
-
+ }
+ }
stringBuffer.append(TEXT_34);
-
-}
-
-if (phantomLinks.size() > 0) {
- String domainMetaclassInterfaceName = importManager.getImportedName(domainMetaclass.getQualifiedInterfaceName());
- // Collecting all phantom elements
- Map genClass2Phantom = new LinkedHashMap();
- for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
- GenTopLevelNode nextTopLevelNode = (GenTopLevelNode) topLevelNodes.next();
- TypeModelFacet nextModelFacet = nextTopLevelNode.getModelFacet();
- if (!nextModelFacet.isPhantomElement()) {
- continue;
- }
- genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
- }
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_35);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_36);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_37);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ } else {
stringBuffer.append(TEXT_38);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_39);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ stringBuffer.append(importManager.getImportedName("java.util.Collections"));
stringBuffer.append(TEXT_40);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
stringBuffer.append(TEXT_41);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ }
stringBuffer.append(TEXT_42);
- stringBuffer.append(domainMetaclassInterfaceName);
+ if (genContainer instanceof GenNode && isSynchronizedDiagram) {
stringBuffer.append(TEXT_43);
- stringBuffer.append(domainMetaclassInterfaceName);
+
+// Collecting all phantom elements
+Map genClass2Phantom = new LinkedHashMap();
+for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
+ GenTopLevelNode nextTopLevelNode = (GenTopLevelNode) topLevelNodes.next();
+ TypeModelFacet nextModelFacet = nextTopLevelNode.getModelFacet();
+ if (!nextModelFacet.isPhantomElement()) {
+ continue;
+ }
+ genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
+}
+
+
+List phantomLinks = new LinkedList();
+for (Iterator it = genDiagram.getLinks().iterator(); it.hasNext();) {
+ GenLink nextLink = (GenLink) it.next();
+ if (nextLink.getModelFacet() instanceof FeatureModelFacet) {
+ FeatureModelFacet nextModelFacet = (FeatureModelFacet) nextLink.getModelFacet();
+ if (nextModelFacet.getMetaFeature().isContains()) {
+ phantomLinks.add(nextLink);
+ }
+ }
+}
+
+if (genClass2Phantom.size() > 0 && phantomLinks.size() > 0) {
+
stringBuffer.append(TEXT_44);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_45);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
+ stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
stringBuffer.append(TEXT_46);
- stringBuffer.append(importManager.getImportedName("java.util.Map"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_47);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_48);
-
- for (Iterator it = phantomLinks.iterator(); it.hasNext();) {
- GenLink phantomLink = (GenLink) it.next();
- FeatureModelFacet linkFMF = (FeatureModelFacet) phantomLink.getModelFacet();
- GenFeature genFeature = linkFMF.getMetaFeature();
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
stringBuffer.append(TEXT_49);
- stringBuffer.append(importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName()));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
stringBuffer.append(TEXT_50);
- stringBuffer.append(genFeature.getFeatureAccessorName());
+
+ List genLinks = phantomLinks;
+ for (int linkIndex = 0; linkIndex < genLinks.size(); linkIndex++) {
+ boolean phantomsOnly = true;
+
stringBuffer.append(TEXT_51);
- GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
- if (phantomNode != null) {
- if (genFeature.isListType()) {
+GenLink nextLink = (GenLink) genLinks.get(linkIndex);
+if (false == nextLink.getModelFacet() instanceof FeatureModelFacet) {
+ continue;
+}
+FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
+GenFeature genFeature = linkFMF.getMetaFeature();
+GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
+if (phantomsOnly ? (!genFeature.isContains() || phantomNode == null) : (genFeature.isContains())) {
+// Processing only features which are isPhantoms == phantomsOnly
+ continue;
+}
stringBuffer.append(TEXT_52);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName()));
stringBuffer.append(TEXT_53);
- stringBuffer.append(getFeatureValueGetter("modelElement", genFeature, true, importManager));
+ stringBuffer.append(genFeature.getGenClass().getClassifierAccessorName());
stringBuffer.append(TEXT_54);
-
- } else {
-
+ if (genFeature.isListType()) {
stringBuffer.append(TEXT_55);
- stringBuffer.append(getFeatureValueGetter("modelElement", genFeature, true, importManager));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_56);
-
- }
-
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
stringBuffer.append(TEXT_57);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_58);
- stringBuffer.append(phantomNode.getVisualID());
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_59);
- if (genFeature.isListType()) {
+ } else {
stringBuffer.append(TEXT_60);
- }
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_61);
- stringBuffer.append(importManager.getImportedName(genDiagram.getSemanticHintsQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_62);
- stringBuffer.append(phantomLink.getUniqueIdentifier());
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
stringBuffer.append(TEXT_63);
- stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
+ }
+ if (phantomsOnly) {
stringBuffer.append(TEXT_64);
- stringBuffer.append(phantomLink.getUniqueIdentifier());
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
stringBuffer.append(TEXT_65);
-
- if (genFeature.isListType()) {
-
+ stringBuffer.append(phantomNode.getVisualID());
stringBuffer.append(TEXT_66);
-
- }
- }
-
+ }
stringBuffer.append(TEXT_67);
-
- }
-
- if (isDiagram) {
-
stringBuffer.append(TEXT_68);
-
- }
-
+ if (phantomsOnly) {
stringBuffer.append(TEXT_69);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ }
+ if (genFeature.isListType()) {
stringBuffer.append(TEXT_70);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ }
stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
+ }
stringBuffer.append(TEXT_72);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
stringBuffer.append(TEXT_73);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_74);
- stringBuffer.append(importManager.getImportedName("java.util.Map"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_75);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_76);
- stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_77);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_78);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_79);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
stringBuffer.append(TEXT_80);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
+ stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_82);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages"));
+ stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_85);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.ICommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_87);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.EtoolsProxyCommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_89);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_90);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
stringBuffer.append(TEXT_91);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
stringBuffer.append(TEXT_92);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
stringBuffer.append(TEXT_93);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages"));
stringBuffer.append(TEXT_94);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_95);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_96);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_97);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.ICommand"));
stringBuffer.append(TEXT_98);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand"));
stringBuffer.append(TEXT_99);
- stringBuffer.append(importManager.getImportedName("java.util.Map"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
stringBuffer.append(TEXT_100);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.EtoolsProxyCommand"));
stringBuffer.append(TEXT_101);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand"));
stringBuffer.append(TEXT_102);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter"));
stringBuffer.append(TEXT_103);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
stringBuffer.append(TEXT_104);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
stringBuffer.append(TEXT_110);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
stringBuffer.append(TEXT_111);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_112);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
- stringBuffer.append(TEXT_113);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
- stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants"));
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants"));
- stringBuffer.append(TEXT_116);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
- stringBuffer.append(TEXT_117);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
- stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
- stringBuffer.append(TEXT_119);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand"));
- stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_121);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_122);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_123);
-
-}
-
-
-if (isDiagram) {
-
- stringBuffer.append(TEXT_124);
-
-}
-
}
- stringBuffer.append(TEXT_125);
+ }
+ stringBuffer.append(TEXT_113);
importManager.emitSortedImports();
- stringBuffer.append(TEXT_126);
+ stringBuffer.append(TEXT_114);
return stringBuffer.toString();
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/DiagramCanonicalEditPolicyGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/DiagramCanonicalEditPolicyGenerator.java
index 2e448905a..6bfefa53f 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/DiagramCanonicalEditPolicyGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/policies/DiagramCanonicalEditPolicyGenerator.java
@@ -22,137 +22,267 @@ public class DiagramCanonicalEditPolicyGenerator {
protected final String TEXT_3 = NL + " */";
protected final String TEXT_4 = NL + "package ";
protected final String TEXT_5 = ";" + NL;
- protected final String TEXT_6 = NL + "import java.util.Iterator;" + NL + "import java.util.LinkedList;" + NL + "import java.util.List;" + NL + "import java.util.Collection;" + NL + "import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;" + NL + "import org.eclipse.gmf.runtime.notation.Diagram;" + NL + "import org.eclipse.gmf.runtime.notation.Edge;" + NL + "import org.eclipse.gmf.runtime.notation.View;" + NL + "import org.eclipse.emf.ecore.EObject;";
+ protected final String TEXT_6 = NL + "import java.util.List;" + NL + "import java.util.Collection;" + NL + "import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;" + NL + "import org.eclipse.gmf.runtime.notation.Edge;" + NL + "import org.eclipse.gmf.runtime.notation.View;" + NL + "import org.eclipse.emf.ecore.EObject;";
protected final String TEXT_7 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_8 = " extends CanonicalConnectionEditPolicy {";
+ protected final String TEXT_8 = " extends CanonicalConnectionEditPolicy {" + NL + "\t";
protected final String TEXT_9 = NL;
- protected final String TEXT_10 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_11 = " getSemanticChildrenList() {" + NL + "\t\t\tList result = new ";
- protected final String TEXT_12 = "();";
- protected final String TEXT_13 = NL + "\t\t\t";
- protected final String TEXT_14 = " modelElement = (";
- protected final String TEXT_15 = ") ((View) getHost().getModel()).getElement();" + NL + "\t\t\t";
- protected final String TEXT_16 = " nextValue;" + NL + "\t\t\tint nodeVID;";
- protected final String TEXT_17 = "\t" + NL + "\t\t\tfor (";
- protected final String TEXT_18 = " it = ";
- protected final String TEXT_19 = ".iterator(); it.hasNext();) {" + NL + "\t\t\t\tnextValue = (";
- protected final String TEXT_20 = ") it.next();";
- protected final String TEXT_21 = NL + "\t\t\tnextValue = ";
- protected final String TEXT_22 = ";";
- protected final String TEXT_23 = NL + "\t\t\tnodeVID = ";
- protected final String TEXT_24 = ".INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, \"\");" + NL + "\t\t\tif (";
- protected final String TEXT_25 = " == nodeVID) {" + NL + "\t\t\t\tresult.add(nextValue);" + NL + "\t\t\t}";
- protected final String TEXT_26 = NL + "\t\t\t}";
- protected final String TEXT_27 = "\t\t\t" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldDeleteView(View view) {" + NL + "\t\t\t";
- protected final String TEXT_28 = " domainModelElement = view.getElement();" + NL + "\t\t\treturn domainModelElement != null && domainModelElement != ((View) getHost().getModel()).getElement() && super.shouldDeleteView(view);" + NL + "\t\t}";
- protected final String TEXT_29 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getSemanticConnectionsList() {" + NL + "\t\tList result = new LinkedList();";
- protected final String TEXT_30 = NL + "\t\tDiagram diagram = (Diagram) getHost().getModel();" + NL + "\t\t";
- protected final String TEXT_31 = " modelElement = (";
- protected final String TEXT_32 = ") diagram.getElement();" + NL + "\t\tfor (Iterator diagramElements = modelElement.eContents().iterator(); diagramElements.hasNext();) {" + NL + "\t\t\tEObject nextDiagramElement = (EObject) diagramElements.next();" + NL + "\t\t\tfor (Iterator childElements = nextDiagramElement.eContents().iterator(); childElements.hasNext();) {" + NL + "\t\t\t\tEObject nextChild = (EObject) childElements.next();" + NL + "\t\t\t\tif (";
- protected final String TEXT_33 = ".INSTANCE.getLinkWithClassVisualID(nextChild) != -1) {" + NL + "\t\t\t\t\tresult.add(nextChild);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}";
- protected final String TEXT_34 = NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected EObject getSourceElement(EObject relationship) {" + NL + "\t\treturn relationship.eContainer();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected EObject getTargetElement(EObject relationship) {" + NL + "\t\tint vID = ";
- protected final String TEXT_35 = ".INSTANCE.getLinkWithClassVisualID(relationship);" + NL + "\t\tswitch (vID) {";
- protected final String TEXT_36 = NL + "\t\tcase ";
- protected final String TEXT_37 = ":" + NL + "\t\t\treturn ";
- protected final String TEXT_38 = ";";
- protected final String TEXT_39 = NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * For now we are skipping links which was generated based on \"GenLinkReferenceOnly\" classes" + NL + "\t * since they do not handle any domain model objects inside, so we can not process them using" + NL + "\t * CanonicalConnectionEditPolicy class" + NL + "\t *" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean shouldIncludeConnection(Edge connector, Collection children) {" + NL + "\t\treturn super.shouldIncludeConnection(connector, children) && connector.getElement() != null;" + NL + "\t}";
- protected final String TEXT_40 = NL;
- protected final String TEXT_41 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected void refreshSemantic() {" + NL + "\tsuper.refreshSemantic();";
- protected final String TEXT_42 = NL + "\trefreshReferenceOnlyConnections();";
- protected final String TEXT_43 = NL + "\trefreshPhantoms();";
- protected final String TEXT_44 = NL + "}";
- protected final String TEXT_45 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private class PhantomLinkInfo {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate EObject myDst;" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate int myIndex;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String myType;" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_46 = " myElementType;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PhantomLinkInfo(EObject dst, int index, String linkType, ";
- protected final String TEXT_47 = " elementType) {" + NL + "\t\tmyDst = dst;" + NL + "\t\tmyIndex = index;" + NL + "\t\tmyType = linkType;" + NL + "\t\tmyElementType = elementType;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PhantomLinkInfo(EObject dst, String linkType, ";
- protected final String TEXT_48 = " elementType) {" + NL + "\t\tthis(dst, 0, linkType, elementType);" + NL + "\t}" + NL + "" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void refreshPhantoms() {" + NL + "\t";
- protected final String TEXT_49 = " phantomNodes = new ";
- protected final String TEXT_50 = "();" + NL + "\t";
- protected final String TEXT_51 = " phantomLinks = new ";
- protected final String TEXT_52 = "();" + NL + "\t";
- protected final String TEXT_53 = " modelElement = (";
- protected final String TEXT_54 = ") ((";
- protected final String TEXT_55 = ") getHost().getModel()).getElement();" + NL + "\t";
- protected final String TEXT_56 = " modelElementMetaclass = modelElement.eClass();" + NL + "\t";
- protected final String TEXT_57 = " eObject2ViewMap = new ";
- protected final String TEXT_58 = "();";
- protected final String TEXT_59 = NL + "\tif (-1 != modelElementMetaclass.getFeatureID(";
- protected final String TEXT_60 = ".eINSTANCE.get";
- protected final String TEXT_61 = "())) {";
- protected final String TEXT_62 = NL + "\t\tint linkIndex = 0;" + NL + "\t\tfor (";
- protected final String TEXT_63 = " values = ";
- protected final String TEXT_64 = ".iterator(); values.hasNext(); linkIndex++) {" + NL + "\t\t\tEObject nextValue = (EObject) values.next();";
- protected final String TEXT_65 = NL + "\t\tEObject nextValue = ";
- protected final String TEXT_66 = ";";
- protected final String TEXT_67 = NL + "\t\tint nodeVID = ";
- protected final String TEXT_68 = ".INSTANCE.getNodeVisualID(getDiagram(), nextValue, \"\");" + NL + "\t\tif (";
- protected final String TEXT_69 = " == nodeVID) {" + NL + "\t\t\tphantomNodes.add(nextValue);" + NL + "\t\t\tphantomLinks.add(new PhantomLinkInfo(nextValue";
- protected final String TEXT_70 = ", linkIndex";
- protected final String TEXT_71 = ", ";
- protected final String TEXT_72 = ".";
- protected final String TEXT_73 = ", ";
- protected final String TEXT_74 = ".";
- protected final String TEXT_75 = "));" + NL + "\t\t}";
- protected final String TEXT_76 = NL + "\t\t}";
- protected final String TEXT_77 = NL + "\t}";
- protected final String TEXT_78 = NL + NL + "\tfor (Iterator resourceObjects = modelElement.eResource().getContents().iterator(); resourceObjects.hasNext();) {" + NL + "\t\tEObject nextResourceEObject = (EObject) resourceObjects.next();" + NL + "\t\tif (nextResourceEObject != modelElement) {" + NL + "\t\t\tphantomNodes.add(nextResourceEObject);" + NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_79 = NL + NL + "\tfor (Iterator diagramNodes = getDiagram().getChildren().iterator(); diagramNodes.hasNext();) {" + NL + "\t\t";
- protected final String TEXT_80 = " nextView = (";
- protected final String TEXT_81 = ") diagramNodes.next();" + NL + "\t\tEObject nextViewElement = nextView.getElement();" + NL + "\t\tif (phantomNodes.contains(nextViewElement)) {" + NL + "\t\t\tphantomNodes.remove(nextViewElement);" + NL + "\t\t\teObject2ViewMap.put(nextViewElement, nextView);" + NL + "\t\t}\t" + NL + "\t}" + NL + "\t" + NL + "\tfor (Iterator diagramEdges = getDiagram().getEdges().iterator(); diagramEdges.hasNext();) {" + NL + "\t\t";
- protected final String TEXT_82 = " nextEdge = (";
- protected final String TEXT_83 = ") diagramEdges.next();" + NL + "\t\tif (nextEdge.getSource().getElement() != modelElement) {" + NL + "\t\t\tcontinue;" + NL + "\t\t}" + NL + "\t\tEObject target = nextEdge.getTarget().getElement();" + NL + "\t\tString linkType = nextEdge.getType();" + NL + "\t\tfor (Iterator linkInfos = phantomLinks.iterator(); linkInfos.hasNext();) {" + NL + "\t\t\tPhantomLinkInfo nextLinkInfo = (PhantomLinkInfo) linkInfos.next();" + NL + "\t\t\tif (nextLinkInfo.myDst == target && nextLinkInfo.myType.equals(linkType)) {" + NL + "\t\t\t\tlinkInfos.remove();" + NL + "\t\t\t\tbreak;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "\t" + NL + "\tcreatePhantomNodes(phantomNodes, eObject2ViewMap);" + NL + "\tcreatePhantomLinks(phantomLinks, eObject2ViewMap);" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void createPhantomNodes(";
- protected final String TEXT_84 = " nodes, ";
- protected final String TEXT_85 = " eObject2ViewMap) {" + NL + "\tif (nodes.isEmpty()) {" + NL + "\t\treturn;" + NL + "\t}" + NL + "\t";
- protected final String TEXT_86 = " descriptors = new ";
- protected final String TEXT_87 = "();" + NL + "\tfor (Iterator elements = nodes.iterator(); elements.hasNext();) {" + NL + "\t\tEObject element = (EObject)elements.next();" + NL + "\t\tCreateViewRequest.ViewDescriptor descriptor = getViewDescriptor(element);" + NL + "\t\tdescriptors.add(descriptor);" + NL + "\t}" + NL + "\t";
- protected final String TEXT_88 = " request = getCreateViewRequest(descriptors);" + NL + "\t";
- protected final String TEXT_89 = " diagramEditPart = getDiagramEditPart();" + NL + "\t";
- protected final String TEXT_90 = " cmd = diagramEditPart.getCommand(request);" + NL + "\tif (cmd == null) {" + NL + "\t\t";
- protected final String TEXT_91 = " cc = new ";
- protected final String TEXT_92 = "(";
- protected final String TEXT_93 = ".AddCommand_Label);" + NL + "\t\tfor (Iterator descriptorsIterator = descriptors.iterator(); descriptorsIterator.hasNext();) {" + NL + "\t\t\t";
- protected final String TEXT_94 = ".ViewDescriptor descriptor = (";
- protected final String TEXT_95 = ".ViewDescriptor) descriptorsIterator.next();" + NL + "\t\t\t";
- protected final String TEXT_96 = " createCommand = new ";
- protected final String TEXT_97 = "(((";
- protected final String TEXT_98 = ") getHost()).getEditingDomain(), descriptor, getDiagram());" + NL + "\t\t\tcc.compose(createCommand);" + NL + "\t\t}" + NL + "\t\tcmd = new ";
- protected final String TEXT_99 = "(cc);" + NL + "\t}\t" + NL + "\t" + NL + "\tif ( cmd != null && cmd.canExecute() ) {" + NL + "\t\t";
- protected final String TEXT_100 = ".makeMutable(new ";
- protected final String TEXT_101 = "(((";
- protected final String TEXT_102 = ") diagramEditPart).getNotationView())).execute();" + NL + "\t\texecuteCommand(cmd);" + NL + "\t\t";
- protected final String TEXT_103 = " adapters = (";
- protected final String TEXT_104 = ") request.getNewObject();" + NL + "\t\tmakeViewsImmutable(adapters);" + NL + "\t\tfor (Iterator viewAdapters = adapters.iterator(); viewAdapters.hasNext();) {" + NL + "\t\t\t";
- protected final String TEXT_105 = " createdView = (";
- protected final String TEXT_106 = ") ((";
- protected final String TEXT_107 = ") viewAdapters.next()).getAdapter(";
- protected final String TEXT_108 = ".class);" + NL + "\t\t\tif (createdView.getElement() != null) {" + NL + "\t\t\t\teObject2ViewMap.put(createdView.getElement(), createdView);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "\tdiagramEditPart.refresh();" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void createPhantomLinks(";
- protected final String TEXT_109 = " linkInfos, ";
- protected final String TEXT_110 = " eObject2ViewMap) {" + NL + "\tif (linkInfos.isEmpty()) {" + NL + "\t\treturn;" + NL + "\t}" + NL + "\tfor (Iterator linkInfoIterator = linkInfos.iterator(); linkInfoIterator.hasNext();) {" + NL + "\t\tfinal PhantomLinkInfo nextLinkInfo = (PhantomLinkInfo) linkInfoIterator.next();" + NL + "\t\t";
- protected final String TEXT_111 = " dstView = (";
- protected final String TEXT_112 = ") eObject2ViewMap.get(nextLinkInfo.myDst);" + NL + "\t\tif (dstView == null) {" + NL + "\t\t\tcontinue;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_113 = " targetEditPart = (";
- protected final String TEXT_114 = ") getHost().getViewer().getEditPartRegistry().get(dstView);\t\t" + NL + "\t\t";
- protected final String TEXT_115 = " sourceEditPart = getHost();" + NL + "\t\tString factoryHint = \"\";" + NL + "\t\t";
- protected final String TEXT_116 = " adapter = new ";
- protected final String TEXT_117 = "() {" + NL + "\t\t\tpublic Object getAdapter(Class adapter) {" + NL + "\t\t\t\tif (";
- protected final String TEXT_118 = ".class.isAssignableFrom(adapter)) {" + NL + "\t\t\t\t\treturn nextLinkInfo.myElementType;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\t" + NL + "\t\t";
- protected final String TEXT_119 = ".ConnectionViewDescriptor descriptor = new ";
- protected final String TEXT_120 = ".ConnectionViewDescriptor(adapter, getFactoryHint(adapter, factoryHint), ";
- protected final String TEXT_121 = ".APPEND, false, ((";
- protected final String TEXT_122 = ") getHost()).getDiagramPreferencesHint());" + NL + "\t\t";
- protected final String TEXT_123 = " ccr = new ";
- protected final String TEXT_124 = "(descriptor);" + NL + "\t\tccr.setType(";
- protected final String TEXT_125 = ".REQ_CONNECTION_START);" + NL + "\t\tccr.setSourceEditPart(sourceEditPart);" + NL + "\t\tsourceEditPart.getCommand(ccr);" + NL + "\t\tccr.setTargetEditPart(targetEditPart);" + NL + "\t\tccr.setType(";
- protected final String TEXT_126 = ".REQ_CONNECTION_END);" + NL + "\t\t";
- protected final String TEXT_127 = " cmd = targetEditPart.getCommand(ccr);" + NL + "\t\tif (cmd != null && cmd.canExecute()) {" + NL + "\t\t\texecuteCommand(cmd);" + NL + "\t\t\t";
- protected final String TEXT_128 = " viewAdapter = (";
- protected final String TEXT_129 = ") ccr.getNewObject();" + NL + "\t\t\t";
- protected final String TEXT_130 = ".makeImmutable(viewAdapter).execute();" + NL + "\t\t}" + NL + "\t}" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_131 = " getDiagram() {" + NL + "\treturn ((View) getHost().getModel()).getDiagram();" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_132 = " getDiagramEditPart() {" + NL + "\treturn (";
- protected final String TEXT_133 = ") getHost().getViewer().getEditPartRegistry().get(getDiagram());" + NL + "}";
- protected final String TEXT_134 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void refreshReferenceOnlyConnections() {" + NL + "// TODO: implement this method" + NL + "}";
- protected final String TEXT_135 = NL + "}";
- protected final String TEXT_136 = NL;
+ protected final String TEXT_10 = "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
+ protected final String TEXT_11 = " getSemanticChildrenList() {" + NL + "\t";
+ protected final String TEXT_12 = " result = new ";
+ protected final String TEXT_13 = "();";
+ protected final String TEXT_14 = NL + "\t";
+ protected final String TEXT_15 = " modelObject = ((";
+ protected final String TEXT_16 = ") getHost().getModel()).getElement();" + NL + "\t";
+ protected final String TEXT_17 = " viewObject = (";
+ protected final String TEXT_18 = ") getHost().getModel();";
+ protected final String TEXT_19 = NL;
+ protected final String TEXT_20 = "\t";
+ protected final String TEXT_21 = " nextValue;" + NL + "\tint nodeVID;";
+ protected final String TEXT_22 = "\tfor (";
+ protected final String TEXT_23 = " values = ";
+ protected final String TEXT_24 = ".iterator(); values.hasNext();) {" + NL + "\t\tnextValue = (";
+ protected final String TEXT_25 = ") values.next();";
+ protected final String TEXT_26 = NL + "\tnextValue = ";
+ protected final String TEXT_27 = ";";
+ protected final String TEXT_28 = NL + "\tnodeVID = ";
+ protected final String TEXT_29 = ".INSTANCE.getNodeVisualID(viewObject, nextValue, \"\");" + NL + "\tif (";
+ protected final String TEXT_30 = " == nodeVID) {" + NL + "\t\tresult.add(nextValue);";
+ protected final String TEXT_31 = NL;
+ protected final String TEXT_32 = "\t}";
+ protected final String TEXT_33 = NL + "\t}";
+ protected final String TEXT_34 = NL + "\treturn result;" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected boolean shouldDeleteView(";
+ protected final String TEXT_35 = " view) {" + NL + "\t";
+ protected final String TEXT_36 = " domainModelElement = view.getElement();" + NL + "\treturn domainModelElement != null && domainModelElement != ((";
+ protected final String TEXT_37 = ") getHost().getModel()).getElement() && super.shouldDeleteView(view);" + NL + "}";
+ protected final String TEXT_38 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_39 = " getSemanticChildrenList() {" + NL + "\t\treturn ";
+ protected final String TEXT_40 = ".EMPTY_LIST;" + NL + "\t}\t";
+ protected final String TEXT_41 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getSemanticConnectionsList() {" + NL + "\t\treturn ";
+ protected final String TEXT_42 = ".EMPTY_LIST;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected EObject getSourceElement(EObject relationship) {" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected EObject getTargetElement(EObject relationship) {" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean shouldIncludeConnection(Edge connector, Collection children) {" + NL + "\t\treturn false;" + NL + "\t}" + NL;
+ protected final String TEXT_43 = NL;
+ protected final String TEXT_44 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshSemantic() {" + NL + "\t\tsuper.refreshSemantic();";
+ protected final String TEXT_45 = NL + "\t\trefreshPhantoms();";
+ protected final String TEXT_46 = NL + "\t\trefreshConnections();" + NL + "\t}";
+ protected final String TEXT_47 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void refreshPhantoms() {" + NL + "\t\t";
+ protected final String TEXT_48 = " phantomNodes = new ";
+ protected final String TEXT_49 = "();" + NL + "\t\t";
+ protected final String TEXT_50 = " diagramModelObject = ((";
+ protected final String TEXT_51 = ") getHost().getModel()).getElement();" + NL + "\t\t";
+ protected final String TEXT_52 = " diagram = getDiagram();";
+ protected final String TEXT_53 = NL;
+ protected final String TEXT_54 = " resource = diagramModelObject.eResource();" + NL + "for (";
+ protected final String TEXT_55 = " it = resource.getContents().iterator(); it.hasNext();) {" + NL + "\t";
+ protected final String TEXT_56 = " nextResourceObject = (";
+ protected final String TEXT_57 = ") it.next();" + NL + "\tif (nextResourceObject == diagramModelObject) {" + NL + "\t\tcontinue;" + NL + "\t}" + NL + "\tint nodeVID = ";
+ protected final String TEXT_58 = ".INSTANCE.getNodeVisualID(diagram, nextResourceObject, \"\");" + NL + "\tswitch (nodeVID) {";
+ protected final String TEXT_59 = NL + "\t\tcase ";
+ protected final String TEXT_60 = ": {" + NL + "\t\t\tphantomNodes.add(nextResourceObject);" + NL + "\t\t\tbreak;" + NL + "\t\t}";
+ protected final String TEXT_61 = NL;
+ protected final String TEXT_62 = "\t}" + NL + "}";
+ protected final String TEXT_63 = NL;
+ protected final String TEXT_64 = NL;
+ protected final String TEXT_65 = "for (";
+ protected final String TEXT_66 = " diagramNodes = getDiagram().getChildren().iterator(); diagramNodes.hasNext();) {" + NL + "\t";
+ protected final String TEXT_67 = " nextView = (";
+ protected final String TEXT_68 = ") diagramNodes.next();" + NL + "\t";
+ protected final String TEXT_69 = " nextViewElement = nextView.getElement();" + NL + "\tif (phantomNodes.contains(nextViewElement)) {" + NL + "\t\tphantomNodes.remove(nextViewElement);" + NL + "\t}\t" + NL + "}" + NL + "\t\tcreatePhantomNodes(phantomNodes);" + NL + "\t}" + NL;
+ protected final String TEXT_70 = NL;
+ protected final String TEXT_71 = "/**" + NL + " * @generated" + NL + " */" + NL + "private void createPhantomNodes(";
+ protected final String TEXT_72 = " nodes) {" + NL + "\tif (nodes.isEmpty()) {" + NL + "\t\treturn;" + NL + "\t}" + NL + "\t";
+ protected final String TEXT_73 = " descriptors = new ";
+ protected final String TEXT_74 = "();" + NL + "\tfor (";
+ protected final String TEXT_75 = " elements = nodes.iterator(); elements.hasNext();) {" + NL + "\t\t";
+ protected final String TEXT_76 = " element = (";
+ protected final String TEXT_77 = ")elements.next();" + NL + "\t\t";
+ protected final String TEXT_78 = ".ViewDescriptor descriptor = getViewDescriptor(element);" + NL + "\t\tdescriptors.add(descriptor);" + NL + "\t}" + NL + "\t";
+ protected final String TEXT_79 = " diagram = getDiagram();" + NL + "\t";
+ protected final String TEXT_80 = " diagramEditPart = getDiagramEditPart();" + NL + "\t" + NL + "\t";
+ protected final String TEXT_81 = " request = getCreateViewRequest(descriptors);" + NL + "\t";
+ protected final String TEXT_82 = " cmd = diagramEditPart.getCommand(request);" + NL + "\tif (cmd == null) {" + NL + "\t\t";
+ protected final String TEXT_83 = " cc = new ";
+ protected final String TEXT_84 = "(";
+ protected final String TEXT_85 = ".AddCommand_Label);" + NL + "\t\tfor (";
+ protected final String TEXT_86 = " descriptorsIterator = descriptors.iterator(); descriptorsIterator.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_87 = ".ViewDescriptor descriptor = (";
+ protected final String TEXT_88 = ".ViewDescriptor) descriptorsIterator.next();" + NL + "\t\t\t";
+ protected final String TEXT_89 = " createCommand = new ";
+ protected final String TEXT_90 = "(((";
+ protected final String TEXT_91 = ") getHost()).getEditingDomain(), descriptor, diagram);" + NL + "\t\t\tcc.compose(createCommand);" + NL + "\t\t}" + NL + "\t\tcmd = new ";
+ protected final String TEXT_92 = "(cc);" + NL + "\t}\t" + NL + "\t" + NL + "\tif ( cmd != null && cmd.canExecute() ) {" + NL + "\t\t";
+ protected final String TEXT_93 = ".makeMutable(new ";
+ protected final String TEXT_94 = "(((";
+ protected final String TEXT_95 = ") diagramEditPart).getNotationView())).execute();" + NL + "\t\texecuteCommand(cmd);" + NL + "\t\t";
+ protected final String TEXT_96 = " adapters = (";
+ protected final String TEXT_97 = ") request.getNewObject();" + NL + "\t\tmakeViewsImmutable(adapters);" + NL + "\t}" + NL + "\tdiagramEditPart.refresh();" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
+ protected final String TEXT_98 = " getDiagramEditPart() {" + NL + "\treturn (";
+ protected final String TEXT_99 = ") getHost().getViewer().getEditPartRegistry().get(getDiagram());" + NL + "}";
+ protected final String TEXT_100 = NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
+ protected final String TEXT_101 = " myLinkDescriptors = new ";
+ protected final String TEXT_102 = "();" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
+ protected final String TEXT_103 = " myEObject2ViewMap = new ";
+ protected final String TEXT_104 = "();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void refreshConnections() {" + NL + "\t\ttry {" + NL + "\t\t\tcollectAllLinks(getDiagram());" + NL + "\t\t\t";
+ protected final String TEXT_105 = " existingLinks = new ";
+ protected final String TEXT_106 = "(getDiagram().getEdges());" + NL + "\t\t\tfor (";
+ protected final String TEXT_107 = " diagramLinks = existingLinks.iterator(); diagramLinks.hasNext();) {" + NL + "\t\t\t\tEdge nextDiagramLink = (Edge) diagramLinks.next();" + NL + "\t\t\t\t";
+ protected final String TEXT_108 = " diagramLinkObject = nextDiagramLink.getElement();" + NL + "\t\t\t\t";
+ protected final String TEXT_109 = " diagramLinkSrc = nextDiagramLink.getSource().getElement();" + NL + "\t\t\t\t";
+ protected final String TEXT_110 = " diagramLinkDst = nextDiagramLink.getTarget().getElement();" + NL + "\t\t\t\tint diagramLinkVisualID = getVisualID(nextDiagramLink);" + NL + "\t\t\t\tfor (";
+ protected final String TEXT_111 = " modelLinkDescriptors = myLinkDescriptors.iterator(); modelLinkDescriptors.hasNext();) {" + NL + "\t\t\t\t\tLinkDescriptor nextLinkDescriptor = (LinkDescriptor) modelLinkDescriptors.next();" + NL + "\t\t\t\t\tif (diagramLinkObject == nextLinkDescriptor.getLinkElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {" + NL + "\t\t\t\t\t\tdiagramLinks.remove();" + NL + "\t\t\t\t\t\tmodelLinkDescriptors.remove();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tdeleteViews(existingLinks.iterator());" + NL + "\t\t\tcreateConnections(myLinkDescriptors);" + NL + "\t\t} finally {" + NL + "\t\t\tmyLinkDescriptors.clear();" + NL + "\t\t\tmyEObject2ViewMap.clear();" + NL + "\t\t}" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void collectAllLinks(";
+ protected final String TEXT_112 = " view) {" + NL + "\t\t";
+ protected final String TEXT_113 = " modelElement = view.getElement();" + NL + "\t\tint diagramElementVisualID = getVisualID(view);" + NL + "\t\tswitch (diagramElementVisualID) {";
+ protected final String TEXT_114 = NL + "\t\tcase ";
+ protected final String TEXT_115 = ":";
+ protected final String TEXT_116 = " { myEObject2ViewMap.put(modelElement, view);" + NL + "\t\t\tstoreLinks(modelElement, getDiagram());" + NL + "\t\t\tfor (";
+ protected final String TEXT_117 = " children = view.getChildren().iterator(); children.hasNext();) {" + NL + "\t\t\t\t";
+ protected final String TEXT_118 = " childView = (";
+ protected final String TEXT_119 = ") children.next();" + NL + "\t\t\t\tcollectAllLinks(childView);" + NL + "\t\t\t}" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tdefault: {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createConnections(";
+ protected final String TEXT_120 = " linkDescriptors) {" + NL + "\t\tif (linkDescriptors.isEmpty()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tfor (";
+ protected final String TEXT_121 = " linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {" + NL + "\t\t\tfinal LinkDescriptor nextLinkDescriptor = (LinkDescriptor) linkDescriptorsIterator.next();" + NL + "\t\t\t";
+ protected final String TEXT_122 = " sourceEditPart = getEditPartFor(nextLinkDescriptor.getSource());" + NL + "\t\t\t";
+ protected final String TEXT_123 = " targetEditPart = getEditPartFor(nextLinkDescriptor.getDestination());" + NL + "\t\t\tif (sourceEditPart == null || targetEditPart == null) {" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\tString factoryHint = \"\";" + NL + "\t\t\t";
+ protected final String TEXT_124 = ".ConnectionViewDescriptor descriptor = new ";
+ protected final String TEXT_125 = ".ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), getFactoryHint(nextLinkDescriptor.getSemanticAdapter(), factoryHint), ";
+ protected final String TEXT_126 = ".APPEND, false, ((";
+ protected final String TEXT_127 = ") getHost()).getDiagramPreferencesHint());" + NL + "\t\t\t";
+ protected final String TEXT_128 = " ccr = new ";
+ protected final String TEXT_129 = "(descriptor);" + NL + "\t\t\tccr.setType(";
+ protected final String TEXT_130 = ".REQ_CONNECTION_START);" + NL + "\t\t\tccr.setSourceEditPart(sourceEditPart);" + NL + "\t\t\tsourceEditPart.getCommand(ccr);" + NL + "\t\t\tccr.setTargetEditPart(targetEditPart);" + NL + "\t\t\tccr.setType(";
+ protected final String TEXT_131 = ".REQ_CONNECTION_END);" + NL + "\t\t\t";
+ protected final String TEXT_132 = " cmd = targetEditPart.getCommand(ccr);" + NL + "\t\t\tif (cmd != null && cmd.canExecute()) {" + NL + "\t\t\t\texecuteCommand(cmd);" + NL + "\t\t\t\t";
+ protected final String TEXT_133 = " viewAdapter = (";
+ protected final String TEXT_134 = ") ccr.getNewObject();" + NL + "\t\t\t\t";
+ protected final String TEXT_135 = ".makeImmutable(viewAdapter).execute();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
+ protected final String TEXT_136 = " getEditPartFor(";
+ protected final String TEXT_137 = " modelElement) {" + NL + "\t\t";
+ protected final String TEXT_138 = " view = (";
+ protected final String TEXT_139 = ") myEObject2ViewMap.get(modelElement);" + NL + "\t\tif (view != null) {" + NL + "\t\t\treturn (";
+ protected final String TEXT_140 = ") getHost().getViewer().getEditPartRegistry().get(view);" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "\t";
+ protected final String TEXT_141 = NL;
+ protected final String TEXT_142 = "/**" + NL + " *@generated" + NL + " */" + NL + "private void storeLinks(";
+ protected final String TEXT_143 = " container, ";
+ protected final String TEXT_144 = " diagram) {" + NL + "\t";
+ protected final String TEXT_145 = " containerMetaclass = container.eClass();" + NL + "\tstoreFeatureModelFacetLinks(container, containerMetaclass, diagram);" + NL + "\tstoreTypeModelFacetLinks(container, containerMetaclass);" + NL + "}" + NL + "\t" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void storeTypeModelFacetLinks(";
+ protected final String TEXT_146 = " container, ";
+ protected final String TEXT_147 = " containerMetaclass) {\t";
+ protected final String TEXT_148 = "\t\t" + NL + "\tif (";
+ protected final String TEXT_149 = ".eINSTANCE.get";
+ protected final String TEXT_150 = "().isSuperTypeOf(containerMetaclass)) {";
+ protected final String TEXT_151 = "\t\t" + NL + "\t\tfor (";
+ protected final String TEXT_152 = " values = ";
+ protected final String TEXT_153 = ".iterator(); values.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_154 = " nextValue = ((";
+ protected final String TEXT_155 = ") values.next());";
+ protected final String TEXT_156 = NL + "\t\t";
+ protected final String TEXT_157 = " nextValue = (";
+ protected final String TEXT_158 = ") ";
+ protected final String TEXT_159 = ";";
+ protected final String TEXT_160 = NL + "\t\tObject structuralFeatureResult = ";
+ protected final String TEXT_161 = ";" + NL + "\t\tif (structuralFeatureResult instanceof ";
+ protected final String TEXT_162 = ") {" + NL + "\t\t\t";
+ protected final String TEXT_163 = " dst = (";
+ protected final String TEXT_164 = ") structuralFeatureResult;";
+ protected final String TEXT_165 = NL + "\t\t\tstructuralFeatureResult = ";
+ protected final String TEXT_166 = ";" + NL + "\t\t\tif (structuralFeatureResult instanceof ";
+ protected final String TEXT_167 = ") {" + NL + "\t\t\t\t";
+ protected final String TEXT_168 = " src = (";
+ protected final String TEXT_169 = ") structuralFeatureResult;";
+ protected final String TEXT_170 = NL + "\t\t\t";
+ protected final String TEXT_171 = " src = container;";
+ protected final String TEXT_172 = NL + "\t\t\tint linkVID = ";
+ protected final String TEXT_173 = ".INSTANCE.getLinkWithClassVisualID(nextValue);" + NL + "\t\t\tif (";
+ protected final String TEXT_174 = " == linkVID) {" + NL + "\t\t\t\tmyLinkDescriptors.add(new LinkDescriptor(src, dst, nextValue, linkVID));" + NL + "\t\t\t}";
+ protected final String TEXT_175 = NL + "\t\t\t}";
+ protected final String TEXT_176 = NL + "\t\t}";
+ protected final String TEXT_177 = NL + "\t\t}";
+ protected final String TEXT_178 = NL + "\t}";
+ protected final String TEXT_179 = NL + "}" + NL + "" + NL + "/**" + NL + " *@generated" + NL + " */" + NL + "private void storeFeatureModelFacetLinks(";
+ protected final String TEXT_180 = " container, ";
+ protected final String TEXT_181 = " containerMetaclass, Diagram diagram) {";
+ protected final String TEXT_182 = NL;
+ protected final String TEXT_183 = "\tif (";
+ protected final String TEXT_184 = ".eINSTANCE.get";
+ protected final String TEXT_185 = "().isSuperTypeOf(containerMetaclass)) {";
+ protected final String TEXT_186 = NL + "\t\tfor (";
+ protected final String TEXT_187 = " destinations = ";
+ protected final String TEXT_188 = ".iterator(); destinations.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_189 = " nextDestination = (";
+ protected final String TEXT_190 = ") destinations.next();";
+ protected final String TEXT_191 = NL + "\t\t";
+ protected final String TEXT_192 = " nextDestination = (";
+ protected final String TEXT_193 = ") ";
+ protected final String TEXT_194 = ";";
+ protected final String TEXT_195 = NL + "\t\tint nodeVID = ";
+ protected final String TEXT_196 = ".INSTANCE.getNodeVisualID(diagram, nextDestination, \"\");" + NL + "\t\tif (";
+ protected final String TEXT_197 = " == nodeVID) {";
+ protected final String TEXT_198 = NL + "\t\tmyLinkDescriptors.add(new LinkDescriptor(container, nextDestination, ";
+ protected final String TEXT_199 = ".";
+ protected final String TEXT_200 = ", ";
+ protected final String TEXT_201 = "));";
+ protected final String TEXT_202 = NL + "\t\t";
+ protected final String TEXT_203 = " nextNode = ViewService.createNode(diagram, nextDestination, null, ";
+ protected final String TEXT_204 = ".DIAGRAM_PREFERENCES_HINT);" + NL + "\t\tmyEObject2NodeMap.put(nextDestination, nextNode);" + NL + "\t\tcreate";
+ protected final String TEXT_205 = "Children(nextNode, nextDestination);";
+ protected final String TEXT_206 = NL;
+ protected final String TEXT_207 = NL + "\t\t}";
+ protected final String TEXT_208 = NL + "\t\t}";
+ protected final String TEXT_209 = NL + "\t}";
+ protected final String TEXT_210 = NL;
+ protected final String TEXT_211 = "\tif (";
+ protected final String TEXT_212 = ".eINSTANCE.get";
+ protected final String TEXT_213 = "().isSuperTypeOf(containerMetaclass)) {";
+ protected final String TEXT_214 = NL + "\t\tfor (";
+ protected final String TEXT_215 = " destinations = ";
+ protected final String TEXT_216 = ".iterator(); destinations.hasNext();) {" + NL + "\t\t\t";
+ protected final String TEXT_217 = " nextDestination = (";
+ protected final String TEXT_218 = ") destinations.next();";
+ protected final String TEXT_219 = NL + "\t\t";
+ protected final String TEXT_220 = " nextDestination = (";
+ protected final String TEXT_221 = ") ";
+ protected final String TEXT_222 = ";";
+ protected final String TEXT_223 = NL + "\t\tint nodeVID = ";
+ protected final String TEXT_224 = ".INSTANCE.getNodeVisualID(diagram, nextDestination, \"\");" + NL + "\t\tif (";
+ protected final String TEXT_225 = " == nodeVID) {";
+ protected final String TEXT_226 = NL + "\t\tmyLinkDescriptors.add(new LinkDescriptor(container, nextDestination, ";
+ protected final String TEXT_227 = ".";
+ protected final String TEXT_228 = ", ";
+ protected final String TEXT_229 = "));";
+ protected final String TEXT_230 = NL;
+ protected final String TEXT_231 = NL + "\t\t}";
+ protected final String TEXT_232 = NL + "\t\t}";
+ protected final String TEXT_233 = NL + "\t}";
+ protected final String TEXT_234 = NL + "}" + NL + "\t";
+ protected final String TEXT_235 = NL;
+ protected final String TEXT_236 = "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
+ protected final String TEXT_237 = " getDiagram() {" + NL + "\treturn ((";
+ protected final String TEXT_238 = ") getHost().getModel()).getDiagram();" + NL + "}" + NL;
+ protected final String TEXT_239 = NL;
+ protected final String TEXT_240 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static int getVisualID(View containerView) {" + NL + "\t\t";
+ protected final String TEXT_241 = " annotation = containerView.getEAnnotation(\"ViewIdentifier\"); //$NON-NLS-1$" + NL + "\t\tif (annotation == null) {" + NL + "\t\t\treturn -1;" + NL + "\t\t}" + NL + "\t\tString visualID = (String) annotation.getDetails().get(\"visualID\"); //$NON-NLS-1$" + NL + "\t\tif (visualID == null) {" + NL + "\t\t\treturn -1;" + NL + "\t\t}" + NL + "\t\ttry {" + NL + "\t\t\treturn Integer.parseInt(visualID);" + NL + "\t\t} catch (NumberFormatException e) {" + NL + "\t\t\t";
+ protected final String TEXT_242 = ".getInstance().logError(\"Unable to parse \\\"visualID\\\" annotation: \" + visualID, e);" + NL + "\t\t}" + NL + "\t\treturn -1;" + NL + "\t}" + NL;
+ protected final String TEXT_243 = NL;
+ protected final String TEXT_244 = "/**" + NL + " * @generated" + NL + " */" + NL + "private class LinkDescriptor {" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_245 = " mySource;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_246 = " myDestination;" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_247 = " myLinkElement;" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate int myVisualID;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate ";
+ protected final String TEXT_248 = " mySemanticAdapter;" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor(";
+ protected final String TEXT_249 = " source, ";
+ protected final String TEXT_250 = " destination, ";
+ protected final String TEXT_251 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t\tmySemanticAdapter = new ";
+ protected final String TEXT_252 = "(linkElement);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor(";
+ protected final String TEXT_253 = " source, ";
+ protected final String TEXT_254 = " destination, ";
+ protected final String TEXT_255 = " elementType, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = null;" + NL + "\t\tfinal ";
+ protected final String TEXT_256 = " elementTypeCopy = elementType;" + NL + "\t\tmySemanticAdapter = new ";
+ protected final String TEXT_257 = "() {" + NL + "\t\t\tpublic Object getAdapter(Class adapter) {" + NL + "\t\t\t\tif (";
+ protected final String TEXT_258 = ".class.equals(adapter)) {" + NL + "\t\t\t\t\treturn elementTypeCopy;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor(";
+ protected final String TEXT_259 = " source, ";
+ protected final String TEXT_260 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_261 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_262 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_263 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected ";
+ protected final String TEXT_264 = " getSemanticAdapter() {" + NL + "\t\treturn mySemanticAdapter;" + NL + "\t}" + NL + "}";
+ protected final String TEXT_265 = NL + NL + "}";
+ protected final String TEXT_266 = NL;
protected final String getFeatureValueGetter(String containerName, GenFeature feature, boolean isContainerEObject, ImportAssistant importManager) {
StringBuffer result = new StringBuffer();
@@ -254,6 +384,9 @@ public class DiagramCanonicalEditPolicyGenerator {
{
StringBuffer stringBuffer = new StringBuffer();
+// TODO: move this attribute to the genmodel
+final boolean isSynchronizedDiagram = true;
+
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
stringBuffer.append(TEXT_1);
@@ -276,379 +409,611 @@ if (copyrightText != null && copyrightText.trim().length() > 0) {
stringBuffer.append(TEXT_8);
GenClass modelElementInterface = genDiagram.getDomainDiagramElement();
-if (modelElementInterface != null) {
- Collection genNodes = genDiagram.getTopLevelNodes();
+if (modelElementInterface != null && isSynchronizedDiagram) {
+ List genNodes = genDiagram.getTopLevelNodes();
stringBuffer.append(TEXT_9);
stringBuffer.append(TEXT_10);
stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_11);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_12);
+ stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ stringBuffer.append(TEXT_13);
-if (genNodes.size() > 0) {
- String modelElementInterfaceName = importManager.getImportedName(modelElementInterface.getQualifiedInterfaceName());
+for (int nodeIndex = 0; nodeIndex < genNodes.size(); nodeIndex++) {
+ if (nodeIndex == 0) {
- stringBuffer.append(TEXT_13);
- stringBuffer.append(modelElementInterfaceName);
stringBuffer.append(TEXT_14);
- stringBuffer.append(modelElementInterfaceName);
- stringBuffer.append(TEXT_15);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_15);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_16);
-
-}
-
-
-for (Iterator it = genNodes.iterator(); it.hasNext();) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet.isPhantomElement()) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (childMetaFeature.isListType()) {
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_17);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_18);
- stringBuffer.append(getFeatureValueGetter("modelElement", childMetaFeature, false, importManager));
+ }
stringBuffer.append(TEXT_19);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_20);
- } else {
+GenNode nextNode = (GenNode) genNodes.get(nodeIndex);
+TypeModelFacet typeModelFacet = nextNode.getModelFacet();
+if (typeModelFacet.isPhantomElement()) {
+// Skipping top-level phantoms
+ continue;
+}
+GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
+
+if (nodeIndex == 0) {
+ stringBuffer.append(TEXT_20);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_21);
- stringBuffer.append(getFeatureValueGetter("modelElement", childMetaFeature, false, importManager));
- stringBuffer.append(TEXT_22);
- }
+}
+if (childMetaFeature.isListType()) {
+
+ stringBuffer.append(TEXT_22);
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(getFeatureValueGetter("modelObject", childMetaFeature, true, importManager));
stringBuffer.append(TEXT_24);
- stringBuffer.append(nextNode.getVisualID());
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_25);
-
- if (childMetaFeature.isListType()) {
-
+ } else {
stringBuffer.append(TEXT_26);
-
- }
-}
-
+ stringBuffer.append(getFeatureValueGetter("modelObject", childMetaFeature, true, importManager));
stringBuffer.append(TEXT_27);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_28);
}
+ stringBuffer.append(TEXT_28);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
stringBuffer.append(TEXT_29);
-
-if (modelElementInterface != null) {
- String modelElementInterfaceName = importManager.getImportedName(modelElementInterface.getQualifiedInterfaceName());
-
+ stringBuffer.append(nextNode.getVisualID());
stringBuffer.append(TEXT_30);
- stringBuffer.append(modelElementInterfaceName);
stringBuffer.append(TEXT_31);
- stringBuffer.append(modelElementInterfaceName);
stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ if (childMetaFeature.isListType()) {
stringBuffer.append(TEXT_33);
}
+ }
stringBuffer.append(TEXT_34);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_35);
-
-for (Iterator it = genDiagram.getLinks().iterator(); it.hasNext();) {
- GenLink nextGenLink = (GenLink) it.next();
- if (nextGenLink.getModelFacet() instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet typeLinkFacet = (TypeLinkModelFacet) nextGenLink.getModelFacet();
- GenFeature nextLinkTargetFeature = typeLinkFacet.getTargetMetaFeature();
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_36);
- stringBuffer.append(nextGenLink.getVisualID());
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_37);
- stringBuffer.append(nextLinkTargetFeature.isListType() ? "(EObject) " : "");
- stringBuffer.append(getFeatureValueGetter("relationship", nextLinkTargetFeature, true, importManager));
- stringBuffer.append(nextLinkTargetFeature.isListType() ? ".get(0)" : "");
+ } else {
stringBuffer.append(TEXT_38);
-
- }
-}
-
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_39);
-
-{
- GenClass domainMetaclass = genDiagram.getDomainDiagramElement();
- GenContainerBase genContainerBase = genDiagram;
- if (domainMetaclass != null) {
-
+ stringBuffer.append(importManager.getImportedName("java.util.Collections"));
stringBuffer.append(TEXT_40);
-
-boolean isDiagram = genContainerBase instanceof GenDiagram;
-
-Collection phantomLinks = new ArrayList();
-for (Iterator it = genDiagram.getLinks().iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
- if (nextLink.getModelFacet() instanceof FeatureModelFacet) {
- FeatureModelFacet nextModelFacet = (FeatureModelFacet) nextLink.getModelFacet();
- if (nextModelFacet.getMetaFeature().isContains()) {
- phantomLinks.add(nextLink);
- }
- }
-}
-
-if (phantomLinks.size() > 0 || isDiagram) {
-
+ }
stringBuffer.append(TEXT_41);
-
- if (isDiagram) {
-
+ stringBuffer.append(importManager.getImportedName("java.util.Collections"));
stringBuffer.append(TEXT_42);
-
- }
-
- if (phantomLinks.size() > 0) {
-
+ if (modelElementInterface != null) {
stringBuffer.append(TEXT_43);
+// Collecting all phantom elements
+Map genClass2Phantom = new LinkedHashMap();
+for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
+ GenTopLevelNode nextTopLevelNode = (GenTopLevelNode) topLevelNodes.next();
+ TypeModelFacet nextModelFacet = nextTopLevelNode.getModelFacet();
+ if (!nextModelFacet.isPhantomElement()) {
+ continue;
}
-
- stringBuffer.append(TEXT_44);
-
+ genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
}
-if (phantomLinks.size() > 0) {
- String domainMetaclassInterfaceName = importManager.getImportedName(domainMetaclass.getQualifiedInterfaceName());
- // Collecting all phantom elements
- Map genClass2Phantom = new LinkedHashMap();
- for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
- GenTopLevelNode nextTopLevelNode = (GenTopLevelNode) topLevelNodes.next();
- TypeModelFacet nextModelFacet = nextTopLevelNode.getModelFacet();
- if (!nextModelFacet.isPhantomElement()) {
- continue;
- }
- genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
- }
-
+ stringBuffer.append(TEXT_44);
+ if (isSynchronizedDiagram && genClass2Phantom.size() > 0) {
stringBuffer.append(TEXT_45);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ }
stringBuffer.append(TEXT_46);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ if (isSynchronizedDiagram && genClass2Phantom.size() > 0) {
stringBuffer.append(TEXT_47);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
- stringBuffer.append(TEXT_48);
stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_49);
+ stringBuffer.append(TEXT_48);
stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ stringBuffer.append(TEXT_49);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_50);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_51);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
stringBuffer.append(TEXT_52);
- stringBuffer.append(domainMetaclassInterfaceName);
stringBuffer.append(TEXT_53);
- stringBuffer.append(domainMetaclassInterfaceName);
+
+if (!genClass2Phantom.isEmpty()) {
+
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
stringBuffer.append(TEXT_54);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_56);
- stringBuffer.append(importManager.getImportedName("java.util.Map"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_57);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
stringBuffer.append(TEXT_58);
+ }
- for (Iterator it = phantomLinks.iterator(); it.hasNext();) {
- GenLink phantomLink = (GenLink) it.next();
- FeatureModelFacet linkFMF = (FeatureModelFacet) phantomLink.getModelFacet();
- GenFeature genFeature = linkFMF.getMetaFeature();
+ for (Iterator phantoms = genClass2Phantom.values().iterator(); phantoms.hasNext();) {
+ GenTopLevelNode phantomNode = (GenTopLevelNode) phantoms.next();
stringBuffer.append(TEXT_59);
- stringBuffer.append(importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName()));
+ stringBuffer.append(phantomNode.getVisualID());
stringBuffer.append(TEXT_60);
- stringBuffer.append(genFeature.getFeatureAccessorName());
+
+ }
+
stringBuffer.append(TEXT_61);
- GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
- if (phantomNode != null) {
- if (genFeature.isListType()) {
+if (!genClass2Phantom.isEmpty()) {
stringBuffer.append(TEXT_62);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ }
stringBuffer.append(TEXT_63);
- stringBuffer.append(getFeatureValueGetter("modelElement", genFeature, true, importManager));
stringBuffer.append(TEXT_64);
-
- } else {
-
stringBuffer.append(TEXT_65);
- stringBuffer.append(getFeatureValueGetter("modelElement", genFeature, true, importManager));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_66);
-
- }
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_67);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_68);
- stringBuffer.append(phantomNode.getVisualID());
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_69);
- if (genFeature.isListType()) {
stringBuffer.append(TEXT_70);
- }
stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName(genDiagram.getSemanticHintsQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_72);
- stringBuffer.append(phantomLink.getUniqueIdentifier());
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_73);
- stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
stringBuffer.append(TEXT_74);
- stringBuffer.append(phantomLink.getUniqueIdentifier());
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_75);
-
- if (genFeature.isListType()) {
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_76);
-
- }
- }
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_77);
-
- }
-
- if (isDiagram) {
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_78);
-
- }
-
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
stringBuffer.append(TEXT_79);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_80);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
stringBuffer.append(TEXT_82);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName("java.util.Map"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages"));
stringBuffer.append(TEXT_85);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_87);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.ICommand"));
stringBuffer.append(TEXT_89);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand"));
stringBuffer.append(TEXT_90);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
stringBuffer.append(TEXT_91);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.EtoolsProxyCommand"));
stringBuffer.append(TEXT_92);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand"));
stringBuffer.append(TEXT_93);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter"));
stringBuffer.append(TEXT_94);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
stringBuffer.append(TEXT_95);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.ICommand"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_96);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand"));
+ stringBuffer.append(importManager.getImportedName("java.util.List"));
stringBuffer.append(TEXT_97);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_98);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.EtoolsProxyCommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_99);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand"));
+ }
stringBuffer.append(TEXT_100);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter"));
+ stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_101);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
+ stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
stringBuffer.append(TEXT_102);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
+ stringBuffer.append(importManager.getImportedName("java.util.Map"));
stringBuffer.append(TEXT_103);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
+ stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
stringBuffer.append(TEXT_104);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("java.util.Map"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_110);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_111);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_112);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_113);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+
+for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.hasNext();) {
+ GenContainerBase nextContainer = (GenContainerBase) containers.next();
+ if (nextContainer instanceof GenCompartment) {
+ continue;
+ }
+
stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(nextContainer.getVisualID());
stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+
+}
stringBuffer.append(TEXT_116);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_117);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
stringBuffer.append(TEXT_119);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
+ stringBuffer.append(importManager.getImportedName("java.util.Collection"));
stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
stringBuffer.append(TEXT_121);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_122);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
stringBuffer.append(TEXT_123);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
stringBuffer.append(TEXT_124);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
stringBuffer.append(TEXT_125);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil"));
stringBuffer.append(TEXT_126);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"));
stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
stringBuffer.append(TEXT_128);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest"));
stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants"));
stringBuffer.append(TEXT_130);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants"));
stringBuffer.append(TEXT_131);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
stringBuffer.append(TEXT_132);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
stringBuffer.append(TEXT_133);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(TEXT_134);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand"));
+ stringBuffer.append(TEXT_135);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(TEXT_136);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_137);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(TEXT_138);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(TEXT_139);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
+ stringBuffer.append(TEXT_140);
+boolean createPhantoms = false;
+List genLinks = genDiagram.getLinks();
+String pluginActivatorClass = importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName());
+
+ stringBuffer.append(TEXT_141);
+ stringBuffer.append(TEXT_142);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_143);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
+ stringBuffer.append(TEXT_144);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
+ stringBuffer.append(TEXT_145);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_146);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
+ stringBuffer.append(TEXT_147);
+
+for (Iterator it = genLinks.iterator(); it.hasNext();) {
+ GenLink nextLink = (GenLink) it.next();
+ if (nextLink.getModelFacet() instanceof TypeLinkModelFacet) {
+ TypeLinkModelFacet typeLinkModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
+ GenFeature childMetaFeature = typeLinkModelFacet.getChildMetaFeature();
+
+ stringBuffer.append(TEXT_148);
+ stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
+ stringBuffer.append(TEXT_149);
+ stringBuffer.append(childMetaFeature.getGenClass().getClassifierAccessorName());
+ stringBuffer.append(TEXT_150);
+ if (childMetaFeature.isListType()) {
+ stringBuffer.append(TEXT_151);
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_152);
+ stringBuffer.append(getFeatureValueGetter("container", childMetaFeature, true, importManager));
+ stringBuffer.append(TEXT_153);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_154);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_155);
+ } else {
+ stringBuffer.append(TEXT_156);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_157);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_158);
+ stringBuffer.append(getFeatureValueGetter("container", childMetaFeature, true, importManager));
+ stringBuffer.append(TEXT_159);
+ }
+ stringBuffer.append(TEXT_160);
+ stringBuffer.append(getFeatureValueGetter("nextValue", typeLinkModelFacet.getTargetMetaFeature(), true, importManager));
+ stringBuffer.append(TEXT_161);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_162);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_163);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_164);
+ if (typeLinkModelFacet.getSourceMetaFeature() != null) {
+ stringBuffer.append(TEXT_165);
+ stringBuffer.append(getFeatureValueGetter("nextValue", typeLinkModelFacet.getSourceMetaFeature(), true, importManager));
+ stringBuffer.append(TEXT_166);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_167);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_168);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_169);
+ } else {
+ stringBuffer.append(TEXT_170);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_171);
+ }
+ stringBuffer.append(TEXT_172);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(TEXT_173);
+ stringBuffer.append(nextLink.getVisualID());
+ stringBuffer.append(TEXT_174);
+ if (typeLinkModelFacet.getSourceMetaFeature() != null) {
+ stringBuffer.append(TEXT_175);
+ }
+ stringBuffer.append(TEXT_176);
+
+ if (childMetaFeature.isListType()) {
+
+ stringBuffer.append(TEXT_177);
+
+ }
+
+ stringBuffer.append(TEXT_178);
+
+ }
}
+ stringBuffer.append(TEXT_179);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_180);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
+ stringBuffer.append(TEXT_181);
+
+for (int linkIndex = 0; linkIndex < genLinks.size(); linkIndex++) {
+ boolean phantomsOnly = true;
-if (isDiagram) {
+ stringBuffer.append(TEXT_182);
+
+GenLink nextLink = (GenLink) genLinks.get(linkIndex);
+if (false == nextLink.getModelFacet() instanceof FeatureModelFacet) {
+ continue;
+}
+FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
+GenFeature genFeature = linkFMF.getMetaFeature();
+GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
+if (phantomsOnly ? (!genFeature.isContains() || phantomNode == null) : (genFeature.isContains())) {
+// Processing only features which are isPhantoms == phantomsOnly
+ continue;
+}
- stringBuffer.append(TEXT_134);
+ stringBuffer.append(TEXT_183);
+ stringBuffer.append(importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName()));
+ stringBuffer.append(TEXT_184);
+ stringBuffer.append(genFeature.getGenClass().getClassifierAccessorName());
+ stringBuffer.append(TEXT_185);
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_186);
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_187);
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
+ stringBuffer.append(TEXT_188);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_189);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_190);
+ } else {
+ stringBuffer.append(TEXT_191);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_192);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_193);
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
+ stringBuffer.append(TEXT_194);
+ }
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_195);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(TEXT_196);
+ stringBuffer.append(phantomNode.getVisualID());
+ stringBuffer.append(TEXT_197);
+ }
+ stringBuffer.append(TEXT_198);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
+ stringBuffer.append(TEXT_199);
+ stringBuffer.append(nextLink.getUniqueIdentifier());
+ stringBuffer.append(TEXT_200);
+ stringBuffer.append(nextLink.getVisualID());
+ stringBuffer.append(TEXT_201);
+ if (createPhantoms) {
+ stringBuffer.append(TEXT_202);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
+ stringBuffer.append(TEXT_203);
+ stringBuffer.append(pluginActivatorClass);
+ stringBuffer.append(TEXT_204);
+ stringBuffer.append(phantomNode.getUniqueIdentifier());
+ stringBuffer.append(TEXT_205);
+ }
+ stringBuffer.append(TEXT_206);
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_207);
+ }
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_208);
+ }
+ stringBuffer.append(TEXT_209);
}
+for (int linkIndex = 0; linkIndex < genLinks.size(); linkIndex++) {
+ boolean phantomsOnly = false;
+
+ stringBuffer.append(TEXT_210);
- }
+GenLink nextLink = (GenLink) genLinks.get(linkIndex);
+if (false == nextLink.getModelFacet() instanceof FeatureModelFacet) {
+ continue;
+}
+FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
+GenFeature genFeature = linkFMF.getMetaFeature();
+GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
+if (phantomsOnly ? (!genFeature.isContains() || phantomNode == null) : (genFeature.isContains())) {
+// Processing only features which are isPhantoms == phantomsOnly
+ continue;
}
- stringBuffer.append(TEXT_135);
+ stringBuffer.append(TEXT_211);
+ stringBuffer.append(importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName()));
+ stringBuffer.append(TEXT_212);
+ stringBuffer.append(genFeature.getGenClass().getClassifierAccessorName());
+ stringBuffer.append(TEXT_213);
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_214);
+ stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_215);
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
+ stringBuffer.append(TEXT_216);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_217);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_218);
+ } else {
+ stringBuffer.append(TEXT_219);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_220);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_221);
+ stringBuffer.append(getFeatureValueGetter("container", genFeature, true, importManager));
+ stringBuffer.append(TEXT_222);
+ }
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_223);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
+ stringBuffer.append(TEXT_224);
+ stringBuffer.append(phantomNode.getVisualID());
+ stringBuffer.append(TEXT_225);
+ }
+ stringBuffer.append(TEXT_226);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
+ stringBuffer.append(TEXT_227);
+ stringBuffer.append(nextLink.getUniqueIdentifier());
+ stringBuffer.append(TEXT_228);
+ stringBuffer.append(nextLink.getVisualID());
+ stringBuffer.append(TEXT_229);
+ stringBuffer.append(TEXT_230);
+ if (phantomsOnly) {
+ stringBuffer.append(TEXT_231);
+ }
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_232);
+ }
+ stringBuffer.append(TEXT_233);
+ }
+ stringBuffer.append(TEXT_234);
+ stringBuffer.append(TEXT_235);
+ stringBuffer.append(TEXT_236);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
+ stringBuffer.append(TEXT_237);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
+ stringBuffer.append(TEXT_238);
+ stringBuffer.append(TEXT_239);
+ stringBuffer.append(TEXT_240);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
+ stringBuffer.append(TEXT_241);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
+ stringBuffer.append(TEXT_242);
+ stringBuffer.append(TEXT_243);
+
+// an inner class
+
+ stringBuffer.append(TEXT_244);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_245);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_246);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_247);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(TEXT_248);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_249);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_250);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_251);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter"));
+ stringBuffer.append(TEXT_252);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_253);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_254);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ stringBuffer.append(TEXT_255);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ stringBuffer.append(TEXT_256);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(TEXT_257);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType"));
+ stringBuffer.append(TEXT_258);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_259);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_260);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_261);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_262);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_263);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
+ stringBuffer.append(TEXT_264);
+ }
+ stringBuffer.append(TEXT_265);
importManager.emitSortedImports();
- stringBuffer.append(TEXT_136);
+ stringBuffer.append(TEXT_266);
return stringBuffer.toString();
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
index 417640614..43ed78ec4 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
@@ -3,7 +3,7 @@
skeleton="../common.skeleton"%>
<%
// TODO: move this attribute to the genmodel
-final boolean isSynchronizedDiagram = false;
+final boolean isSynchronizedDiagram = true;
final GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
@@ -167,7 +167,7 @@ if (!isSynchronizedDiagram) {
return null;
}
<%if (!isSynchronizedDiagram) {%>
-<%@ include file="initDiagramContents.jetinc"%>
+<%@ include file="../semanticSync.jetinc/initDiagramContents.jetinc"%>
<%}%>
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/Plugin.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/Plugin.javajet
index 2ea7152ba..f4db05e0c 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/Plugin.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/Plugin.javajet
@@ -69,11 +69,9 @@ public class <%=genPlugin.getActivatorClassName()%> extends AbstractUIPlugin {
<%
for (int i = 0; i < genPackages.size(); i++) {
GenPackage genPackage = (GenPackage) genPackages.get(i);
- String domainPackageIPAFInterfaceName = importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName());
String domainPackageInterfaceName = importManager.getImportedName(genPackage.getQualifiedPackageInterfaceName());
String domainPackageEditPluginClassName = importManager.getImportedName(genPackage.getQualifiedEditPluginClassName());
%>
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager")%>.register(new <%=domainPackageIPAFInterfaceName%>());
<%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.internal.util.MetamodelManager")%>.register(<%=domainPackageInterfaceName%>.eINSTANCE, <%=domainPackageEditPluginClassName%>.INSTANCE);
<%}%>
<%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.register();
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/initDiagramContents.jetinc b/plugins/org.eclipse.gmf.codegen/templates/editor/initDiagramContents.jetinc
deleted file mode 100644
index dc1867095..000000000
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/initDiagramContents.jetinc
+++ /dev/null
@@ -1,388 +0,0 @@
-<%
-List genLinks = genDiagram.getLinks();
-
-// Collecting all phantom elements
-Map genClass2Phantom = new LinkedHashMap();
-for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
- GenTopLevelNode nextTopLevelNode = (GenTopLevelNode) topLevelNodes.next();
- TypeModelFacet nextModelFacet = nextTopLevelNode.getModelFacet();
- if (!nextModelFacet.isPhantomElement()) {
- continue;
- }
- genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
-}
-
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
-%>
-
-/**
- * @generated
- */
-private static final Integer LINK_KEY_<%=nextLink.getVisualID()%> = new Integer(<%=nextLink.getVisualID()%>);
-<%
-}
-%>
-
-/**
- * @generated
- */
-private <%=importManager.getImportedName("java.util.Map")%> myLinkVID2EObjectMap = new <%=importManager.getImportedName("java.util.HashMap")%>();
-
-/**
- * @generated
- */
-private <%=importManager.getImportedName("java.util.Map")%> myEObject2NodeMap = new <%=importManager.getImportedName("java.util.HashMap")%>();
-
-/**
- * @generated
- */
-private void initDiagramContents(Diagram diagram, EObject diagramModelObject) {
-<%
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
-%>
- myLinkVID2EObjectMap.put(LINK_KEY_<%=nextLink.getVisualID()%>, new LinkedList());
-<%
-}
-%>
- create<%=genDiagram.getUniqueIdentifier()%>Children(diagram, diagramModelObject);
-<%
-if (!genClass2Phantom.isEmpty()) {
-%>
- Resource resource = diagramModelObject.eResource();
- for (<%=importManager.getImportedName("java.util.Iterator")%> it = resource.getContents().iterator(); it.hasNext();) {
- EObject nextResourceObject = (EObject) it.next();
- if (nextResourceObject == diagramModelObject) {
- continue;
- }
- int nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(diagram, nextResourceObject, "");
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode;
- switch (nodeVID) {
-<%
- for (Iterator phantoms = genClass2Phantom.values().iterator(); phantoms.hasNext();) {
- GenTopLevelNode phantomNode = (GenTopLevelNode) phantoms.next();
-%>
- case <%=phantomNode.getVisualID()%>:
- nextNode = ViewService.createNode(diagram, nextResourceObject, null, <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextResourceObject, nextNode);
- create<%=phantomNode.getUniqueIdentifier()%>Children(nextNode, nextResourceObject);
- break;
-<%
- }
-%>
- }
- }
-<%
-}
-// TODO: remove "createLinks()" method - this task should be done by canonicalEditPolicies
-%>
- createLinks();
- }
-<%
-boolean generateGetCompartment = false;
-
-for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.hasNext();) {
- GenContainerBase nextContainer = (GenContainerBase) containers.next();
-%>
-
-/**
- * @generated
- */
-private void create<%=nextContainer.getUniqueIdentifier()%>Children(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> viewObject, EObject modelObject) {
-<%
- if (nextContainer.getContainedNodes().size() > 0) {
-%>
- EObject nextValue;
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode;
- int nodeVID;
-<%
- } else if (nextContainer instanceof GenNode && ((GenNode) nextContainer).getCompartments().size() > 0) {
-%>
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode;
-<%
- }
-
- for (Iterator children = nextContainer.getContainedNodes().iterator(); children.hasNext();) {
- GenNode nextChild = (GenNode) children.next();
- TypeModelFacet typeModelFacet = nextChild.getModelFacet();
- if (typeModelFacet.isPhantomElement()) {
-// Skipping top-leve phantoms
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (childMetaFeature.isListType()) {
-%>
- for (<%=importManager.getImportedName("java.util.Iterator")%> values = <%=getFeatureValueGetter("modelObject", childMetaFeature, true, importManager)%>.iterator(); values.hasNext();) {
- nextValue = (EObject) values.next();
-<%
- } else {
-%>
- nextValue = <%=getFeatureValueGetter("modelObject", childMetaFeature, true, importManager)%>;
-<%
- }
-%>
- nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
- if (<%=nextChild.getVisualID()%> == nodeVID) {
- nextNode = ViewService.createNode(viewObject, nextValue, null, <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextValue, nextNode);
- create<%=nextChild.getUniqueIdentifier()%>Children(nextNode, nextValue);
- }
-<%
- if (childMetaFeature.isListType()) {
-%>
- }
-<%
- }
- }
-
- if (nextContainer instanceof GenNode) {
- GenNode nextNode = (GenNode) nextContainer;
- for (Iterator compartments = nextNode.getCompartments().iterator(); compartments.hasNext();) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
- generateGetCompartment = true;
-%>
- nextNode = getCompartment(viewObject, "<%=nextCompartment.getTitle()%>");
- if (nextNode != null) {
- create<%=nextCompartment.getUniqueIdentifier()%>Children(nextNode, modelObject);
- }
-<%
- }
- }
- if (false == nextContainer instanceof GenCompartment) {
-%>
- storeLinks(modelObject, viewObject.getDiagram());
-<% }%>
-}
-<%
-}
-
-if (generateGetCompartment) {
-%>
-
-/**
- * @generated
- */
-private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> getCompartment(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> node, String name) {
- for (<%=importManager.getImportedName("java.util.Iterator")%> it = node.getChildren().iterator(); it.hasNext();) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> nextView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) it.next();
- if (nextView instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> && name.equals(nextView.getType())) {
- return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) nextView;
- }
- }
- return null;
-}
-<%
-}
-%>
-
-/**
- *@generated
- */
-private void storeLinks(EObject container, Diagram diagram) {
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EClass")%> containerMetaclass = container.eClass();
- storeFeatureModelFacetLinks(container, containerMetaclass, diagram);
- storeTypeModelFacetLinks(container, containerMetaclass, diagram);
-}
-
-/**
- * @generated
- */
-private void storeTypeModelFacetLinks(EObject container, <%=importManager.getImportedName("org.eclipse.emf.ecore.EClass")%> containerMetaclass, Diagram diagram) {
-<%
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
- if (nextLink.getModelFacet() instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet typeLinkModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- GenFeature childMetaFeature = typeLinkModelFacet.getChildMetaFeature();
-%>
- if (<%=importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childMetaFeature.getGenClass().getClassifierAccessorName()%>().isSuperTypeOf(containerMetaclass)) {
-<% if (childMetaFeature.isListType()) {%>
- for (<%=importManager.getImportedName("java.util.Iterator")%> values = <%=getFeatureValueGetter("container", childMetaFeature, true, importManager)%>.iterator(); values.hasNext();) {
- EObject nextValue = ((EObject) values.next());
-<% } else {%>
- EObject nextValue = (EObject) <%=getFeatureValueGetter("container", childMetaFeature, true, importManager)%>;
-<% }%>
- Object structuralFeatureResult = <%=getFeatureValueGetter("nextValue", typeLinkModelFacet.getTargetMetaFeature(), true, importManager)%>;
- if (structuralFeatureResult instanceof EObject) {
- EObject dst = (EObject) structuralFeatureResult;
-<% if (typeLinkModelFacet.getSourceMetaFeature() != null) {%>
- structuralFeatureResult = <%=getFeatureValueGetter("nextValue", typeLinkModelFacet.getSourceMetaFeature(), true, importManager)%>;
- if (structuralFeatureResult instanceof EObject) {
- EObject src = (EObject) structuralFeatureResult;
-<% } else {%>
- EObject src = nextValue;
-<% }%>
- int linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getLinkWithClassVisualID(nextValue);
- if (<%=nextLink.getVisualID()%> == linkVID) {
- ((<%=importManager.getImportedName("java.util.Collection")%>) myLinkVID2EObjectMap.get(LINK_KEY_<%=nextLink.getVisualID()%>)).add(new LinkDescriptor(src, dst, nextValue, diagram));
- }
-<% if (typeLinkModelFacet.getSourceMetaFeature() != null) {%>
- }
-<% }%>
- }
-<%
- if (childMetaFeature.isListType()) {
-%>
- }
-<%
- }
-%>
- }
-<%
- }
-}
-%>
-}
-
-/**
- *@generated
- */
-private void storeFeatureModelFacetLinks(EObject container, <%=importManager.getImportedName("org.eclipse.emf.ecore.EClass")%> containerMetaclass, Diagram diagram) {
-<%
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
- if (nextLink.getModelFacet() instanceof FeatureModelFacet) {
- FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
- GenFeature genFeature = linkFMF.getMetaFeature();
- GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
-%>
- if (<%=importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=genFeature.getGenClass().getClassifierAccessorName()%>().isSuperTypeOf(containerMetaclass)) {
-<% if (genFeature.isListType()) {%>
- for (<%=importManager.getImportedName("java.util.Iterator")%> destinations = <%=getFeatureValueGetter("container", genFeature, true, importManager)%>.iterator(); destinations.hasNext();) {
- EObject nextDestination = (EObject) destinations.next();
-<% } else {%>
- if (<%=getFeatureValueGetter("container", genFeature, true, importManager)%> instanceof EObject) {
- EObject nextDestination = (EObject) <%=getFeatureValueGetter("container", genFeature, true, importManager)%>;
-<% }%>
- ((<%=importManager.getImportedName("java.util.Collection")%>) myLinkVID2EObjectMap.get(LINK_KEY_<%=nextLink.getVisualID()%>)).add(new LinkDescriptor(container, nextDestination, <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.<%=nextLink.getUniqueIdentifier()%>, diagram));
-<% if (genFeature.isContains() && phantomNode != null) {%>
- int nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(diagram, nextDestination, "");
- if (<%=phantomNode.getVisualID()%> == nodeVID) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode = ViewService.createNode(diagram, nextDestination, null, <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
- myEObject2NodeMap.put(nextDestination, nextNode);
- create<%=phantomNode.getUniqueIdentifier()%>Children(nextNode, nextDestination);
- }
-<% }%>
- }
- }
-<%
- }
-}
-%>
-}
-
-/**
- * @generated
- */
-private void createLinks() {
-<%
-if (genLinks.size() > 0) {
-%>
- <%=importManager.getImportedName("java.util.Collection")%> linkElements;
-<%
-}
-
-for (Iterator it = genLinks.iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
-%>
- linkElements = (<%=importManager.getImportedName("java.util.Collection")%>) myLinkVID2EObjectMap.get(LINK_KEY_<%=nextLink.getVisualID()%>);
- for (<%=importManager.getImportedName("java.util.Iterator")%> it = linkElements.iterator(); it.hasNext();) {
- LinkDescriptor nextLinkDescriptor = (LinkDescriptor) it.next();
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> edge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) ViewService.getInstance().createEdge(nextLinkDescriptor.getSemanticAdapter(), nextLinkDescriptor.getDiagram(), "", <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")%>.APPEND, <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
- if (edge != null) {
- edge.setSource((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) myEObject2NodeMap.get(nextLinkDescriptor.getSource()));
- edge.setTarget((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) myEObject2NodeMap.get(nextLinkDescriptor.getDestination()));
- }
- }
-<%
-}
-%>
-}
-
-/**
- * @generated
- */
-private class LinkDescriptor {
-
- /**
- * @generated
- */
- private EObject mySource;
-
- /**
- * @generated
- */
- private EObject myDestination;
-
- /**
- * @generated
- */
- private IAdaptable mySemanticAdapter;
-
- /**
- * @generated
- */
- private Diagram myDiagram;
-
- /**
- * @generated
- */
- protected LinkDescriptor(EObject source, EObject destination, EObject linkElement, Diagram diagram) {
- this(source, destination, diagram);
- mySemanticAdapter = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter")%>(linkElement);
- }
-
- /**
- * @generated
- */
- protected LinkDescriptor(EObject source, EObject destination, <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType")%> elementType, Diagram diagram) {
- this(source, destination, diagram);
- final <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType")%> elementTypeCopy = elementType;
- mySemanticAdapter = new <%=importManager.getImportedName("org.eclipse.core.runtime.IAdaptable")%>() {
- public Object getAdapter(Class adapter) {
- if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType")%>.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- private LinkDescriptor(EObject source, EObject destination, Diagram diagram) {
- mySource = source;
- myDestination = destination;
- myDiagram = diagram;
- }
-
- /**
- * @generated
- */
- protected EObject getSource() {
- return mySource;
- }
-
- /**
- * @generated
- */
- protected EObject getDestination() {
- return myDestination;
- }
-
- /**
- * @generated
- */
- protected Diagram getDiagram() {
- return myDiagram;
- }
-
- /**
- * @generated
- */
- protected IAdaptable getSemanticAdapter() {
- return mySemanticAdapter;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/policies/ChildContainerCanonicalEditPolicy.javajet b/plugins/org.eclipse.gmf.codegen/templates/policies/ChildContainerCanonicalEditPolicy.javajet
index 9933cf482..a4d176634 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/policies/ChildContainerCanonicalEditPolicy.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/policies/ChildContainerCanonicalEditPolicy.javajet
@@ -2,6 +2,9 @@
imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.*"
skeleton="../common.skeleton"%>
<%
+// TODO: move this attribute to the genmodel
+final boolean isSynchronizedDiagram = true;
+
GenChildContainer genContainer = (GenChildContainer) ((Object[]) argument)[0];
GenDiagram genDiagram = genContainer.getDiagram();
%>
@@ -18,20 +21,26 @@ import org.eclipse.gmf.runtime.notation.View;
* @generated
*/
public class <%=genContainer.getCanonicalEditPolicyClassName()%> extends CanonicalEditPolicy {
+
<%
-{
- Collection genNodes = genContainer.getChildNodes();
- GenNode containerNode;
- if (genContainer instanceof GenCompartment) {
- containerNode = ((GenCompartment) genContainer).getNode();
- } else if (genContainer instanceof GenNode) {
- containerNode = (GenNode) genContainer;
- } else {
- throw new IllegalArgumentException(String.valueOf(genContainer));
- }
- GenClass modelElementInterface = containerNode.getModelFacet().getMetaClass();
+if (isSynchronizedDiagram) {
+ List genNodes = genContainer.getChildNodes();
%>
-<%@ include file="getSemanticChildrenList.jetinc"%>
+<%@ include file="../semanticSync.jetinc/getSemanticChildrenList.jetinc"%>
+<%} else {%>
+ /**
+ * @generated
+ */
+ protected <%=importManager.getImportedName("java.util.List")%> getSemanticChildrenList() {
+ return <%=importManager.getImportedName("java.util.Collections")%>.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean shouldDeleteView(View view) {
+ return <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")%>.resolveSemanticElement(view) == null;
+ }
<%}%>
/**
@@ -40,15 +49,10 @@ public class <%=genContainer.getCanonicalEditPolicyClassName()%> extends Canonic
protected String getFactoryHint(IAdaptable elementAdapter) {
return "";
}
-<%
-if (genContainer instanceof GenNode) {
- GenClass domainMetaclass = ((GenNode) genContainer).getModelFacet().getMetaClass();
- GenContainerBase genContainerBase = genContainer;
-%>
-<%@ include file="refreshSemantic.jetinc"%>
-<%
-}
-%>
+
+<%if (genContainer instanceof GenNode && isSynchronizedDiagram) {%>
+<%@ include file="../semanticSync.jetinc/refreshSemanticNode.jetinc"%>
+<%}%>
}
<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.codegen/templates/policies/DiagramCanonicalEditPolicy.javajet b/plugins/org.eclipse.gmf.codegen/templates/policies/DiagramCanonicalEditPolicy.javajet
index 1362a03b6..789dcbde8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/policies/DiagramCanonicalEditPolicy.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/policies/DiagramCanonicalEditPolicy.javajet
@@ -2,18 +2,18 @@
imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.*"
skeleton="../common.skeleton"%>
<%
+// TODO: move this attribute to the genmodel
+final boolean isSynchronizedDiagram = true;
+
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
%>
<%@ include file="../copyright4java.jetinc"%>
package <%=genDiagram.getEditPoliciesPackageName()%>;
<%ImportUtil importManager = new ImportUtil(genDiagram.getEditPoliciesPackageName());%>
-import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Collection;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;
-import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.emf.ecore.EObject;
@@ -23,88 +23,54 @@ import org.eclipse.emf.ecore.EObject;
* @generated
*/
public class <%=genDiagram.getCanonicalEditPolicyClassName()%> extends CanonicalConnectionEditPolicy {
+
<%
GenClass modelElementInterface = genDiagram.getDomainDiagramElement();
-if (modelElementInterface != null) {
- Collection genNodes = genDiagram.getTopLevelNodes();
+if (modelElementInterface != null && isSynchronizedDiagram) {
+ List genNodes = genDiagram.getTopLevelNodes();
%>
-<%@ include file="getSemanticChildrenList.jetinc"%>
+<%@ include file="../semanticSync.jetinc/getSemanticChildrenList.jetinc"%>
+<%} else {%>
+
+ /**
+ * @generated
+ */
+ protected <%=importManager.getImportedName("java.util.List")%> getSemanticChildrenList() {
+ return <%=importManager.getImportedName("java.util.Collections")%>.EMPTY_LIST;
+ }
<%}%>
/**
* @generated
*/
protected List getSemanticConnectionsList() {
- List result = new LinkedList();
-<%
-if (modelElementInterface != null) {
- String modelElementInterfaceName = importManager.getImportedName(modelElementInterface.getQualifiedInterfaceName());
-%>
- Diagram diagram = (Diagram) getHost().getModel();
- <%=modelElementInterfaceName%> modelElement = (<%=modelElementInterfaceName%>) diagram.getElement();
- for (Iterator diagramElements = modelElement.eContents().iterator(); diagramElements.hasNext();) {
- EObject nextDiagramElement = (EObject) diagramElements.next();
- for (Iterator childElements = nextDiagramElement.eContents().iterator(); childElements.hasNext();) {
- EObject nextChild = (EObject) childElements.next();
- if (<%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getLinkWithClassVisualID(nextChild) != -1) {
- result.add(nextChild);
- }
- }
- }
-<%}%>
- return result;
+ return <%=importManager.getImportedName("java.util.Collections")%>.EMPTY_LIST;
}
/**
* @generated
*/
protected EObject getSourceElement(EObject relationship) {
- return relationship.eContainer();
+ return null;
}
/**
* @generated
*/
protected EObject getTargetElement(EObject relationship) {
- int vID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getLinkWithClassVisualID(relationship);
- switch (vID) {
-<%
-for (Iterator it = genDiagram.getLinks().iterator(); it.hasNext();) {
- GenLink nextGenLink = (GenLink) it.next();
- if (nextGenLink.getModelFacet() instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet typeLinkFacet = (TypeLinkModelFacet) nextGenLink.getModelFacet();
- GenFeature nextLinkTargetFeature = typeLinkFacet.getTargetMetaFeature();
-%>
- case <%=nextGenLink.getVisualID()%>:
- return <%=nextLinkTargetFeature.isListType() ? "(EObject) " : ""%><%=getFeatureValueGetter("relationship", nextLinkTargetFeature, true, importManager)%><%=nextLinkTargetFeature.isListType() ? ".get(0)" : ""%>;
-<%
- }
-}
-%>
- }
return null;
}
/**
- * For now we are skipping links which was generated based on "GenLinkReferenceOnly" classes
- * since they do not handle any domain model objects inside, so we can not process them using
- * CanonicalConnectionEditPolicy class
- *
* @generated
*/
protected boolean shouldIncludeConnection(Edge connector, Collection children) {
- return super.shouldIncludeConnection(connector, children) && connector.getElement() != null;
- }
-<%
-{
- GenClass domainMetaclass = genDiagram.getDomainDiagramElement();
- GenContainerBase genContainerBase = genDiagram;
- if (domainMetaclass != null) {
-%>
-<%@ include file="refreshSemantic.jetinc" %>
-<%
+ return false;
}
-}
-%>
+
+<%if (modelElementInterface != null) {%>
+<%@ include file="../semanticSync.jetinc/refreshSemanticDiagram.jetinc"%>
+<%}%>
+
}
<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.codegen/templates/policies/getSemanticChildrenList.jetinc b/plugins/org.eclipse.gmf.codegen/templates/policies/getSemanticChildrenList.jetinc
deleted file mode 100644
index 9d8358f21..000000000
--- a/plugins/org.eclipse.gmf.codegen/templates/policies/getSemanticChildrenList.jetinc
+++ /dev/null
@@ -1,57 +0,0 @@
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("java.util.List")%> getSemanticChildrenList() {
- List result = new <%=importManager.getImportedName("java.util.LinkedList")%>();
-<%
-if (genNodes.size() > 0) {
- String modelElementInterfaceName = importManager.getImportedName(modelElementInterface.getQualifiedInterfaceName());
-%>
- <%=modelElementInterfaceName%> modelElement = (<%=modelElementInterfaceName%>) ((View) getHost().getModel()).getElement();
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue;
- int nodeVID;
-<%
-}
-%>
-<%
-for (Iterator it = genNodes.iterator(); it.hasNext();) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet.isPhantomElement()) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (childMetaFeature.isListType()) {
-%>
- for (<%=importManager.getImportedName("java.util.Iterator")%> it = <%=getFeatureValueGetter("modelElement", childMetaFeature, false, importManager)%>.iterator(); it.hasNext();) {
- nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next();
-<%
- } else {
-%>
- nextValue = <%=getFeatureValueGetter("modelElement", childMetaFeature, false, importManager)%>;
-<%
- }
-%>
- nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID((View) getHost().getModel(), nextValue, "");
- if (<%=nextNode.getVisualID()%> == nodeVID) {
- result.add(nextValue);
- }
-<%
- if (childMetaFeature.isListType()) {
-%>
- }
-<%
- }
-}
-%>
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean shouldDeleteView(View view) {
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> domainModelElement = view.getElement();
- return domainModelElement != null && domainModelElement != ((View) getHost().getModel()).getElement() && super.shouldDeleteView(view);
- } \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/policies/refreshSemantic.jetinc b/plugins/org.eclipse.gmf.codegen/templates/policies/refreshSemantic.jetinc
deleted file mode 100644
index 9e39cd41a..000000000
--- a/plugins/org.eclipse.gmf.codegen/templates/policies/refreshSemantic.jetinc
+++ /dev/null
@@ -1,298 +0,0 @@
-<%
-boolean isDiagram = genContainerBase instanceof GenDiagram;
-
-Collection phantomLinks = new ArrayList();
-for (Iterator it = genDiagram.getLinks().iterator(); it.hasNext();) {
- GenLink nextLink = (GenLink) it.next();
- if (nextLink.getModelFacet() instanceof FeatureModelFacet) {
- FeatureModelFacet nextModelFacet = (FeatureModelFacet) nextLink.getModelFacet();
- if (nextModelFacet.getMetaFeature().isContains()) {
- phantomLinks.add(nextLink);
- }
- }
-}
-
-if (phantomLinks.size() > 0 || isDiagram) {
-%>
-
-/**
- * @generated
- */
-protected void refreshSemantic() {
- super.refreshSemantic();
-<%
- if (isDiagram) {
-%>
- refreshReferenceOnlyConnections();
-<%
- }
-
- if (phantomLinks.size() > 0) {
-%>
- refreshPhantoms();
-<%
- }
-%>
-}
-<%
-}
-
-if (phantomLinks.size() > 0) {
- String domainMetaclassInterfaceName = importManager.getImportedName(domainMetaclass.getQualifiedInterfaceName());
- // Collecting all phantom elements
- Map genClass2Phantom = new LinkedHashMap();
- for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
- GenTopLevelNode nextTopLevelNode = (GenTopLevelNode) topLevelNodes.next();
- TypeModelFacet nextModelFacet = nextTopLevelNode.getModelFacet();
- if (!nextModelFacet.isPhantomElement()) {
- continue;
- }
- genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
- }
-%>
-
-/**
- * @generated
- */
-private class PhantomLinkInfo {
-
- /**
- * @generated
- */
- private EObject myDst;
-
- /**
- * @generated
- */
- private int myIndex;
-
- /**
- * @generated
- */
- private String myType;
-
- /**
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType")%> myElementType;
-
- /**
- * @generated
- */
- private PhantomLinkInfo(EObject dst, int index, String linkType, <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType")%> elementType) {
- myDst = dst;
- myIndex = index;
- myType = linkType;
- myElementType = elementType;
- }
-
- /**
- * @generated
- */
- private PhantomLinkInfo(EObject dst, String linkType, <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType")%> elementType) {
- this(dst, 0, linkType, elementType);
- }
-
-}
-
-/**
- * @generated
- */
-private void refreshPhantoms() {
- <%=importManager.getImportedName("java.util.Collection")%> phantomNodes = new <%=importManager.getImportedName("java.util.LinkedList")%>();
- <%=importManager.getImportedName("java.util.Collection")%> phantomLinks = new <%=importManager.getImportedName("java.util.LinkedList")%>();
- <%=domainMetaclassInterfaceName%> modelElement = (<%=domainMetaclassInterfaceName%>) ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) getHost().getModel()).getElement();
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EClass")%> modelElementMetaclass = modelElement.eClass();
- <%=importManager.getImportedName("java.util.Map")%> eObject2ViewMap = new <%=importManager.getImportedName("java.util.HashMap")%>();
-<%
- for (Iterator it = phantomLinks.iterator(); it.hasNext();) {
- GenLink phantomLink = (GenLink) it.next();
- FeatureModelFacet linkFMF = (FeatureModelFacet) phantomLink.getModelFacet();
- GenFeature genFeature = linkFMF.getMetaFeature();
-%>
- if (-1 != modelElementMetaclass.getFeatureID(<%=importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=genFeature.getFeatureAccessorName()%>())) {
-<%
- GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
- if (phantomNode != null) {
- if (genFeature.isListType()) {
-%>
- int linkIndex = 0;
- for (<%=importManager.getImportedName("java.util.Iterator")%> values = <%=getFeatureValueGetter("modelElement", genFeature, true, importManager)%>.iterator(); values.hasNext(); linkIndex++) {
- EObject nextValue = (EObject) values.next();
-<%
- } else {
-%>
- EObject nextValue = <%=getFeatureValueGetter("modelElement", genFeature, true, importManager)%>;
-<%
- }
-%>
- int nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(getDiagram(), nextValue, "");
- if (<%=phantomNode.getVisualID()%> == nodeVID) {
- phantomNodes.add(nextValue);
- phantomLinks.add(new PhantomLinkInfo(nextValue<%if (genFeature.isListType()) {%>, linkIndex<%}%>, <%=importManager.getImportedName(genDiagram.getSemanticHintsQualifiedClassName())%>.<%=phantomLink.getUniqueIdentifier()%>, <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.<%=phantomLink.getUniqueIdentifier()%>));
- }
-<%
- if (genFeature.isListType()) {
-%>
- }
-<%
- }
- }
-%>
- }
-<%
- }
-
- if (isDiagram) {
-%>
-
- for (Iterator resourceObjects = modelElement.eResource().getContents().iterator(); resourceObjects.hasNext();) {
- EObject nextResourceEObject = (EObject) resourceObjects.next();
- if (nextResourceEObject != modelElement) {
- phantomNodes.add(nextResourceEObject);
- }
- }
-<%
- }
-%>
-
- for (Iterator diagramNodes = getDiagram().getChildren().iterator(); diagramNodes.hasNext();) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> nextView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) diagramNodes.next();
- EObject nextViewElement = nextView.getElement();
- if (phantomNodes.contains(nextViewElement)) {
- phantomNodes.remove(nextViewElement);
- eObject2ViewMap.put(nextViewElement, nextView);
- }
- }
-
- for (Iterator diagramEdges = getDiagram().getEdges().iterator(); diagramEdges.hasNext();) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> nextEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) diagramEdges.next();
- if (nextEdge.getSource().getElement() != modelElement) {
- continue;
- }
- EObject target = nextEdge.getTarget().getElement();
- String linkType = nextEdge.getType();
- for (Iterator linkInfos = phantomLinks.iterator(); linkInfos.hasNext();) {
- PhantomLinkInfo nextLinkInfo = (PhantomLinkInfo) linkInfos.next();
- if (nextLinkInfo.myDst == target && nextLinkInfo.myType.equals(linkType)) {
- linkInfos.remove();
- break;
- }
- }
- }
-
- createPhantomNodes(phantomNodes, eObject2ViewMap);
- createPhantomLinks(phantomLinks, eObject2ViewMap);
-}
-
-/**
- * @generated
- */
-private void createPhantomNodes(<%=importManager.getImportedName("java.util.Collection")%> nodes, <%=importManager.getImportedName("java.util.Map")%> eObject2ViewMap) {
- if (nodes.isEmpty()) {
- return;
- }
- <%=importManager.getImportedName("java.util.List")%> descriptors = new <%=importManager.getImportedName("java.util.ArrayList")%>();
- for (Iterator elements = nodes.iterator(); elements.hasNext();) {
- EObject element = (EObject)elements.next();
- CreateViewRequest.ViewDescriptor descriptor = getViewDescriptor(element);
- descriptors.add(descriptor);
- }
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest")%> request = getCreateViewRequest(descriptors);
- <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> diagramEditPart = getDiagramEditPart();
- <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> cmd = diagramEditPart.getCommand(request);
- if (cmd == null) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand")%> cc = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand")%>(<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages")%>.AddCommand_Label);
- for (Iterator descriptorsIterator = descriptors.iterator(); descriptorsIterator.hasNext();) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest")%>.ViewDescriptor descriptor = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest")%>.ViewDescriptor) descriptorsIterator.next();
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.ICommand")%> createCommand = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand")%>(((<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart")%>) getHost()).getEditingDomain(), descriptor, getDiagram());
- cc.compose(createCommand);
- }
- cmd = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.EtoolsProxyCommand")%>(cc);
- }
-
- if ( cmd != null && cmd.canExecute() ) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand")%>.makeMutable(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter")%>(((<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart")%>) diagramEditPart).getNotationView())).execute();
- executeCommand(cmd);
- <%=importManager.getImportedName("java.util.List")%> adapters = (<%=importManager.getImportedName("java.util.List")%>) request.getNewObject();
- makeViewsImmutable(adapters);
- for (Iterator viewAdapters = adapters.iterator(); viewAdapters.hasNext();) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> createdView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) ((<%=importManager.getImportedName("org.eclipse.core.runtime.IAdaptable")%>) viewAdapters.next()).getAdapter(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>.class);
- if (createdView.getElement() != null) {
- eObject2ViewMap.put(createdView.getElement(), createdView);
- }
- }
- }
- diagramEditPart.refresh();
-}
-
-/**
- * @generated
- */
-private void createPhantomLinks(<%=importManager.getImportedName("java.util.Collection")%> linkInfos, <%=importManager.getImportedName("java.util.Map")%> eObject2ViewMap) {
- if (linkInfos.isEmpty()) {
- return;
- }
- for (Iterator linkInfoIterator = linkInfos.iterator(); linkInfoIterator.hasNext();) {
- final PhantomLinkInfo nextLinkInfo = (PhantomLinkInfo) linkInfoIterator.next();
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> dstView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) eObject2ViewMap.get(nextLinkInfo.myDst);
- if (dstView == null) {
- continue;
- }
- <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> targetEditPart = (<%=importManager.getImportedName("org.eclipse.gef.EditPart")%>) getHost().getViewer().getEditPartRegistry().get(dstView);
- <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> sourceEditPart = getHost();
- String factoryHint = "";
- <%=importManager.getImportedName("org.eclipse.core.runtime.IAdaptable")%> adapter = new <%=importManager.getImportedName("org.eclipse.core.runtime.IAdaptable")%>() {
- public Object getAdapter(Class adapter) {
- if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.type.core.IElementType")%>.class.isAssignableFrom(adapter)) {
- return nextLinkInfo.myElementType;
- }
- return null;
- }
- };
-
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest")%>.ConnectionViewDescriptor descriptor = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest")%>.ConnectionViewDescriptor(adapter, getFactoryHint(adapter, factoryHint), <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")%>.APPEND, false, ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart")%>) getHost()).getDiagramPreferencesHint());
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest")%> ccr = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest")%>(descriptor);
- ccr.setType(<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants")%>.REQ_CONNECTION_START);
- ccr.setSourceEditPart(sourceEditPart);
- sourceEditPart.getCommand(ccr);
- ccr.setTargetEditPart(targetEditPart);
- ccr.setType(<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants")%>.REQ_CONNECTION_END);
- <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> cmd = targetEditPart.getCommand(ccr);
- if (cmd != null && cmd.canExecute()) {
- executeCommand(cmd);
- <%=importManager.getImportedName("org.eclipse.core.runtime.IAdaptable")%> viewAdapter = (<%=importManager.getImportedName("org.eclipse.core.runtime.IAdaptable")%>) ccr.getNewObject();
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand")%>.makeImmutable(viewAdapter).execute();
- }
- }
-}
-
-/**
- * @generated
- */
-private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> getDiagram() {
- return ((View) getHost().getModel()).getDiagram();
-}
-
-/**
- * @generated
- */
-private <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> getDiagramEditPart() {
- return (<%=importManager.getImportedName("org.eclipse.gef.EditPart")%>) getHost().getViewer().getEditPartRegistry().get(getDiagram());
-}
-<%
-}
-
-
-if (isDiagram) {
-%>
-
-/**
- * @generated
- */
-private void refreshReferenceOnlyConnections() {
-// TODO: implement this method
-}
-<%
-}
-%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/class2PhantomsCollector.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/class2PhantomsCollector.jetinc
new file mode 100644
index 000000000..b343586fa
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/class2PhantomsCollector.jetinc
@@ -0,0 +1,12 @@
+<%
+// Collecting all phantom elements
+Map genClass2Phantom = new LinkedHashMap();
+for (Iterator topLevelNodes = genDiagram.getTopLevelNodes().iterator(); topLevelNodes.hasNext();) {
+ GenTopLevelNode nextTopLevelNode = (GenTopLevelNode) topLevelNodes.next();
+ TypeModelFacet nextModelFacet = nextTopLevelNode.getModelFacet();
+ if (!nextModelFacet.isPhantomElement()) {
+ continue;
+ }
+ genClass2Phantom.put(nextModelFacet.getMetaClass(), nextTopLevelNode);
+}
+%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_footer.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_footer.jetinc
new file mode 100644
index 000000000..3dcad30d1
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_footer.jetinc
@@ -0,0 +1,4 @@
+<%
+if (!genClass2Phantom.isEmpty()) {
+%> }
+}<%}%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc
new file mode 100644
index 000000000..0575d346c
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc
@@ -0,0 +1,10 @@
+<%
+if (!genClass2Phantom.isEmpty()) {
+%><%=importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")%> resource = diagramModelObject.eResource();
+for (<%=importManager.getImportedName("java.util.Iterator")%> it = resource.getContents().iterator(); it.hasNext();) {
+ <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextResourceObject = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next();
+ if (nextResourceObject == diagramModelObject) {
+ continue;
+ }
+ int nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(diagram, nextResourceObject, "");
+ switch (nodeVID) {<%}%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_footer.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_footer.jetinc
new file mode 100644
index 000000000..980c3229e
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_footer.jetinc
@@ -0,0 +1,7 @@
+<% if (phantomsOnly) {%>
+ }
+<% }
+ if (genFeature.isListType()) {%>
+ }
+<% }%>
+ } \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc
new file mode 100644
index 000000000..d9e3c3bb7
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc
@@ -0,0 +1,23 @@
+<%
+GenLink nextLink = (GenLink) genLinks.get(linkIndex);
+if (false == nextLink.getModelFacet() instanceof FeatureModelFacet) {
+ continue;
+}
+FeatureModelFacet linkFMF = (FeatureModelFacet) nextLink.getModelFacet();
+GenFeature genFeature = linkFMF.getMetaFeature();
+GenTopLevelNode phantomNode = (GenTopLevelNode) genClass2Phantom.get(genFeature.getTypeGenClass());
+if (phantomsOnly ? (!genFeature.isContains() || phantomNode == null) : (genFeature.isContains())) {
+// Processing only features which are isPhantoms == phantomsOnly
+ continue;
+}
+%> if (<%=importManager.getImportedName(genFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=genFeature.getGenClass().getClassifierAccessorName()%>().isSuperTypeOf(containerMetaclass)) {
+<% if (genFeature.isListType()) {%>
+ for (<%=importManager.getImportedName("java.util.Iterator")%> destinations = <%=getFeatureValueGetter("container", genFeature, true, importManager)%>.iterator(); destinations.hasNext();) {
+ <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextDestination = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) destinations.next();
+<% } else {%>
+ <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextDestination = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%=getFeatureValueGetter("container", genFeature, true, importManager)%>;
+<% }%>
+<% if (phantomsOnly) {%>
+ int nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(diagram, nextDestination, "");
+ if (<%=phantomNode.getVisualID()%> == nodeVID) {
+<% }%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_footer.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_footer.jetinc
new file mode 100644
index 000000000..a07d6d95c
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_footer.jetinc
@@ -0,0 +1,4 @@
+ }
+<%if (childMetaFeature.isListType()) {%>
+ }
+<%}%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc
new file mode 100644
index 000000000..84309484a
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc
@@ -0,0 +1,22 @@
+<%
+GenNode nextNode = (GenNode) genNodes.get(nodeIndex);
+TypeModelFacet typeModelFacet = nextNode.getModelFacet();
+if (typeModelFacet.isPhantomElement()) {
+// Skipping top-level phantoms
+ continue;
+}
+GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
+
+if (nodeIndex == 0) {
+%> <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue;
+ int nodeVID;<%
+}
+
+if (childMetaFeature.isListType()) {
+%> for (<%=importManager.getImportedName("java.util.Iterator")%> values = <%=getFeatureValueGetter("modelObject", childMetaFeature, true, importManager)%>.iterator(); values.hasNext();) {
+ nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) values.next();
+<%} else {%>
+ nextValue = <%=getFeatureValueGetter("modelObject", childMetaFeature, true, importManager)%>;
+<%}%>
+ nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(viewObject, nextValue, "");
+ if (<%=nextNode.getVisualID()%> == nodeVID) { \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/createPhantomNodes.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/createPhantomNodes.jetinc
new file mode 100644
index 000000000..e24ee5031
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/createPhantomNodes.jetinc
@@ -0,0 +1,43 @@
+/**
+ * @generated
+ */
+private void createPhantomNodes(<%=importManager.getImportedName("java.util.Collection")%> nodes) {
+ if (nodes.isEmpty()) {
+ return;
+ }
+ <%=importManager.getImportedName("java.util.List")%> descriptors = new <%=importManager.getImportedName("java.util.ArrayList")%>();
+ for (<%=importManager.getImportedName("java.util.Iterator")%> elements = nodes.iterator(); elements.hasNext();) {
+ <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> element = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)elements.next();
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest")%>.ViewDescriptor descriptor = getViewDescriptor(element);
+ descriptors.add(descriptor);
+ }
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> diagram = getDiagram();
+ <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> diagramEditPart = getDiagramEditPart();
+
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest")%> request = getCreateViewRequest(descriptors);
+ <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> cmd = diagramEditPart.getCommand(request);
+ if (cmd == null) {
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand")%> cc = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.CompositeCommand")%>(<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages")%>.AddCommand_Label);
+ for (<%=importManager.getImportedName("java.util.Iterator")%> descriptorsIterator = descriptors.iterator(); descriptorsIterator.hasNext();) {
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest")%>.ViewDescriptor descriptor = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest")%>.ViewDescriptor) descriptorsIterator.next();
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.common.core.command.ICommand")%> createCommand = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand")%>(((<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart")%>) getHost()).getEditingDomain(), descriptor, diagram);
+ cc.compose(createCommand);
+ }
+ cmd = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.EtoolsProxyCommand")%>(cc);
+ }
+
+ if ( cmd != null && cmd.canExecute() ) {
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand")%>.makeMutable(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter")%>(((<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart")%>) diagramEditPart).getNotationView())).execute();
+ executeCommand(cmd);
+ <%=importManager.getImportedName("java.util.List")%> adapters = (<%=importManager.getImportedName("java.util.List")%>) request.getNewObject();
+ makeViewsImmutable(adapters);
+ }
+ diagramEditPart.refresh();
+}
+
+/**
+ * @generated
+ */
+private <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> getDiagramEditPart() {
+ return (<%=importManager.getImportedName("org.eclipse.gef.EditPart")%>) getHost().getViewer().getEditPartRegistry().get(getDiagram());
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/filterOutExistingPhantoms.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/filterOutExistingPhantoms.jetinc
new file mode 100644
index 000000000..ec123ab37
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/filterOutExistingPhantoms.jetinc
@@ -0,0 +1,7 @@
+for (<%=importManager.getImportedName("java.util.Iterator")%> diagramNodes = getDiagram().getChildren().iterator(); diagramNodes.hasNext();) {
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> nextView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) diagramNodes.next();
+ <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>