Skip to main content
summaryrefslogtreecommitdiffstats
AgeCommit message (Expand)AuthorFilesLines
2014-02-10refactor: Update build numbers to 0.16.2jmisinco1-1/+1
2014-01-24refactor: Update build numbers to 0.16.1Roberto E. Escobar1-1/+1
2013-11-25refactor: Update build numbers to 0.16.0Roberto E. Escobar1-1/+1
2013-10-12refactor: Update build numbers to 0.15.0Roberto E. Escobar1-1/+1
2013-09-25refactor: Improve help.ui.test dependenciesRoberto E. Escobar1-1/+0
2013-09-06refactor: Update build numbers to 0.14.0Roberto E. Escobar1-1/+1
2013-08-19refactor: Update build numbers to 0.13.0Roberto E. Escobar1-1/+1
2013-07-29refactor: Update build numbers to 0.12.0Roberto E. Escobar1-1/+1
2013-06-17refactor: Update build numbers to 0.11.1Roberto E. Escobar1-1/+1
2012-11-07refactor: Update build numbers to 0.11.0Roberto E. Escobar1-1/+1
2012-10-01refactor: Update build numbers to 0.10.4Roberto E. Escobar1-1/+1
2012-09-01refactor: Update build numbers to 0.10.3Roberto E. Escobar1-1/+1
2012-08-17refactor: Update build numbers to 0.10.2Roberto E. Escobar1-1/+1
2012-07-09refactor: Update build numbers to 0.10.1Roberto E. Escobar1-1/+1
2012-02-15refactor: Update build numbers to 0.10.0Roberto E. Escobar1-1/+1
2011-02-09refactor: Update build numbers to 0.9.9rescobar1-1/+1
2010-12-13refactor: Update build numbers to 0.9.8rescobar1-1/+1
2010-10-13refactor: Update version numbers to 0.9.7rescobar1-1/+1
2010-08-31Update build version to 0.9.6rescobar1-1/+1
2010-05-19Updated versions to 0.9.5rescobar1-1/+1
2010-05-03updated bundleProvider per http://wiki.eclipse.org/Adding_Bundles_to_Orbit#Wh...rbrooks1-2/+2
2010-03-23Updated version to 0.9.4.qualifierrescobar1-1/+1
2010-03-15Updated version numbersrescobar1-1/+1
2010-03-12(no commit message)rescobar1-0/+9

    Back to the top

    gmf-tooling.git/diff/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/CircleCreateCommand.java?id=2c75111da550bfa14af90c95a97bfc85f715326a'>test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/CircleCreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Container2CreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/ContainerCreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkCreateCommand.java152
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkReorientCommand.java157
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkCreateCommand.java152
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkReorientCommand.java157
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/PortCreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rectangle2CreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RectangleCreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rhombus2CreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RhombusCreateCommand.java79
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CanvasEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CircleEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/ContainerEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LabeledLinkEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinkEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinklfBaseEditHelper.java10
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/PortEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RectangleEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RhombusEditHelper.java7
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CanvasEditPart.java44
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Circle2EditPart.java197
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CircleEditPart.java197
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Container2EditPart.java338
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartment2EditPart.java97
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartmentEditPart.java97
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerEditPart.java338
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerName2EditPart.java584
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerNameEditPart.java584
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkEditPart.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkLinkNameEditPart.java583
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkSourceNameEditPart.java583
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkTargetNameEditPart.java583
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinkEditPart.java58
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinklfEditPartFactory.java101
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/PortEditPart.java184
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rectangle2EditPart.java196
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RectangleEditPart.java196
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rhombus2EditPart.java204
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RhombusEditPart.java204
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasCanonicalEditPolicy.java432
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasItemSemanticEditPolicy.java68
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Circle2ItemSemanticEditPolicy.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CircleItemSemanticEditPolicy.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2CanonicalEditPolicy.java158
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2ItemSemanticEditPolicy.java234
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerCanonicalEditPolicy.java158
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2CanonicalEditPolicy.java169
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2ItemSemanticEditPolicy.java42
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentCanonicalEditPolicy.java169
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentItemSemanticEditPolicy.java42
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerItemSemanticEditPolicy.java234
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LabeledLinkItemSemanticEditPolicy.java27
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinkItemSemanticEditPolicy.java27
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinklfBaseItemSemanticEditPolicy.java335
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinklfTextNonResizableEditPolicy.java226
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinklfTextSelectionEditPolicy.java210
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/PortItemSemanticEditPolicy.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Rectangle2ItemSemanticEditPolicy.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/RectangleItemSemanticEditPolicy.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Rhombus2ItemSemanticEditPolicy.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/RhombusItemSemanticEditPolicy.java135
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfAbstractNavigatorItem.java58
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfDomainNavigatorContentProvider.java217
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfDomainNavigatorItem.java106
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfDomainNavigatorLabelProvider.java94
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfNavigatorActionProvider.java168
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfNavigatorContentProvider.java662
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfNavigatorGroup.java97
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfNavigatorItem.java84
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfNavigatorLabelProvider.java341
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfNavigatorLinkHelper.java115
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/navigator/LinklfNavigatorSorter.java27
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/parsers/AbstractParser.java1
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/parsers/MessageFormatParser.java190
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/DeleteElementAction.java18
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/DiagramEditorContextMenuProvider.java66
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfCreationWizard.java154
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfCreationWizardPage.java83
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfDiagramActionBarContributor.java38
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfDiagramEditor.java271
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfDiagramEditorPlugin.java281
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfDiagramEditorUtil.java345
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfDiagramUpdateCommand.java78
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfDiagramUpdater.java811
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfDocumentProvider.java981
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfInitDiagramFileAction.java86
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfLinkDescriptor.java26
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfMatchingStrategy.java34
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfNewDiagramFileWizard.java162
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfNodeDescriptor.java18
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfPaletteFactory.java190
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfUriEditorInputTester.java22
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LinklfVisualIDRegistry.java411
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/LoadResourceAction.java19
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/Messages.java449
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/part/ModelElementSelectionPage.java26
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/preferences/DiagramAppearancePreferencePage.java17
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/preferences/DiagramConnectionsPreferencePage.java17
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/preferences/DiagramGeneralPreferencePage.java17
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/preferences/DiagramPreferenceInitializer.java31
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/preferences/DiagramPrintingPreferencePage.java17
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/preferences/DiagramRulersAndGridPreferencePage.java17
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/ElementInitializers.java24
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/LinklfEditPartProvider.java20
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/LinklfElementTypes.java274
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/LinklfIconProvider.java18
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/LinklfModelingAssistantProvider.java93
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/LinklfParserProvider.java200
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/LinklfViewProvider.java683
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfCanvasEditPart.java29
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfCircle2EditPart.java191
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfCircleEditPart.java191
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfContainer2EditPart.java26
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfContainerEditPart.java26
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfPortEditPart.java191
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfRectangle2EditPart.java191
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfRectangleEditPart.java191
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfRhombus2EditPart.java191
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/providers/assistants/LinklfModelingAssistantProviderOfRhombusEditPart.java191
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/sheet/LinklfPropertySection.java21
    -rw-r--r--test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/sheet/LinklfSheetLabelProvider.java78
    -rw-r--r--test-examples/linklf/xtend/pom.xml27
    144 files changed, 20986 insertions, 0 deletions
    diff --git a/test-examples/linklf/pom.xml b/test-examples/linklf/pom.xml
    index 373a6f06c..036d1f79e 100644
    --- a/test-examples/linklf/pom.xml
    +++ b/test-examples/linklf/pom.xml
    @@ -24,5 +24,6 @@
    <modules>
    <module>org.eclipse.gmf.tooling.examples.linklf</module>
    <module>org.eclipse.gmf.tooling.examples.linklf.edit</module>
    + <module>xtend</module>
    </modules>
    </project>
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.classpath b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.classpath
    new file mode 100644
    index 000000000..3bc247511
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.classpath
    @@ -0,0 +1,7 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<classpath>
    + <classpathentry kind="src" path="src"/>
    + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
    + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
    + <classpathentry kind="output" path="bin"/>
    +</classpath>
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.gitignore b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.gitignore
    new file mode 100644
    index 000000000..7447f89a5
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.gitignore
    @@ -0,0 +1 @@
    +/bin \ No newline at end of file
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.options b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.options
    new file mode 100644
    index 000000000..dcf7c2ba9
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.options
    @@ -0,0 +1,7 @@
    +# Tracing options for the org.eclipse.gmf.tooling.examples.linklf.diagram plug-in
    +
    +# Common issues
    +org.eclipse.gmf.tooling.examples.linklf.diagram/debug=false
    +
    +# Visual IDs
    +org.eclipse.gmf.tooling.examples.linklf.diagram/debug/visualID=false
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.project b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.project
    new file mode 100644
    index 000000000..c23c0dd66
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/.project
    @@ -0,0 +1,28 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<projectDescription>
    + <name>org.eclipse.gmf.tooling.examples.linklf.diagram</name>
    + <comment></comment>
    + <projects>
    + </projects>
    + <buildSpec>
    + <buildCommand>
    + <name>org.eclipse.jdt.core.javabuilder</name>
    + <arguments>
    + </arguments>
    + </buildCommand>
    + <buildCommand>
    + <name>org.eclipse.pde.ManifestBuilder</name>
    + <arguments>
    + </arguments>
    + </buildCommand>
    + <buildCommand>
    + <name>org.eclipse.pde.SchemaBuilder</name>
    + <arguments>
    + </arguments>
    + </buildCommand>
    + </buildSpec>
    + <natures>
    + <nature>org.eclipse.jdt.core.javanature</nature>
    + <nature>org.eclipse.pde.PluginNature</nature>
    + </natures>
    +</projectDescription>
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/META-INF/MANIFEST.MF b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/META-INF/MANIFEST.MF
    new file mode 100644
    index 000000000..bc53004c1
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/META-INF/MANIFEST.MF
    @@ -0,0 +1,39 @@
    +Manifest-Version: 1.0
    +Bundle-ManifestVersion: 2
    +Bundle-Name: %pluginName
    +Bundle-SymbolicName: org.eclipse.gmf.tooling.examples.linklf.diagram; singleton:=true
    +Bundle-Version: 1.0.0.qualifier
    +Bundle-ClassPath: .
    +Bundle-Activator: org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorPlugin
    +Bundle-Vendor: %providerName
    +Bundle-Localization: plugin
    +Export-Package: org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts,
    + org.eclipse.gmf.tooling.examples.linklf.diagram.part,
    + org.eclipse.gmf.tooling.examples.linklf.diagram.providers
    +Require-Bundle: org.eclipse.core.runtime,
    + org.eclipse.core.resources,
    + org.eclipse.core.expressions,
    + org.eclipse.jface,
    + org.eclipse.ui.ide,
    + org.eclipse.ui.views,
    + org.eclipse.ui.navigator,
    + org.eclipse.ui.navigator.resources,
    + org.eclipse.emf.ecore,
    + org.eclipse.emf.ecore.xmi,
    + org.eclipse.emf.edit.ui,
    + org.eclipse.gmf.runtime.emf.core,
    + org.eclipse.gmf.runtime.emf.commands.core,
    + org.eclipse.gmf.runtime.emf.ui.properties,
    + org.eclipse.gmf.runtime.diagram.ui,
    + org.eclipse.gmf.runtime.diagram.ui.properties,
    + org.eclipse.gmf.runtime.diagram.ui.providers,
    + org.eclipse.gmf.runtime.diagram.ui.providers.ide,
    + org.eclipse.gmf.runtime.diagram.ui.render,
    + org.eclipse.gmf.runtime.diagram.ui.resources.editor,
    + org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
    + org.eclipse.gmf.tooling.runtime;visibility:=reexport,
    + org.eclipse.gmf.tooling.examples.linklf;visibility:=reexport,
    + org.eclipse.gmf.tooling.examples.linklf.edit;visibility:=reexport,
    + org.eclipse.gef;visibility:=reexport
    +Bundle-ActivationPolicy: lazy
    +Bundle-RequiredExecutionEnvironment: JavaSE-1.6
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/about.html b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/about.html
    new file mode 100644
    index 000000000..c258ef55d
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/about.html
    @@ -0,0 +1,28 @@
    +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    +<html xmlns="http://www.w3.org/1999/xhtml">
    +<head>
    +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
    +<title>About</title>
    +</head>
    +<body lang="EN-US">
    +<h2>About This Content</h2>
    +
    +<p>June 5, 2006</p>
    +<h3>License</h3>
    +
    +<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
    +indicated below, the Content is provided to you under the terms and conditions of the
    +Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
    +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
    +For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
    +
    +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
    +being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
    +apply to your use of any object code in the Content. Check the Redistributor's license that was
    +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
    +indicated below, the terms and conditions of the EPL still apply to any source code in the Content
    +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
    +
    +</body>
    +</html> \ No newline at end of file
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/build.properties b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/build.properties
    new file mode 100644
    index 000000000..162d13adf
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/build.properties
    @@ -0,0 +1,10 @@
    +bin.includes = .,\
    + icons/,\
    + META-INF/,\
    + plugin.xml,\
    + plugin.properties,\
    + messages.properties,\
    + .options
    +jars.compile.order = .
    +source.. = src/
    +output.. = bin/
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/incomingLinksNavigatorGroup.gif b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/incomingLinksNavigatorGroup.gif
    new file mode 100644
    index 000000000..339f99d5f
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/incomingLinksNavigatorGroup.gif
    Binary files differ
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linkSourceNavigatorGroup.gif b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linkSourceNavigatorGroup.gif
    new file mode 100644
    index 000000000..339f99d5f
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linkSourceNavigatorGroup.gif
    Binary files differ
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linkTargetNavigatorGroup.gif b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linkTargetNavigatorGroup.gif
    new file mode 100644
    index 000000000..339f99d5f
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linkTargetNavigatorGroup.gif
    Binary files differ
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linksNavigatorGroup.gif b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linksNavigatorGroup.gif
    new file mode 100644
    index 000000000..339f99d5f
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/linksNavigatorGroup.gif
    Binary files differ
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/obj16/LinklfDiagramFile.gif b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/obj16/LinklfDiagramFile.gif
    new file mode 100644
    index 000000000..f77d7217a
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/obj16/LinklfDiagramFile.gif
    Binary files differ
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/outgoingLinksNavigatorGroup.gif b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/outgoingLinksNavigatorGroup.gif
    new file mode 100644
    index 000000000..339f99d5f
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/outgoingLinksNavigatorGroup.gif
    Binary files differ
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/wizban/NewLinklfWizard.gif b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/wizban/NewLinklfWizard.gif
    new file mode 100644
    index 000000000..18fc5bfef
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/icons/wizban/NewLinklfWizard.gif
    Binary files differ
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/messages.properties b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/messages.properties
    new file mode 100644
    index 000000000..852c20229
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/messages.properties
    @@ -0,0 +1,88 @@
    +
    +# TODO: manually put keys and values
    +LinklfCreationWizardTitle=New linklf Diagram
    +LinklfCreationWizard_DiagramModelFilePageTitle=Create linklf Diagram
    +LinklfCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model.
    +LinklfCreationWizard_DomainModelFilePageTitle=Create linklf Domain Model
    +LinklfCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model.
    +LinklfCreationWizardOpenEditorError=Error opening diagram editor
    +LinklfCreationWizardCreationError=Creation Problems
    +LinklfCreationWizardPageExtensionError=File name should have {0} extension.
    +LinklfDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
    +LinklfDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
    +LinklfDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
    +LinklfDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
    +LinklfDocumentProvider_isModifiable=Updating cache failed
    +LinklfDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
    +LinklfDocumentProvider_IncorrectInputError=Incorrect element used: {0} instead of {1} or {2}
    +LinklfDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
    +LinklfDocumentProvider_DiagramLoadingError=Error loading diagram
    +LinklfDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
    +LinklfDocumentProvider_SaveDiagramTask=Saving diagram
    +LinklfDocumentProvider_SaveNextResourceTask=Saving {0}
    +LinklfDocumentProvider_SaveAsOperation=Saving {0} diagram as
    +InitDiagramFile_ResourceErrorDialogTitle=Error
    +InitDiagramFile_ResourceErrorDialogMessage=Model file loading failed
    +InitDiagramFile_WizardTitle=Initialize new {0} diagram file
    +InitDiagramFile_OpenModelFileDialogTitle=Select domain model
    +LinklfNewDiagramFileWizard_CreationPageName=Initialize new diagram file
    +LinklfNewDiagramFileWizard_CreationPageTitle=Diagram file
    +LinklfNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
    +LinklfNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
    +LinklfNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
    +LinklfNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
    +"Select diagram root element:"
    +LinklfNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
    +LinklfNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
    +LinklfNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
    +LinklfNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
    +LinklfNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
    +LinklfDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
    +LinklfDiagramEditor_SaveAsErrorTitle=Problem During Save As...
    +LinklfDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
    +LinklfDiagramEditor_SaveErrorTitle=Save Problems
    +LinklfDiagramEditor_SaveErrorMessage=Could not save file.
    +LinklfElementChooserDialog_SelectModelElementTitle=Select model element
    +ModelElementSelectionPageMessage=Select model element:
    +ValidateActionMessage=Validate
    +Linklf1Group_title=linklf
    +Container1CreationTool_title=Container
    +Container1CreationTool_desc=Create new Container
    +Rectangle2CreationTool_title=Rectangle
    +Rectangle2CreationTool_desc=Create new Rectangle
    +Circle3CreationTool_title=Circle
    +Circle3CreationTool_desc=Create new Circle
    +Rhombus4CreationTool_title=Rhombus
    +Rhombus4CreationTool_desc=Create new Rhombus
    +Link5CreationTool_title=Link
    +Link5CreationTool_desc=Create new Link
    +LabeledLink6CreationTool_title=LabeledLink
    +LabeledLink6CreationTool_desc=Create new LabeledLink
    +Port7CreationTool_title=Port
    +Port7CreationTool_desc=Create new Port
    +ContainerContainerCompartmentEditPart_title=ContainerCompartment
    +ContainerContainerCompartment2EditPart_title=ContainerCompartment
    +CommandName_OpenDiagram=Open Diagram
    +NavigatorGroupName_Canvas_1000_links=links
    +NavigatorGroupName_Circle_2001_incominglinks=incoming links
    +NavigatorGroupName_Circle_2001_outgoinglinks=outgoing links
    +NavigatorGroupName_Rectangle_2002_incominglinks=incoming links
    +NavigatorGroupName_Rectangle_2002_outgoinglinks=outgoing links
    +NavigatorGroupName_Rhombus_2004_incominglinks=incoming links
    +NavigatorGroupName_Rhombus_2004_outgoinglinks=outgoing links
    +NavigatorGroupName_Circle_3001_incominglinks=incoming links
    +NavigatorGroupName_Circle_3001_outgoinglinks=outgoing links
    +NavigatorGroupName_Rectangle_3003_incominglinks=incoming links
    +NavigatorGroupName_Rectangle_3003_outgoinglinks=outgoing links
    +NavigatorGroupName_Rhombus_3004_incominglinks=incoming links
    +NavigatorGroupName_Rhombus_3004_outgoinglinks=outgoing links
    +NavigatorGroupName_Port_3005_incominglinks=incoming links
    +NavigatorGroupName_Port_3005_outgoinglinks=outgoing links
    +NavigatorGroupName_Link_4001_target=target
    +NavigatorGroupName_Link_4001_source=source
    +NavigatorGroupName_LabeledLink_4002_target=target
    +NavigatorGroupName_LabeledLink_4002_source=source
    +NavigatorActionProvider_OpenDiagramActionName=Open Diagram
    +MessageFormatParser_InvalidInputError=Invalid input at {0}
    +LinklfModelingAssistantProviderTitle=Select domain model element
    +LinklfModelingAssistantProviderMessage=Available domain model elements:
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/plugin.properties b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/plugin.properties
    new file mode 100644
    index 000000000..46eb6fbf2
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/plugin.properties
    @@ -0,0 +1,49 @@
    +pluginName=linklf Plugin
    +providerName=Sample Plugin Provider, Inc
    +
    +editorName=linklf Diagram Editing
    +context.description=linklf Diagram Editing
    +context.name=In linklf Diagram Editor
    +newWizardName=linklf Diagram
    +newWizardDesc=Creates linklf diagram.
    +
    +initDiagramActionLabel=Initialize linklf_diagram diagram file
    +
    +
    +navigatorContentName=*.linklf_diagram diagram contents
    +domainNavigatorContentName=*.linklf model contents
    +update.diagram.name=Update linklf diagram
    +update.diagram.description=Perform linklf diagram update
    +
    +
    +# Property Sheet
    +tab.appearance=Appearance
    +tab.diagram=Rulers & Grid
    +tab.domain=Core
    +
    +# Preferences
    +prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.general=linklf Diagram
    +prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.appearance=Appearance
    +prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.connections=Connections
    +prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.printing=Printing
    +prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.rulersAndGrid=Rulers And Grid
    +
    +
    +# Providers
    +metatype.name.Canvas_1000=Undefined
    +metatype.name.Circle_2001=Circle
    +metatype.name.Rectangle_2002=Rectangle
    +metatype.name.Container_2003=Container
    +metatype.name.Rhombus_2004=Rhombus
    +metatype.name.Circle_3001=Circle
    +metatype.name.Container_3002=Container
    +metatype.name.Rectangle_3003=Rectangle
    +metatype.name.Rhombus_3004=Rhombus
    +metatype.name.Port_3005=Port
    +metatype.name.Link_4001=Link
    +metatype.name.LabeledLink_4002=LabeledLink
    +
    +# Commands and menu actions
    +cmdcategory.name=linklf Editor Commands
    +cmdcategory.desc=linklf Editor Commands
    +
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/plugin.xml b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/plugin.xml
    new file mode 100644
    index 000000000..f24c53fbf
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/plugin.xml
    @@ -0,0 +1,630 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<?eclipse version="3.0"?>
    +<plugin>
    +
    + <extension point="org.eclipse.team.core.fileTypes" id="repo-ftype">
    + <?gmfgen generated="true"?>
    + <fileTypes type="text" extension="linklf_diagram"/>
    + </extension>
    +
    + <extension point="org.eclipse.emf.ecore.extension_parser" id="resource-factory">
    + <?gmfgen generated="true"?>
    + <parser
    + type="linklf_diagram"
    + class="org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory">
    + </parser>
    + </extension>
    +
    + <extension point="org.eclipse.ui.editors" id="gmf-editor">
    + <?gmfgen generated="true"?>
    + <editor
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorID"
    + name="%editorName"
    + icon="icons/obj16/LinklfDiagramFile.gif"
    + extensions="linklf_diagram"
    + default="true"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditor"
    + matchingStrategy="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfMatchingStrategy"
    + contributorClass="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramActionBarContributor">
    + </editor>
    + </extension>
    +
    + <extension point="org.eclipse.ui.contexts" id="ui-context">
    + <?gmfgen generated="true"?>
    + <context
    + description="%context.description"
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.ui.diagramContext"
    + name="%context.name"
    + parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
    + </context>
    + </extension>
    +
    + <extension point="org.eclipse.ui.newWizards" id="creation-wizard">
    + <?gmfgen generated="true"?>
    + <wizard
    + name="%newWizardName"
    + icon="icons/obj16/LinklfDiagramFile.gif"
    + category="org.eclipse.ui.Examples"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfCreationWizard"
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfCreationWizardID">
    + <description>%newWizardDesc</description>
    + </wizard>
    + </extension>
    +
    + <extension point="org.eclipse.ui.popupMenus" id="init-diagram-action">
    + <?gmfgen generated="true"?>
    + <objectContribution
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.InitDiagram"
    + nameFilter="*.linklf"
    + objectClass="org.eclipse.core.resources.IFile">
    + <action
    + label="%initDiagramActionLabel"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfInitDiagramFileAction"
    + menubarPath="additions"
    + enablesFor="1"
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.InitDiagramAction">
    + </action>
    + </objectContribution>
    + </extension>
    +
    + <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders" id="global-actions">
    + <?gmfgen generated="true"?>
    + <GlobalActionHandlerProvider
    + class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandlerProvider"
    + id="linklfPresentation">
    + <Priority name="Lowest"/>
    + <ViewId id="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorID">
    + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
    + <GlobalActionId actionId="delete"/>
    + </ElementType>
    + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart">
    + <GlobalActionId actionId="save"/>
    + </ElementType>
    + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
    + <GlobalActionId actionId="save">
    + </GlobalActionId>
    + </ElementType>
    + </ViewId>
    + </GlobalActionHandlerProvider>
    + <GlobalActionHandlerProvider
    + class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
    + id="linklfPresentationIDE">
    + <Priority name="Lowest"/>
    + <ViewId id="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorID">
    + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
    + <GlobalActionId actionId="bookmark"/>
    + </ElementType>
    + </ViewId>
    + </GlobalActionHandlerProvider>
    + <GlobalActionHandlerProvider
    + class="org.eclipse.gmf.runtime.diagram.ui.render.providers.DiagramUIRenderGlobalActionHandlerProvider"
    + id="linklfRender">
    + <Priority name="Lowest"/>
    + <ViewId id="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorID">
    + <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
    + <GlobalActionId actionId="cut"/>
    + <GlobalActionId actionId="copy"/>
    + <GlobalActionId actionId="paste"/>
    + </ElementType>
    + </ViewId>
    + </GlobalActionHandlerProvider>
    + </extension>
    +
    +
    + <extension point="org.eclipse.core.runtime.preferences" id="prefs">
    + <?gmfgen generated="true"?>
    + <initializer class="org.eclipse.gmf.tooling.examples.linklf.diagram.preferences.DiagramPreferenceInitializer"/>
    + </extension>
    +
    + <extension point="org.eclipse.ui.preferencePages" id="prefpages">
    + <?gmfgen generated="true"?>
    + <page
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.general"
    + name="%prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.general"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.preferences.DiagramGeneralPreferencePage">
    + </page>
    + <page
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.appearance"
    + name="%prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.appearance"
    + category="org.eclipse.gmf.tooling.examples.linklf.diagram.general"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.preferences.DiagramAppearancePreferencePage">
    + </page>
    + <page
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.connections"
    + name="%prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.connections"
    + category="org.eclipse.gmf.tooling.examples.linklf.diagram.general"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.preferences.DiagramConnectionsPreferencePage">
    + </page>
    + <page
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.printing"
    + name="%prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.printing"
    + category="org.eclipse.gmf.tooling.examples.linklf.diagram.general"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.preferences.DiagramPrintingPreferencePage">
    + </page>
    + <page
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.rulersAndGrid"
    + name="%prefpage.org.eclipse.gmf.tooling.examples.linklf.diagram.rulersAndGrid"
    + category="org.eclipse.gmf.tooling.examples.linklf.diagram.general"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.preferences.DiagramRulersAndGridPreferencePage">
    + </page>
    + </extension>
    +
    + <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
    + <?gmfgen generated="true"?>
    + <propertyContributor
    + contributorId="org.eclipse.gmf.tooling.examples.linklf.diagram"
    + labelProvider="org.eclipse.gmf.tooling.examples.linklf.diagram.sheet.LinklfSheetLabelProvider">
    + <propertyCategory category="domain"/>
    + <propertyCategory category="visual"/>
    + <propertyCategory category="extra"/>
    + </propertyContributor>
    + </extension>
    +
    + <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
    + <?gmfgen generated="true"?>
    + <propertyTabs contributorId="org.eclipse.gmf.tooling.examples.linklf.diagram">
    + <propertyTab
    + category="visual"
    + id="property.tab.AppearancePropertySection"
    + label="%tab.appearance"/>
    + <propertyTab
    + category="visual"
    + id="property.tab.DiagramPropertySection"
    + label="%tab.diagram"/>
    + <propertyTab
    + category="domain"
    + id="property.tab.domain"
    + label="%tab.domain"/>
    + </propertyTabs>
    + </extension>
    +
    + <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
    + <?gmfgen generated="true"?>
    + <propertySections contributorId="org.eclipse.gmf.tooling.examples.linklf.diagram">
    + <propertySection id="property.section.ConnectorAppearancePropertySection"
    + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
    + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
    + tab="property.tab.AppearancePropertySection">
    + </propertySection>
    + <propertySection id="property.section.ShapeColorAndFontPropertySection"
    + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
    + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
    + tab="property.tab.AppearancePropertySection">
    + </propertySection>
    + <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
    + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
    + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
    + tab="property.tab.AppearancePropertySection">
    + </propertySection>
    + <propertySection id="property.section.RulerGridPropertySection"
    + filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
    + class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
    + tab="property.tab.DiagramPropertySection">
    + </propertySection>
    + <propertySection
    + id="property.section.domain"
    + tab="property.tab.domain"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.sheet.LinklfPropertySection">
    + <input type="org.eclipse.gmf.runtime.notation.View"/>
    + <input type="org.eclipse.gef.EditPart"/>
    + <input type="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfAbstractNavigatorItem"/>
    + </propertySection>
    + </propertySections>
    + </extension>
    +
    + <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
    + <?gmfgen generated="true"?>
    + <viewProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfViewProvider">
    + <Priority name="Lowest"/>
    + <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="linklf"/>
    + <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001,2002,2003,2004,3001,3002,3003,3004,3005"/>
    + <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001,4002"/>
    + </viewProvider>
    + </extension>
    +
    + <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
    + <?gmfgen generated="true"?>
    + <editpartProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfEditPartProvider">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
    + <method name="getType()" value="linklf"/>
    + </object>
    + <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
    + <method name="getType()" value="2001,2002,2003,2004,3001,3002,3003,3004,3005"/>
    + </object>
    + <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
    + <method name="getType()" value="4001,4002"/>
    + </object>
    + <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
    + <method name="getType()" value="5002,5001"/>
    + </object>
    + <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
    + <method name="getType()" value="7001,7002"/>
    + </object>
    + <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
    + </editpartProvider>
    + </extension>
    +
    +<extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
    + <?gmfgen generated="true"?>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfCanvasEditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.CanvasEditPart" id="Canvas_1000"/>
    + <context elements="Canvas_1000"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfCircleEditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.CircleEditPart" id="Circle_2001"/>
    + <context elements="Circle_2001"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfRectangleEditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.RectangleEditPart" id="Rectangle_2002"/>
    + <context elements="Rectangle_2002"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfContainerEditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.ContainerEditPart" id="Container_2003"/>
    + <context elements="Container_2003"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfRhombusEditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.RhombusEditPart" id="Rhombus_2004"/>
    + <context elements="Rhombus_2004"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfCircle2EditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Circle2EditPart" id="Circle_3001"/>
    + <context elements="Circle_3001"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfContainer2EditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Container2EditPart" id="Container_3002"/>
    + <context elements="Container_3002"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfRectangle2EditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rectangle2EditPart" id="Rectangle_3003"/>
    + <context elements="Rectangle_3003"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfRhombus2EditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rhombus2EditPart" id="Rhombus_3004"/>
    + <context elements="Rhombus_3004"/>
    + </modelingAssistantProvider>
    + <modelingAssistantProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.assistants.LinklfModelingAssistantProviderOfPortEditPart">
    + <Priority name="Lowest"/>
    + <object class="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.PortEditPart" id="Port_3005"/>
    + <context elements="Port_3005"/>
    + </modelingAssistantProvider>
    +</extension>
    +
    + <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
    + <?gmfgen generated="true"?>
    + <IconProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfIconProvider">
    + <Priority name="Low"/>
    + </IconProvider>
    + </extension>
    +
    + <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
    + <?gmfgen generated="true"?>
    + <ParserProvider class="org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfParserProvider">
    + <Priority name="Lowest"/>
    + </ParserProvider>
    + </extension>
    +
    + <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
    + <?gmfgen generated="true"?>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Canvas_1000"
    + name="%metatype.name.Canvas_1000"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="Canvas"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.CanvasEditHelper">
    + <param name="semanticHint" value="1000"/>
    + </metamodelType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Circle_2001"
    + name="%metatype.name.Circle_2001"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="Circle"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.CircleEditHelper">
    + <param name="semanticHint" value="2001"/>
    + </metamodelType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Rectangle_2002"
    + name="%metatype.name.Rectangle_2002"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="Rectangle"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.RectangleEditHelper">
    + <param name="semanticHint" value="2002"/>
    + </metamodelType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Container_2003"
    + name="%metatype.name.Container_2003"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="Container"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.ContainerEditHelper">
    + <param name="semanticHint" value="2003"/>
    + </metamodelType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <specializationType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Rhombus_2004"
    + name="%metatype.name.Rhombus_2004"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
    + <specializes id="org.eclipse.gmf.tooling.examples.linklf.diagram.Rhombus_3004"/>
    + <param name="semanticHint" value="2004"/>
    + </specializationType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <specializationType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Circle_3001"
    + name="%metatype.name.Circle_3001"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
    + <specializes id="org.eclipse.gmf.tooling.examples.linklf.diagram.Circle_2001"/>
    + <param name="semanticHint" value="3001"/>
    + </specializationType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <specializationType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Container_3002"
    + name="%metatype.name.Container_3002"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
    + <specializes id="org.eclipse.gmf.tooling.examples.linklf.diagram.Container_2003"/>
    + <param name="semanticHint" value="3002"/>
    + </specializationType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <specializationType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Rectangle_3003"
    + name="%metatype.name.Rectangle_3003"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
    + <specializes id="org.eclipse.gmf.tooling.examples.linklf.diagram.Rectangle_2002"/>
    + <param name="semanticHint" value="3003"/>
    + </specializationType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Rhombus_3004"
    + name="%metatype.name.Rhombus_3004"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="Rhombus"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.RhombusEditHelper">
    + <param name="semanticHint" value="3004"/>
    + </metamodelType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Port_3005"
    + name="%metatype.name.Port_3005"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="Port"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.PortEditHelper">
    + <param name="semanticHint" value="3005"/>
    + </metamodelType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.Link_4001"
    + name="%metatype.name.Link_4001"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="Link"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.LinkEditHelper">
    + <param name="semanticHint" value="4001"/>
    + </metamodelType>
    + </metamodel>
    + <metamodel nsURI="http://linklf.gmf.eclipse.org">
    + <metamodelType
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.LabeledLink_4002"
    + name="%metatype.name.LabeledLink_4002"
    + kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
    + eclass="LabeledLink"
    + edithelper="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers.LabeledLinkEditHelper">
    + <param name="semanticHint" value="4002"/>
    + </metamodelType>
    + </metamodel>
    + </extension>
    +
    + <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
    + <?gmfgen generated="true"?>
    + <clientContext id="org.eclipse.gmf.tooling.examples.linklf.diagram.TypeContext">
    + <enablement>
    + <test
    + property="org.eclipse.gmf.runtime.emf.core.editingDomain"
    + value="org.eclipse.gmf.tooling.examples.linklf.diagram.EditingDomain"/>
    + </enablement>
    + </clientContext>
    + <binding context="org.eclipse.gmf.tooling.examples.linklf.diagram.TypeContext">
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Canvas_1000"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Circle_2001"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Rectangle_2002"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Container_2003"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Rhombus_2004"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Circle_3001"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Container_3002"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Rectangle_3003"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Rhombus_3004"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Port_3005"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.Link_4001"/>
    + <elementType ref="org.eclipse.gmf.tooling.examples.linklf.diagram.LabeledLink_4002"/>
    + <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
    + </binding>
    + </extension>
    + <extension point="org.eclipse.core.expressions.propertyTesters" id="navigator-proptest.isURIEditorInput">
    + <?gmfgen generated="true"?>
    + <propertyTester
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.URIEditorInputPropertyTester"
    + type="org.eclipse.emf.common.ui.URIEditorInput"
    + namespace="org.eclipse.gmf.tooling.examples.linklf.diagram"
    + properties="isURIEditorInput"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfUriEditorInputTester">
    + </propertyTester>
    + </extension>
    +
    +
    + <extension point="org.eclipse.ui.navigator.viewer" id="navigator-viewbinding">
    + <?gmfgen generated="true"?>
    + <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
    + <includes>
    + <contentExtension pattern="org.eclipse.gmf.tooling.examples.linklf.diagram.resourceContent"/>
    + <contentExtension pattern="org.eclipse.gmf.tooling.examples.linklf.diagram.domainResourceContent"/>
    + <contentExtension pattern="org.eclipse.gmf.tooling.examples.linklf.diagram.navigatorLinkHelper"/>
    + </includes>
    + </viewerContentBinding>
    + <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
    + <includes>
    + <actionExtension pattern="org.eclipse.gmf.tooling.examples.linklf.diagram.navigatorActionProvider"/>
    + </includes>
    + </viewerActionBinding>
    + </extension>
    +
    + <extension point="org.eclipse.ui.navigator.navigatorContent" id="navigator-content">
    + <?gmfgen generated="true"?>
    + <navigatorContent
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.resourceContent"
    + name="%navigatorContentName"
    + priority="normal"
    + contentProvider="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfNavigatorContentProvider"
    + labelProvider="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfNavigatorLabelProvider"
    + icon="icons/obj16/LinklfDiagramFile.gif"
    + activeByDefault="true">
    + <triggerPoints>
    + <or>
    + <and>
    + <instanceof value="org.eclipse.core.resources.IFile"/>
    + <test property="org.eclipse.core.resources.extension" value="linklf_diagram"/>
    + </and>
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfAbstractNavigatorItem"/>
    + </or>
    + </triggerPoints>
    + <possibleChildren>
    + <or>
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfAbstractNavigatorItem"/>
    + </or>
    + </possibleChildren>
    + <commonSorter
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.navigatorSorter"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfNavigatorSorter">
    + <parentExpression>
    + <or>
    + <and>
    + <instanceof value="org.eclipse.core.resources.IFile"/>
    + <test property="org.eclipse.core.resources.extension" value="linklf_diagram"/>
    + </and>
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfAbstractNavigatorItem"/>
    + </or>
    + </parentExpression>
    + </commonSorter>
    + </navigatorContent>
    + <navigatorContent
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.domainResourceContent"
    + name="%domainNavigatorContentName"
    + priority="normal"
    + contentProvider="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfDomainNavigatorContentProvider"
    + labelProvider="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfDomainNavigatorLabelProvider"
    + icon="icons/obj16/LinklfDiagramFile.gif"
    + activeByDefault="true">
    + <triggerPoints>
    + <or>
    + <and>
    + <instanceof value="org.eclipse.core.resources.IFile"/>
    + <test property="org.eclipse.core.resources.extension" value="linklf"/>
    + </and>
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfDomainNavigatorItem"/>
    + </or>
    + </triggerPoints>
    + <possibleChildren>
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfDomainNavigatorItem"/>
    + </possibleChildren>
    + </navigatorContent>
    + <actionProvider
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.navigatorActionProvider"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfNavigatorActionProvider">
    + <enablement>
    + <or>
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfAbstractNavigatorItem"/>
    + </or>
    + </enablement>
    + </actionProvider>
    + </extension>
    +
    + <extension point="org.eclipse.ui.navigator.linkHelper" id="navigator-linkhelper">
    + <?gmfgen generated="true"?>
    + <linkHelper
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.navigatorLinkHelper"
    + class="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfNavigatorLinkHelper">
    + <editorInputEnablement>
    + <and>
    + <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/>
    + <test property="org.eclipse.gmf.tooling.examples.linklf.diagram.isURIEditorInput"/>
    + </and>
    + </editorInputEnablement>
    + <selectionEnablement>
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.navigator.LinklfAbstractNavigatorItem"/>
    + </selectionEnablement>
    + </linkHelper>
    + </extension>
    +
    +
    + <extension point="org.eclipse.ui.commands" id="update-cmd">
    + <?gmfgen generated="true"?>
    + <command
    + categoryId="org.eclipse.ui.category.edit"
    + defaultHandler="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramUpdateCommand"
    + description="%update.diagram.description"
    + id="org.eclipse.gmf.tooling.examples.linklf.diagram.updateDiagram"
    + name="%update.diagram.name"/>
    + </extension>
    +
    + <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
    + <?gmfgen generated="true"?>
    + <key
    + commandId="org.eclipse.gmf.tooling.examples.linklf.diagram.updateDiagram"
    + contextId="org.eclipse.gmf.tooling.examples.linklf.diagram.ui.diagramContext"
    + schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
    + sequence="F5"/>
    + </extension>
    +
    + <extension point="org.eclipse.ui.menus" id="context-menus">
    + <?gmfgen generated="true"?>
    + <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
    + </menuContribution>
    + <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
    + </menuContribution -->
    + <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
    + <command commandId="org.eclipse.gmf.tooling.examples.linklf.diagram.LoadResourceAction">
    + <visibleWhen>
    + <and>
    + <with variable="activePartId"><equals value="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorID"/></with>
    + <with variable="selection"><iterate ifEmpty="false">
    + <instanceof value="org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.CanvasEditPart"/>
    + </iterate></with>
    + </and>
    + </visibleWhen>
    + </command>
    + </menuContribution>
    + </extension>
    +
    + <extension point="org.eclipse.ui.commands" id="menu-commands">
    + <?gmfgen generated="true"?>
    + <category id="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
    + <command id="org.eclipse.gmf.tooling.examples.linklf.diagram.LoadResourceAction"
    + name="Load Resource"
    + categoryId="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramEditorID"
    + defaultHandler="org.eclipse.gmf.tooling.examples.linklf.diagram.part.LoadResourceAction"/>
    + </extension>
    +
    + <extension point="org.eclipse.ui.handlers" id="menu-handlers">
    + <?gmfgen generated="true"?>
    + </extension>
    +
    + <!-- optionally, specify keybindings -->
    +</plugin>
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/pom.xml b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/pom.xml
    new file mode 100644
    index 000000000..c1af022d4
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/pom.xml
    @@ -0,0 +1,23 @@
    +<!--
    + * Copyright (c) 2013 Montages AG
    + * All rights reserved. This program and the accompanying materials
    + * are made available under the terms of the Eclipse Public License v1.0
    + * which accompanies this distribution, and is available at
    + * http://www.eclipse.org/legal/epl-v10.html
    + *
    +-->
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    + <modelVersion>4.0.0</modelVersion>
    + <groupId>org.eclipse.gmf-tooling</groupId>
    + <artifactId>org.eclipse.gmf.tooling.examples.linklf.diagram</artifactId>
    + <version>1.0.0-SNAPSHOT</version>
    + <packaging>eclipse-plugin</packaging>
    +
    + <parent>
    + <groupId>org.eclipse.gmf-tooling</groupId>
    + <artifactId>xtend</artifactId>
    + <version>1.0.0-SNAPSHOT</version>
    + <relativePath>../</relativePath>
    + </parent>
    +
    +</project>
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Circle2CreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Circle2CreateCommand.java
    new file mode 100644
    index 000000000..08033536d
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Circle2CreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.Circle;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +
    +/**
    + * @generated
    + */
    +public class Circle2CreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public Circle2CreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Circle newElement = LinklfFactory.eINSTANCE.createCircle();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Circle newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/CircleCreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/CircleCreateCommand.java
    new file mode 100644
    index 000000000..93b70cd47
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/CircleCreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.Circle;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +
    +/**
    + * @generated
    + */
    +public class CircleCreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public CircleCreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Circle newElement = LinklfFactory.eINSTANCE.createCircle();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Circle newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Container2CreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Container2CreateCommand.java
    new file mode 100644
    index 000000000..a8ecc00e3
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Container2CreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.Container;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +
    +/**
    + * @generated
    + */
    +public class Container2CreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public Container2CreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Container newElement = LinklfFactory.eINSTANCE.createContainer();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Container newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/ContainerCreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/ContainerCreateCommand.java
    new file mode 100644
    index 000000000..79e7ca2ad
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/ContainerCreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.Container;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +
    +/**
    + * @generated
    + */
    +public class ContainerCreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public ContainerCreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Container newElement = LinklfFactory.eINSTANCE.createContainer();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Container newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkCreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkCreateCommand.java
    new file mode 100644
    index 000000000..7edcd619e
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkCreateCommand.java
    @@ -0,0 +1,152 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.LabeledLink;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +import org.eclipse.gmf.tooling.examples.linklf.Node;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfBaseItemSemanticEditPolicy;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkCreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + private final EObject source;
    +
    + /**
    + * @generated
    + */
    + private final EObject target;
    +
    + /**
    + * @generated
    + */
    + private final CanvasElementContainer container;
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
    + super(request.getLabel(), null, request);
    + this.source = source;
    + this.target = target;
    + container = deduceContainer(source, target);
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + if (source == null && target == null) {
    + return false;
    + }
    + if (source != null && false == source instanceof Node) {
    + return false;
    + }
    + if (target != null && false == target instanceof Node) {
    + return false;
    + }
    + if (getSource() == null) {
    + return true; // link creation is in progress; source is not defined yet
    + }
    + // target may be null here but it's possible to check constraint
    + if (getContainer() == null) {
    + return false;
    + }
    + return LinklfBaseItemSemanticEditPolicy.getLinkConstraints().canCreateLabeledLink_4002(getContainer(), getSource(), getTarget());
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + if (!canExecute()) {
    + throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
    + }
    +
    + LabeledLink newElement = LinklfFactory.eINSTANCE.createLabeledLink();
    + getContainer().getElements().add(newElement);
    + newElement.setSource(getSource());
    + newElement.setTarget(getTarget());
    + doConfigure(newElement, monitor, info);
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(LabeledLink newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
    + configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setElementToEdit(EObject element) {
    + throw new UnsupportedOperationException();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getSource() {
    + return (Node) source;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getTarget() {
    + return (Node) target;
    + }
    +
    + /**
    + * @generated
    + */
    + public CanvasElementContainer getContainer() {
    + return container;
    + }
    +
    + /**
    + * Default approach is to traverse ancestors of the source to find instance of container.
    + * Modify with appropriate logic.
    + * @generated
    + */
    + private static CanvasElementContainer deduceContainer(EObject source, EObject target) {
    + // Find container element for the new link.
    + // Climb up by containment hierarchy starting from the source
    + // and return the first element that is instance of the container class.
    + for (EObject element = source; element != null; element = element.eContainer()) {
    + if (element instanceof CanvasElementContainer) {
    + return (CanvasElementContainer) element;
    + }
    + }
    + return null;
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkReorientCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkReorientCommand.java
    new file mode 100644
    index 000000000..a915ee1f3
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LabeledLinkReorientCommand.java
    @@ -0,0 +1,157 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.LabeledLink;
    +import org.eclipse.gmf.tooling.examples.linklf.Node;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfBaseItemSemanticEditPolicy;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkReorientCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + private final int reorientDirection;
    +
    + /**
    + * @generated
    + */
    + private final EObject oldEnd;
    +
    + /**
    + * @generated
    + */
    + private final EObject newEnd;
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkReorientCommand(ReorientRelationshipRequest request) {
    + super(request.getLabel(), request.getRelationship(), request);
    + reorientDirection = request.getDirection();
    + oldEnd = request.getOldRelationshipEnd();
    + newEnd = request.getNewRelationshipEnd();
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + if (false == getElementToEdit() instanceof LabeledLink) {
    + return false;
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
    + return canReorientSource();
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
    + return canReorientTarget();
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean canReorientSource() {
    + if (!(oldEnd instanceof Node && newEnd instanceof Node)) {
    + return false;
    + }
    + Node target = getLink().getTarget();
    + if (!(getLink().eContainer() instanceof CanvasElementContainer)) {
    + return false;
    + }
    + CanvasElementContainer container = (CanvasElementContainer) getLink().eContainer();
    + return LinklfBaseItemSemanticEditPolicy.getLinkConstraints().canExistLabeledLink_4002(container, getLink(), getNewSource(), target);
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean canReorientTarget() {
    + if (!(oldEnd instanceof Node && newEnd instanceof Node)) {
    + return false;
    + }
    + Node source = getLink().getSource();
    + if (!(getLink().eContainer() instanceof CanvasElementContainer)) {
    + return false;
    + }
    + CanvasElementContainer container = (CanvasElementContainer) getLink().eContainer();
    + return LinklfBaseItemSemanticEditPolicy.getLinkConstraints().canExistLabeledLink_4002(container, getLink(), source, getNewTarget());
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + if (!canExecute()) {
    + throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
    + return reorientSource();
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
    + return reorientTarget();
    + }
    + throw new IllegalStateException();
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult reorientSource() throws ExecutionException {
    + getLink().setSource(getNewSource());
    + return CommandResult.newOKCommandResult(getLink());
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult reorientTarget() throws ExecutionException {
    + getLink().setTarget(getNewTarget());
    + return CommandResult.newOKCommandResult(getLink());
    + }
    +
    + /**
    + * @generated
    + */
    + protected LabeledLink getLink() {
    + return (LabeledLink) getElementToEdit();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getOldSource() {
    + return (Node) oldEnd;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getNewSource() {
    + return (Node) newEnd;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getOldTarget() {
    + return (Node) oldEnd;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getNewTarget() {
    + return (Node) newEnd;
    + }
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkCreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkCreateCommand.java
    new file mode 100644
    index 000000000..1af8dd5c5
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkCreateCommand.java
    @@ -0,0 +1,152 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.Link;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +import org.eclipse.gmf.tooling.examples.linklf.Node;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfBaseItemSemanticEditPolicy;
    +
    +/**
    + * @generated
    + */
    +public class LinkCreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + private final EObject source;
    +
    + /**
    + * @generated
    + */
    + private final EObject target;
    +
    + /**
    + * @generated
    + */
    + private final CanvasElementContainer container;
    +
    + /**
    + * @generated
    + */
    + public LinkCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {
    + super(request.getLabel(), null, request);
    + this.source = source;
    + this.target = target;
    + container = deduceContainer(source, target);
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + if (source == null && target == null) {
    + return false;
    + }
    + if (source != null && false == source instanceof Node) {
    + return false;
    + }
    + if (target != null && false == target instanceof Node) {
    + return false;
    + }
    + if (getSource() == null) {
    + return true; // link creation is in progress; source is not defined yet
    + }
    + // target may be null here but it's possible to check constraint
    + if (getContainer() == null) {
    + return false;
    + }
    + return LinklfBaseItemSemanticEditPolicy.getLinkConstraints().canCreateLink_4001(getContainer(), getSource(), getTarget());
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + if (!canExecute()) {
    + throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
    + }
    +
    + Link newElement = LinklfFactory.eINSTANCE.createLink();
    + getContainer().getElements().add(newElement);
    + newElement.setSource(getSource());
    + newElement.setTarget(getTarget());
    + doConfigure(newElement, monitor, info);
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Link newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + configureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());
    + configureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setElementToEdit(EObject element) {
    + throw new UnsupportedOperationException();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getSource() {
    + return (Node) source;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getTarget() {
    + return (Node) target;
    + }
    +
    + /**
    + * @generated
    + */
    + public CanvasElementContainer getContainer() {
    + return container;
    + }
    +
    + /**
    + * Default approach is to traverse ancestors of the source to find instance of container.
    + * Modify with appropriate logic.
    + * @generated
    + */
    + private static CanvasElementContainer deduceContainer(EObject source, EObject target) {
    + // Find container element for the new link.
    + // Climb up by containment hierarchy starting from the source
    + // and return the first element that is instance of the container class.
    + for (EObject element = source; element != null; element = element.eContainer()) {
    + if (element instanceof CanvasElementContainer) {
    + return (CanvasElementContainer) element;
    + }
    + }
    + return null;
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkReorientCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkReorientCommand.java
    new file mode 100644
    index 000000000..560a8512e
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/LinkReorientCommand.java
    @@ -0,0 +1,157 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.Link;
    +import org.eclipse.gmf.tooling.examples.linklf.Node;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfBaseItemSemanticEditPolicy;
    +
    +/**
    + * @generated
    + */
    +public class LinkReorientCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + private final int reorientDirection;
    +
    + /**
    + * @generated
    + */
    + private final EObject oldEnd;
    +
    + /**
    + * @generated
    + */
    + private final EObject newEnd;
    +
    + /**
    + * @generated
    + */
    + public LinkReorientCommand(ReorientRelationshipRequest request) {
    + super(request.getLabel(), request.getRelationship(), request);
    + reorientDirection = request.getDirection();
    + oldEnd = request.getOldRelationshipEnd();
    + newEnd = request.getNewRelationshipEnd();
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + if (false == getElementToEdit() instanceof Link) {
    + return false;
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
    + return canReorientSource();
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
    + return canReorientTarget();
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean canReorientSource() {
    + if (!(oldEnd instanceof Node && newEnd instanceof Node)) {
    + return false;
    + }
    + Node target = getLink().getTarget();
    + if (!(getLink().eContainer() instanceof CanvasElementContainer)) {
    + return false;
    + }
    + CanvasElementContainer container = (CanvasElementContainer) getLink().eContainer();
    + return LinklfBaseItemSemanticEditPolicy.getLinkConstraints().canExistLink_4001(container, getLink(), getNewSource(), target);
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean canReorientTarget() {
    + if (!(oldEnd instanceof Node && newEnd instanceof Node)) {
    + return false;
    + }
    + Node source = getLink().getSource();
    + if (!(getLink().eContainer() instanceof CanvasElementContainer)) {
    + return false;
    + }
    + CanvasElementContainer container = (CanvasElementContainer) getLink().eContainer();
    + return LinklfBaseItemSemanticEditPolicy.getLinkConstraints().canExistLink_4001(container, getLink(), source, getNewTarget());
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + if (!canExecute()) {
    + throw new ExecutionException("Invalid arguments in reorient link command"); //$NON-NLS-1$
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
    + return reorientSource();
    + }
    + if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
    + return reorientTarget();
    + }
    + throw new IllegalStateException();
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult reorientSource() throws ExecutionException {
    + getLink().setSource(getNewSource());
    + return CommandResult.newOKCommandResult(getLink());
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult reorientTarget() throws ExecutionException {
    + getLink().setTarget(getNewTarget());
    + return CommandResult.newOKCommandResult(getLink());
    + }
    +
    + /**
    + * @generated
    + */
    + protected Link getLink() {
    + return (Link) getElementToEdit();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getOldSource() {
    + return (Node) oldEnd;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getNewSource() {
    + return (Node) newEnd;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getOldTarget() {
    + return (Node) oldEnd;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Node getNewTarget() {
    + return (Node) newEnd;
    + }
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/PortCreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/PortCreateCommand.java
    new file mode 100644
    index 000000000..44815582c
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/PortCreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.Container;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +import org.eclipse.gmf.tooling.examples.linklf.Port;
    +
    +/**
    + * @generated
    + */
    +public class PortCreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public PortCreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Port newElement = LinklfFactory.eINSTANCE.createPort();
    +
    + Container owner = (Container) getElementToEdit();
    + owner.getPorst().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Port newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rectangle2CreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rectangle2CreateCommand.java
    new file mode 100644
    index 000000000..ce5c53a34
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rectangle2CreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +import org.eclipse.gmf.tooling.examples.linklf.Rectangle;
    +
    +/**
    + * @generated
    + */
    +public class Rectangle2CreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public Rectangle2CreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Rectangle newElement = LinklfFactory.eINSTANCE.createRectangle();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Rectangle newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RectangleCreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RectangleCreateCommand.java
    new file mode 100644
    index 000000000..8cf8fb354
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RectangleCreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +import org.eclipse.gmf.tooling.examples.linklf.Rectangle;
    +
    +/**
    + * @generated
    + */
    +public class RectangleCreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public RectangleCreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Rectangle newElement = LinklfFactory.eINSTANCE.createRectangle();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Rectangle newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rhombus2CreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rhombus2CreateCommand.java
    new file mode 100644
    index 000000000..df5f5a220
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/Rhombus2CreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +import org.eclipse.gmf.tooling.examples.linklf.Rhombus;
    +
    +/**
    + * @generated
    + */
    +public class Rhombus2CreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public Rhombus2CreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Rhombus newElement = LinklfFactory.eINSTANCE.createRhombus();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Rhombus newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RhombusCreateCommand.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RhombusCreateCommand.java
    new file mode 100644
    index 000000000..bc5ec14b2
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/commands/RhombusCreateCommand.java
    @@ -0,0 +1,79 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands;
    +
    +import org.eclipse.core.commands.ExecutionException;
    +import org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.core.runtime.IProgressMonitor;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.gmf.runtime.common.core.command.CommandResult;
    +import org.eclipse.gmf.runtime.common.core.command.ICommand;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.CanvasElementContainer;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfFactory;
    +import org.eclipse.gmf.tooling.examples.linklf.Rhombus;
    +
    +/**
    + * @generated
    + */
    +public class RhombusCreateCommand extends EditElementCommand {
    +
    + /**
    + * @generated
    + */
    + public RhombusCreateCommand(CreateElementRequest req) {
    + super(req.getLabel(), null, req);
    + }
    +
    + /**
    + * FIXME: replace with setElementToEdit()
    + * @generated
    + */
    + protected EObject getElementToEdit() {
    + EObject container = ((CreateElementRequest) getRequest()).getContainer();
    + if (container instanceof View) {
    + container = ((View) container).getElement();
    + }
    + return container;
    + }
    +
    + /**
    + * @generated
    + */
    + public boolean canExecute() {
    + return true;
    +
    + }
    +
    + /**
    + * @generated
    + */
    + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + Rhombus newElement = LinklfFactory.eINSTANCE.createRhombus();
    +
    + CanvasElementContainer owner = (CanvasElementContainer) getElementToEdit();
    + owner.getElements().add(newElement);
    +
    + doConfigure(newElement, monitor, info);
    +
    + ((CreateElementRequest) getRequest()).setNewElement(newElement);
    + return CommandResult.newOKCommandResult(newElement);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void doConfigure(Rhombus newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    + IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
    + ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
    + configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
    + configureRequest.addParameters(getRequest().getParameters());
    + ICommand configureCommand = elementType.getEditCommand(configureRequest);
    + if (configureCommand != null && configureCommand.canExecute()) {
    + configureCommand.execute(monitor, info);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CanvasEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CanvasEditHelper.java
    new file mode 100644
    index 000000000..b8fd04eed
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CanvasEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class CanvasEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CircleEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CircleEditHelper.java
    new file mode 100644
    index 000000000..d013f6e65
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/CircleEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class CircleEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/ContainerEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/ContainerEditHelper.java
    new file mode 100644
    index 000000000..392d30be7
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/ContainerEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class ContainerEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LabeledLinkEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LabeledLinkEditHelper.java
    new file mode 100644
    index 000000000..e7e1dd63e
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LabeledLinkEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinkEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinkEditHelper.java
    new file mode 100644
    index 000000000..efd46b9a3
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinkEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class LinkEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinklfBaseEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinklfBaseEditHelper.java
    new file mode 100644
    index 000000000..f9e829f14
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/LinklfBaseEditHelper.java
    @@ -0,0 +1,10 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +import org.eclipse.gmf.tooling.runtime.edit.helpers.GeneratedEditHelperBase;
    +
    +/**
    + * @generated
    + */
    +public class LinklfBaseEditHelper extends GeneratedEditHelperBase {
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/PortEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/PortEditHelper.java
    new file mode 100644
    index 000000000..5df1ce4af
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/PortEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class PortEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RectangleEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RectangleEditHelper.java
    new file mode 100644
    index 000000000..1929242e7
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RectangleEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class RectangleEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RhombusEditHelper.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RhombusEditHelper.java
    new file mode 100644
    index 000000000..ae5fa96e5
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/helpers/RhombusEditHelper.java
    @@ -0,0 +1,7 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.helpers;
    +
    +/**
    + * @generated
    + */
    +public class RhombusEditHelper extends LinklfBaseEditHelper {
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CanvasEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CanvasEditPart.java
    new file mode 100644
    index 000000000..e91aecf60
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CanvasEditPart.java
    @@ -0,0 +1,44 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.CanvasCanonicalEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.CanvasItemSemanticEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
    +
    +/**
    + * @generated
    + */
    +public class CanvasEditPart extends DiagramEditPart {
    +
    + /**
    + * @generated
    + */
    + public final static String MODEL_ID = "linklf"; //$NON-NLS-1$
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 1000;
    +
    + /**
    + * @generated
    + */
    + public CanvasEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CanvasItemSemanticEditPolicy());
    + installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new CanvasCanonicalEditPolicy());
    + installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicyWithCustomReparent(LinklfVisualIDRegistry.TYPED_INSTANCE));
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Circle2EditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Circle2EditPart.java
    new file mode 100644
    index 000000000..75410db2c
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Circle2EditPart.java
    @@ -0,0 +1,197 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.ColorConstants;
    +import org.eclipse.draw2d.Ellipse;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
    +import org.eclipse.gef.requests.CreateRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.Circle2ItemSemanticEditPolicy;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class Circle2EditPart extends ShapeNodeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 3001;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public Circle2EditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Circle2ItemSemanticEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    + if (result == null) {
    + result = new NonResizableEditPolicy();
    + }
    + return result;
    + }
    +
    + protected Command getMoveChildrenCommand(Request request) {
    + return null;
    + }
    +
    + protected Command getCreateCommand(CreateRequest request) {
    + return null;
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new CircleFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public CircleFigure getPrimaryShape() {
    + return (CircleFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createNodeFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public class CircleFigure extends Ellipse {
    +
    + /**
    + * @generated
    + */
    + public CircleFigure() {
    + this.setLayoutManager(new StackLayout());
    + this.setLineWidth(2);
    + this.setForegroundColor(ColorConstants.lightBlue);
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CircleEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CircleEditPart.java
    new file mode 100644
    index 000000000..d163b89c6
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/CircleEditPart.java
    @@ -0,0 +1,197 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.ColorConstants;
    +import org.eclipse.draw2d.Ellipse;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
    +import org.eclipse.gef.requests.CreateRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.CircleItemSemanticEditPolicy;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class CircleEditPart extends ShapeNodeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 2001;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public CircleEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CircleItemSemanticEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    + if (result == null) {
    + result = new NonResizableEditPolicy();
    + }
    + return result;
    + }
    +
    + protected Command getMoveChildrenCommand(Request request) {
    + return null;
    + }
    +
    + protected Command getCreateCommand(CreateRequest request) {
    + return null;
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new CircleFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public CircleFigure getPrimaryShape() {
    + return (CircleFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createNodeFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public class CircleFigure extends Ellipse {
    +
    + /**
    + * @generated
    + */
    + public CircleFigure() {
    + this.setLayoutManager(new StackLayout());
    + this.setLineWidth(2);
    + this.setForegroundColor(ColorConstants.lightBlue);
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Container2EditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Container2EditPart.java
    new file mode 100644
    index 000000000..8a3778b09
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Container2EditPart.java
    @@ -0,0 +1,338 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.BorderLayout;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.PositionConstants;
    +import org.eclipse.draw2d.RectangleFigure;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.Container2CanonicalEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.Container2ItemSemanticEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfTextSelectionEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class Container2EditPart extends AbstractBorderedShapeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 3002;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public Container2EditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicyWithCustomReparent(LinklfVisualIDRegistry.TYPED_INSTANCE));
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Container2ItemSemanticEditPolicy());
    + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    + installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new Container2CanonicalEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    +
    + ConstrainedToolbarLayoutEditPolicy lep = new ConstrainedToolbarLayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + View childView = (View) child.getModel();
    + switch (LinklfVisualIDRegistry.getVisualID(childView)) {
    + case PortEditPart.VISUAL_ID:
    + return new BorderItemSelectionEditPolicy();
    + }
    + if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
    + if (child instanceof ITextAwareEditPart) {
    + return new LinklfTextSelectionEditPolicy();
    + }
    + }
    + return super.createChildEditPolicy(child);
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new ContainerFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public ContainerFigure getPrimaryShape() {
    + return (ContainerFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean addFixedChild(EditPart childEditPart) {
    + if (childEditPart instanceof ContainerName2EditPart) {
    + ((ContainerName2EditPart) childEditPart).setLabel(getPrimaryShape().getFigureContainerNameFigure());
    + return true;
    + }
    + if (childEditPart instanceof ContainerContainerCompartment2EditPart) {
    + IFigure pane = getPrimaryShape().getFigureContainerCompartmentFigure();
    + setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
    + pane.add(((ContainerContainerCompartment2EditPart) childEditPart).getFigure());
    + return true;
    + }
    + if (childEditPart instanceof PortEditPart) {
    + BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.NONE);
    + getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
    + return true;
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean removeFixedChild(EditPart childEditPart) {
    + if (childEditPart instanceof ContainerName2EditPart) {
    + return true;
    + }
    + if (childEditPart instanceof ContainerContainerCompartment2EditPart) {
    + IFigure pane = getPrimaryShape().getFigureContainerCompartmentFigure();
    + pane.remove(((ContainerContainerCompartment2EditPart) childEditPart).getFigure());
    + return true;
    + }
    + if (childEditPart instanceof PortEditPart) {
    + getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
    + return true;
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addChildVisual(EditPart childEditPart, int index) {
    + if (addFixedChild(childEditPart)) {
    + return;
    + }
    + super.addChildVisual(childEditPart, -1);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeChildVisual(EditPart childEditPart) {
    + if (removeFixedChild(childEditPart)) {
    + return;
    + }
    + super.removeChildVisual(childEditPart);
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
    + if (editPart instanceof ContainerContainerCompartment2EditPart) {
    + return getPrimaryShape().getFigureContainerCompartmentFigure();
    + }
    + if (editPart instanceof IBorderItemEditPart) {
    + return getBorderedFigure().getBorderItemContainer();
    + }
    + return getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createMainFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + if (nodeShape.getLayoutManager() == null) {
    + ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
    + layout.setSpacing(5);
    + nodeShape.setLayoutManager(layout);
    + }
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public EditPart getPrimaryChildEditPart() {
    + return getChildBySemanticHint(LinklfVisualIDRegistry.getType(ContainerName2EditPart.VISUAL_ID));
    + }
    +
    + /**
    + * @generated
    + */
    + public class ContainerFigure extends RectangleFigure {
    +
    + /**
    + * @generated
    + */
    + private RectangleFigure fFigureContainerCompartmentFigure;
    +
    + /**
    + * @generated
    + */
    + private WrappingLabel fFigureContainerNameFigure;
    +
    + /**
    + * @generated
    + */
    + public ContainerFigure() {
    +
    + BorderLayout layoutThis = new BorderLayout();
    + this.setLayoutManager(layoutThis);
    +
    + createContents();
    + }
    +
    + /**
    + * @generated
    + */
    + private void createContents() {
    +
    + fFigureContainerNameFigure = new WrappingLabel();
    +
    + fFigureContainerNameFigure.setText("<...>");
    +
    + this.add(fFigureContainerNameFigure, BorderLayout.TOP);
    +
    + fFigureContainerCompartmentFigure = new RectangleFigure();
    +
    + this.add(fFigureContainerCompartmentFigure, BorderLayout.CENTER);
    +
    + }
    +
    + /**
    + * @generated
    + */
    + public RectangleFigure getFigureContainerCompartmentFigure() {
    + return fFigureContainerCompartmentFigure;
    + }
    +
    + /**
    + * @generated
    + */
    + public WrappingLabel getFigureContainerNameFigure() {
    + return fFigureContainerNameFigure;
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartment2EditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartment2EditPart.java
    new file mode 100644
    index 000000000..8048c05c0
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartment2EditPart.java
    @@ -0,0 +1,97 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.ContainerContainerCompartment2CanonicalEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.ContainerContainerCompartment2ItemSemanticEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.Messages;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
    +
    +/**
    + * @generated
    + */
    +public class ContainerContainerCompartment2EditPart extends ShapeCompartmentEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 7002;
    +
    + /**
    + * @generated
    + */
    + public ContainerContainerCompartment2EditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + public String getCompartmentName() {
    + return Messages.ContainerContainerCompartment2EditPart_title;
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure createFigure() {
    + ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
    + result.setTitleVisibility(false);
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ContainerContainerCompartment2ItemSemanticEditPolicy());
    + installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicyWithCustomReparent(LinklfVisualIDRegistry.TYPED_INSTANCE));
    + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    + installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ContainerContainerCompartment2CanonicalEditPolicy());
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setRatio(Double ratio) {
    + // nothing to do -- parent layout does not accept Double constraints as ratio
    + // super.setRatio(ratio);
    + }
    +
    + /**
    + * @generated
    + */
    + public EditPart getTargetEditPart(Request request) {
    + if (request instanceof CreateViewAndElementRequest) {
    + CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
    + IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
    + if (type == LinklfElementTypes.Circle_3001) {
    + return this;
    + }
    + if (type == LinklfElementTypes.Container_3002) {
    + return this;
    + }
    + if (type == LinklfElementTypes.Rectangle_3003) {
    + return this;
    + }
    + if (type == LinklfElementTypes.Rhombus_3004) {
    + return this;
    + }
    + return getParent().getTargetEditPart(request);
    + }
    + return super.getTargetEditPart(request);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartmentEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartmentEditPart.java
    new file mode 100644
    index 000000000..715e82071
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerContainerCompartmentEditPart.java
    @@ -0,0 +1,97 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.IElementType;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.ContainerContainerCompartmentCanonicalEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.ContainerContainerCompartmentItemSemanticEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.Messages;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
    +
    +/**
    + * @generated
    + */
    +public class ContainerContainerCompartmentEditPart extends ShapeCompartmentEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 7001;
    +
    + /**
    + * @generated
    + */
    + public ContainerContainerCompartmentEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + public String getCompartmentName() {
    + return Messages.ContainerContainerCompartmentEditPart_title;
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure createFigure() {
    + ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
    + result.setTitleVisibility(false);
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ContainerContainerCompartmentItemSemanticEditPolicy());
    + installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicyWithCustomReparent(LinklfVisualIDRegistry.TYPED_INSTANCE));
    + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    + installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ContainerContainerCompartmentCanonicalEditPolicy());
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setRatio(Double ratio) {
    + // nothing to do -- parent layout does not accept Double constraints as ratio
    + // super.setRatio(ratio);
    + }
    +
    + /**
    + * @generated
    + */
    + public EditPart getTargetEditPart(Request request) {
    + if (request instanceof CreateViewAndElementRequest) {
    + CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
    + IElementType type = (IElementType) adapter.getAdapter(IElementType.class);
    + if (type == LinklfElementTypes.Circle_3001) {
    + return this;
    + }
    + if (type == LinklfElementTypes.Container_3002) {
    + return this;
    + }
    + if (type == LinklfElementTypes.Rectangle_3003) {
    + return this;
    + }
    + if (type == LinklfElementTypes.Rhombus_3004) {
    + return this;
    + }
    + return getParent().getTargetEditPart(request);
    + }
    + return super.getTargetEditPart(request);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerEditPart.java
    new file mode 100644
    index 000000000..461b88a47
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerEditPart.java
    @@ -0,0 +1,338 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.BorderLayout;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.PositionConstants;
    +import org.eclipse.draw2d.RectangleFigure;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.BorderItemSelectionEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.ContainerCanonicalEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.ContainerItemSemanticEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfTextSelectionEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class ContainerEditPart extends AbstractBorderedShapeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 2003;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public ContainerEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicyWithCustomReparent(LinklfVisualIDRegistry.TYPED_INSTANCE));
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ContainerItemSemanticEditPolicy());
    + installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
    + installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ContainerCanonicalEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    +
    + ConstrainedToolbarLayoutEditPolicy lep = new ConstrainedToolbarLayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + View childView = (View) child.getModel();
    + switch (LinklfVisualIDRegistry.getVisualID(childView)) {
    + case PortEditPart.VISUAL_ID:
    + return new BorderItemSelectionEditPolicy();
    + }
    + if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null) {
    + if (child instanceof ITextAwareEditPart) {
    + return new LinklfTextSelectionEditPolicy();
    + }
    + }
    + return super.createChildEditPolicy(child);
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new ContainerFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public ContainerFigure getPrimaryShape() {
    + return (ContainerFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean addFixedChild(EditPart childEditPart) {
    + if (childEditPart instanceof ContainerNameEditPart) {
    + ((ContainerNameEditPart) childEditPart).setLabel(getPrimaryShape().getFigureContainerNameFigure());
    + return true;
    + }
    + if (childEditPart instanceof ContainerContainerCompartmentEditPart) {
    + IFigure pane = getPrimaryShape().getFigureContainerCompartmentFigure();
    + setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
    + pane.add(((ContainerContainerCompartmentEditPart) childEditPart).getFigure());
    + return true;
    + }
    + if (childEditPart instanceof PortEditPart) {
    + BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.NONE);
    + getBorderedFigure().getBorderItemContainer().add(((PortEditPart) childEditPart).getFigure(), locator);
    + return true;
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean removeFixedChild(EditPart childEditPart) {
    + if (childEditPart instanceof ContainerNameEditPart) {
    + return true;
    + }
    + if (childEditPart instanceof ContainerContainerCompartmentEditPart) {
    + IFigure pane = getPrimaryShape().getFigureContainerCompartmentFigure();
    + pane.remove(((ContainerContainerCompartmentEditPart) childEditPart).getFigure());
    + return true;
    + }
    + if (childEditPart instanceof PortEditPart) {
    + getBorderedFigure().getBorderItemContainer().remove(((PortEditPart) childEditPart).getFigure());
    + return true;
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addChildVisual(EditPart childEditPart, int index) {
    + if (addFixedChild(childEditPart)) {
    + return;
    + }
    + super.addChildVisual(childEditPart, -1);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeChildVisual(EditPart childEditPart) {
    + if (removeFixedChild(childEditPart)) {
    + return;
    + }
    + super.removeChildVisual(childEditPart);
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
    + if (editPart instanceof ContainerContainerCompartmentEditPart) {
    + return getPrimaryShape().getFigureContainerCompartmentFigure();
    + }
    + if (editPart instanceof IBorderItemEditPart) {
    + return getBorderedFigure().getBorderItemContainer();
    + }
    + return getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createMainFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + if (nodeShape.getLayoutManager() == null) {
    + ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
    + layout.setSpacing(5);
    + nodeShape.setLayoutManager(layout);
    + }
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public EditPart getPrimaryChildEditPart() {
    + return getChildBySemanticHint(LinklfVisualIDRegistry.getType(ContainerNameEditPart.VISUAL_ID));
    + }
    +
    + /**
    + * @generated
    + */
    + public class ContainerFigure extends RectangleFigure {
    +
    + /**
    + * @generated
    + */
    + private RectangleFigure fFigureContainerCompartmentFigure;
    +
    + /**
    + * @generated
    + */
    + private WrappingLabel fFigureContainerNameFigure;
    +
    + /**
    + * @generated
    + */
    + public ContainerFigure() {
    +
    + BorderLayout layoutThis = new BorderLayout();
    + this.setLayoutManager(layoutThis);
    +
    + createContents();
    + }
    +
    + /**
    + * @generated
    + */
    + private void createContents() {
    +
    + fFigureContainerNameFigure = new WrappingLabel();
    +
    + fFigureContainerNameFigure.setText("<...>");
    +
    + this.add(fFigureContainerNameFigure, BorderLayout.TOP);
    +
    + fFigureContainerCompartmentFigure = new RectangleFigure();
    +
    + this.add(fFigureContainerCompartmentFigure, BorderLayout.CENTER);
    +
    + }
    +
    + /**
    + * @generated
    + */
    + public RectangleFigure getFigureContainerCompartmentFigure() {
    + return fFigureContainerCompartmentFigure;
    + }
    +
    + /**
    + * @generated
    + */
    + public WrappingLabel getFigureContainerNameFigure() {
    + return fFigureContainerNameFigure;
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerName2EditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerName2EditPart.java
    new file mode 100644
    index 000000000..fc377f095
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerName2EditPart.java
    @@ -0,0 +1,584 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import java.util.Collections;
    +import java.util.List;
    +
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Label;
    +import org.eclipse.draw2d.geometry.Point;
    +import org.eclipse.emf.common.notify.Notification;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.emf.transaction.RunnableWithResult;
    +import org.eclipse.gef.AccessibleEditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.requests.DirectEditRequest;
    +import org.eclipse.gef.tools.DirectEditManager;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
    +import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
    +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
    +import org.eclipse.gmf.runtime.notation.FontStyle;
    +import org.eclipse.gmf.runtime.notation.NotationPackage;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfTextSelectionEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfParserProvider;
    +import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
    +import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
    +import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
    +import org.eclipse.jface.viewers.ICellEditorValidator;
    +import org.eclipse.swt.SWT;
    +import org.eclipse.swt.accessibility.AccessibleEvent;
    +import org.eclipse.swt.graphics.Color;
    +import org.eclipse.swt.graphics.FontData;
    +import org.eclipse.swt.graphics.Image;
    +
    +/**
    + * @generated
    + */
    +public class ContainerName2EditPart extends CompartmentEditPart implements ITextAwareEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 5001;
    +
    + /**
    + * @generated
    + */
    + private DirectEditManager manager;
    +
    + /**
    + * @generated
    + */
    + private IParser parser;
    +
    + /**
    + * @generated
    + */
    + private List<?> parserElements;
    +
    + /**
    + * @generated
    + */
    + private String defaultText;
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate labelDelegate;
    +
    + /**
    + * @generated
    + */
    + public ContainerName2EditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new LinklfTextSelectionEditPolicy());
    + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelTextHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getText();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getText();
    + } else {
    + return getLabelDelegate().getText();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelTextHelper(IFigure figure, String text) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setText(text);
    + } else if (figure instanceof Label) {
    + ((Label) figure).setText(text);
    + } else {
    + getLabelDelegate().setText(text);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIconHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getIcon();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getIcon();
    + } else {
    + return getLabelDelegate().getIcon(0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelIconHelper(IFigure figure, Image icon) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setIcon(icon);
    + return;
    + } else if (figure instanceof Label) {
    + ((Label) figure).setIcon(icon);
    + return;
    + } else {
    + getLabelDelegate().setIcon(icon, 0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabel(WrappingLabel figure) {
    + unregisterVisuals();
    + setFigure(figure);
    + defaultText = getLabelTextHelper(figure);
    + registerVisuals();
    + refreshVisuals();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getModelChildren() {
    + return Collections.EMPTY_LIST;
    + }
    +
    + /**
    + * @generated
    + */
    + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + protected EObject getParserElement() {
    + return resolveSemanticElement();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIcon() {
    + EObject parserElement = getParserElement();
    + if (parserElement == null) {
    + return null;
    + }
    + return LinklfElementTypes.getImage(parserElement.eClass());
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelText() {
    + String text = null;
    + EObject parserElement = getParserElement();
    + if (parserElement != null && getParser() != null) {
    + text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
    + }
    + if (text == null || text.length() == 0) {
    + text = defaultText;
    + }
    + return text;
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabelText(String text) {
    + setLabelTextHelper(getFigure(), text);
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + public String getEditText() {
    + if (getParserElement() == null || getParser() == null) {
    + return ""; //$NON-NLS-1$
    + }
    + return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isEditable() {
    + return getParser() != null;
    + }
    +
    + /**
    + * @generated
    + */
    + public ICellEditorValidator getEditTextValidator() {
    + return new ICellEditorValidator() {
    +
    + public String isValid(final Object value) {
    + if (value instanceof String) {
    + final EObject element = getParserElement();
    + final IParser parser = getParser();
    + try {
    + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {
    +
    + public void run() {
    + setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
    + }
    + });
    + return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
    + } catch (InterruptedException ie) {
    + ie.printStackTrace();
    + }
    + }
    +
    + // shouldn't get here
    + return null;
    + }
    + };
    + }
    +
    + /**
    + * @generated
    + */
    + public IContentAssistProcessor getCompletionProcessor() {
    + if (getParserElement() == null || getParser() == null) {
    + return null;
    + }
    + return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
    + }
    +
    + /**
    + * @generated
    + */
    + public ParserOptions getParserOptions() {
    + return ParserOptions.NONE;
    + }
    +
    + /**
    + * @generated
    + */
    + public IParser getParser() {
    + if (parser == null) {
    + parser = LinklfParserProvider.getParser(LinklfElementTypes.Container_3002, getParserElement(),
    + LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.ContainerName2EditPart.VISUAL_ID));
    + }
    + return parser;
    + }
    +
    + /**
    + * @generated
    + */
    + protected DirectEditManager getManager() {
    + if (manager == null) {
    + setManager(new TextDirectEditManager2(this, null, LinklfEditPartFactory.getTextCellEditorLocator(this)));
    + }
    + return manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setManager(DirectEditManager manager) {
    + this.manager = manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit() {
    + getManager().show();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit(Point eventLocation) {
    + if (getManager().getClass() == TextDirectEditManager2.class) {
    + ((TextDirectEditManager2) getManager()).show(eventLocation.getSWTPoint());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void performDirectEdit(char initialCharacter) {
    + if (getManager() instanceof TextDirectEditManager) {
    + ((TextDirectEditManager) getManager()).show(initialCharacter);
    + } else //
    + if (getManager() instanceof TextDirectEditManager2) {
    + ((TextDirectEditManager2) getManager()).show(initialCharacter);
    + } else //
    + {
    + performDirectEdit();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEditRequest(Request request) {
    + final Request theRequest = request;
    + try {
    + getEditingDomain().runExclusive(new Runnable() {
    +
    + public void run() {
    + if (isActive() && isEditable()) {
    + if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
    + Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
    + performDirectEdit(initialChar.charValue());
    + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
    + DirectEditRequest editRequest = (DirectEditRequest) theRequest;
    + performDirectEdit(editRequest.getLocation());
    + } else {
    + performDirectEdit();
    + }
    + }
    + }
    + });
    + } catch (InterruptedException e) {
    + e.printStackTrace();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshVisuals() {
    + super.refreshVisuals();
    + refreshLabel();
    + refreshFont();
    + refreshFontColor();
    + refreshUnderline();
    + refreshStrikeThrough();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshLabel() {
    + setLabelTextHelper(getFigure(), getLabelText());
    + setLabelIconHelper(getFigure(), getLabelIcon());
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshUnderline() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshStrikeThrough() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshFont() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null) {
    + FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
    + setFont(fontData);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void refreshSelectionFeedback() {
    + requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
    + requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
    + Object editPolicy = getEditPolicy(editPolicyKey);
    + if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
    + ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setFontColor(Color color) {
    + getFigure().setForegroundColor(color);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addSemanticListeners() {
    + if (getParser() instanceof ISemanticParser) {
    + EObject element = resolveSemanticElement();
    + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
    + for (int i = 0; i < parserElements.size(); i++) {
    + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
    + }
    + } else {
    + super.addSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeSemanticListeners() {
    + if (parserElements != null) {
    + for (int i = 0; i < parserElements.size(); i++) {
    + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
    + }
    + } else {
    + super.removeSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected AccessibleEditPart getAccessibleEditPart() {
    + if (accessibleEP == null) {
    + accessibleEP = new AccessibleGraphicalEditPart() {
    +
    + public void getName(AccessibleEvent e) {
    + e.result = getLabelTextHelper(getFigure());
    + }
    + };
    + }
    + return accessibleEP;
    + }
    +
    + /**
    + * @generated
    + */
    + private View getFontStyleOwnerView() {
    + return getPrimaryView();
    + }
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate getLabelDelegate() {
    + if (labelDelegate == null) {
    + IFigure label = getFigure();
    + if (label instanceof WrappingLabel) {
    + labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
    + } else {
    + labelDelegate = new SimpleLabelDelegate((Label) label);
    + }
    + }
    + return labelDelegate;
    + }
    +
    + /**
    + * @generated
    + */
    + @Override
    + public Object getAdapter(Class key) {
    + if (ILabelDelegate.class.equals(key)) {
    + return getLabelDelegate();
    + }
    + return super.getAdapter(key);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addNotationalListeners() {
    + super.addNotationalListeners();
    + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeNotationalListeners() {
    + super.removeNotationalListeners();
    + removeListenerFilter("PrimaryView"); //$NON-NLS-1$
    + }
    +
    + /**
    + * @generated
    + */
    + protected void handleNotificationEvent(Notification event) {
    + Object feature = event.getFeature();
    + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
    + Integer c = (Integer) event.getNewValue();
    + setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
    + refreshUnderline();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
    + refreshStrikeThrough();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
    + || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
    + refreshFont();
    + } else {
    + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
    + refreshLabel();
    + }
    + if (getParser() instanceof ISemanticParser) {
    + ISemanticParser modelParser = (ISemanticParser) getParser();
    + if (modelParser.areSemanticElementsAffected(null, event)) {
    + removeSemanticListeners();
    + if (resolveSemanticElement() != null) {
    + addSemanticListeners();
    + }
    + refreshLabel();
    + }
    + }
    + }
    + super.handleNotificationEvent(event);
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createFigure() {
    + // Parent should assign one using setLabel() method
    + return null;
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerNameEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerNameEditPart.java
    new file mode 100644
    index 000000000..bfeca3b4a
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/ContainerNameEditPart.java
    @@ -0,0 +1,584 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import java.util.Collections;
    +import java.util.List;
    +
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Label;
    +import org.eclipse.draw2d.geometry.Point;
    +import org.eclipse.emf.common.notify.Notification;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.emf.transaction.RunnableWithResult;
    +import org.eclipse.gef.AccessibleEditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.requests.DirectEditRequest;
    +import org.eclipse.gef.tools.DirectEditManager;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
    +import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
    +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
    +import org.eclipse.gmf.runtime.notation.FontStyle;
    +import org.eclipse.gmf.runtime.notation.NotationPackage;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfTextSelectionEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfParserProvider;
    +import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
    +import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
    +import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
    +import org.eclipse.jface.viewers.ICellEditorValidator;
    +import org.eclipse.swt.SWT;
    +import org.eclipse.swt.accessibility.AccessibleEvent;
    +import org.eclipse.swt.graphics.Color;
    +import org.eclipse.swt.graphics.FontData;
    +import org.eclipse.swt.graphics.Image;
    +
    +/**
    + * @generated
    + */
    +public class ContainerNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 5002;
    +
    + /**
    + * @generated
    + */
    + private DirectEditManager manager;
    +
    + /**
    + * @generated
    + */
    + private IParser parser;
    +
    + /**
    + * @generated
    + */
    + private List<?> parserElements;
    +
    + /**
    + * @generated
    + */
    + private String defaultText;
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate labelDelegate;
    +
    + /**
    + * @generated
    + */
    + public ContainerNameEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new LinklfTextSelectionEditPolicy());
    + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultNodeLabelDragPolicy());
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelTextHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getText();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getText();
    + } else {
    + return getLabelDelegate().getText();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelTextHelper(IFigure figure, String text) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setText(text);
    + } else if (figure instanceof Label) {
    + ((Label) figure).setText(text);
    + } else {
    + getLabelDelegate().setText(text);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIconHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getIcon();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getIcon();
    + } else {
    + return getLabelDelegate().getIcon(0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelIconHelper(IFigure figure, Image icon) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setIcon(icon);
    + return;
    + } else if (figure instanceof Label) {
    + ((Label) figure).setIcon(icon);
    + return;
    + } else {
    + getLabelDelegate().setIcon(icon, 0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabel(WrappingLabel figure) {
    + unregisterVisuals();
    + setFigure(figure);
    + defaultText = getLabelTextHelper(figure);
    + registerVisuals();
    + refreshVisuals();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getModelChildren() {
    + return Collections.EMPTY_LIST;
    + }
    +
    + /**
    + * @generated
    + */
    + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + protected EObject getParserElement() {
    + return resolveSemanticElement();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIcon() {
    + EObject parserElement = getParserElement();
    + if (parserElement == null) {
    + return null;
    + }
    + return LinklfElementTypes.getImage(parserElement.eClass());
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelText() {
    + String text = null;
    + EObject parserElement = getParserElement();
    + if (parserElement != null && getParser() != null) {
    + text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
    + }
    + if (text == null || text.length() == 0) {
    + text = defaultText;
    + }
    + return text;
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabelText(String text) {
    + setLabelTextHelper(getFigure(), text);
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + public String getEditText() {
    + if (getParserElement() == null || getParser() == null) {
    + return ""; //$NON-NLS-1$
    + }
    + return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isEditable() {
    + return getParser() != null;
    + }
    +
    + /**
    + * @generated
    + */
    + public ICellEditorValidator getEditTextValidator() {
    + return new ICellEditorValidator() {
    +
    + public String isValid(final Object value) {
    + if (value instanceof String) {
    + final EObject element = getParserElement();
    + final IParser parser = getParser();
    + try {
    + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {
    +
    + public void run() {
    + setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
    + }
    + });
    + return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
    + } catch (InterruptedException ie) {
    + ie.printStackTrace();
    + }
    + }
    +
    + // shouldn't get here
    + return null;
    + }
    + };
    + }
    +
    + /**
    + * @generated
    + */
    + public IContentAssistProcessor getCompletionProcessor() {
    + if (getParserElement() == null || getParser() == null) {
    + return null;
    + }
    + return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
    + }
    +
    + /**
    + * @generated
    + */
    + public ParserOptions getParserOptions() {
    + return ParserOptions.NONE;
    + }
    +
    + /**
    + * @generated
    + */
    + public IParser getParser() {
    + if (parser == null) {
    + parser = LinklfParserProvider.getParser(LinklfElementTypes.Container_2003, getParserElement(),
    + LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.ContainerNameEditPart.VISUAL_ID));
    + }
    + return parser;
    + }
    +
    + /**
    + * @generated
    + */
    + protected DirectEditManager getManager() {
    + if (manager == null) {
    + setManager(new TextDirectEditManager2(this, null, LinklfEditPartFactory.getTextCellEditorLocator(this)));
    + }
    + return manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setManager(DirectEditManager manager) {
    + this.manager = manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit() {
    + getManager().show();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit(Point eventLocation) {
    + if (getManager().getClass() == TextDirectEditManager2.class) {
    + ((TextDirectEditManager2) getManager()).show(eventLocation.getSWTPoint());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void performDirectEdit(char initialCharacter) {
    + if (getManager() instanceof TextDirectEditManager) {
    + ((TextDirectEditManager) getManager()).show(initialCharacter);
    + } else //
    + if (getManager() instanceof TextDirectEditManager2) {
    + ((TextDirectEditManager2) getManager()).show(initialCharacter);
    + } else //
    + {
    + performDirectEdit();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEditRequest(Request request) {
    + final Request theRequest = request;
    + try {
    + getEditingDomain().runExclusive(new Runnable() {
    +
    + public void run() {
    + if (isActive() && isEditable()) {
    + if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
    + Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
    + performDirectEdit(initialChar.charValue());
    + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
    + DirectEditRequest editRequest = (DirectEditRequest) theRequest;
    + performDirectEdit(editRequest.getLocation());
    + } else {
    + performDirectEdit();
    + }
    + }
    + }
    + });
    + } catch (InterruptedException e) {
    + e.printStackTrace();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshVisuals() {
    + super.refreshVisuals();
    + refreshLabel();
    + refreshFont();
    + refreshFontColor();
    + refreshUnderline();
    + refreshStrikeThrough();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshLabel() {
    + setLabelTextHelper(getFigure(), getLabelText());
    + setLabelIconHelper(getFigure(), getLabelIcon());
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshUnderline() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshStrikeThrough() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshFont() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null) {
    + FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
    + setFont(fontData);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void refreshSelectionFeedback() {
    + requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
    + requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
    + Object editPolicy = getEditPolicy(editPolicyKey);
    + if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
    + ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setFontColor(Color color) {
    + getFigure().setForegroundColor(color);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addSemanticListeners() {
    + if (getParser() instanceof ISemanticParser) {
    + EObject element = resolveSemanticElement();
    + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
    + for (int i = 0; i < parserElements.size(); i++) {
    + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
    + }
    + } else {
    + super.addSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeSemanticListeners() {
    + if (parserElements != null) {
    + for (int i = 0; i < parserElements.size(); i++) {
    + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
    + }
    + } else {
    + super.removeSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected AccessibleEditPart getAccessibleEditPart() {
    + if (accessibleEP == null) {
    + accessibleEP = new AccessibleGraphicalEditPart() {
    +
    + public void getName(AccessibleEvent e) {
    + e.result = getLabelTextHelper(getFigure());
    + }
    + };
    + }
    + return accessibleEP;
    + }
    +
    + /**
    + * @generated
    + */
    + private View getFontStyleOwnerView() {
    + return getPrimaryView();
    + }
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate getLabelDelegate() {
    + if (labelDelegate == null) {
    + IFigure label = getFigure();
    + if (label instanceof WrappingLabel) {
    + labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
    + } else {
    + labelDelegate = new SimpleLabelDelegate((Label) label);
    + }
    + }
    + return labelDelegate;
    + }
    +
    + /**
    + * @generated
    + */
    + @Override
    + public Object getAdapter(Class key) {
    + if (ILabelDelegate.class.equals(key)) {
    + return getLabelDelegate();
    + }
    + return super.getAdapter(key);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addNotationalListeners() {
    + super.addNotationalListeners();
    + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeNotationalListeners() {
    + super.removeNotationalListeners();
    + removeListenerFilter("PrimaryView"); //$NON-NLS-1$
    + }
    +
    + /**
    + * @generated
    + */
    + protected void handleNotificationEvent(Notification event) {
    + Object feature = event.getFeature();
    + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
    + Integer c = (Integer) event.getNewValue();
    + setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
    + refreshUnderline();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
    + refreshStrikeThrough();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
    + || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
    + refreshFont();
    + } else {
    + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
    + refreshLabel();
    + }
    + if (getParser() instanceof ISemanticParser) {
    + ISemanticParser modelParser = (ISemanticParser) getParser();
    + if (modelParser.areSemanticElementsAffected(null, event)) {
    + removeSemanticListeners();
    + if (resolveSemanticElement() != null) {
    + addSemanticListeners();
    + }
    + refreshLabel();
    + }
    + }
    + }
    + super.handleNotificationEvent(event);
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createFigure() {
    + // Parent should assign one using setLabel() method
    + return null;
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkEditPart.java
    new file mode 100644
    index 000000000..3f3e134d1
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkEditPart.java
    @@ -0,0 +1,135 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.Connection;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LabeledLinkItemSemanticEditPolicy;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 4002;
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new LabeledLinkItemSemanticEditPolicy());
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + /**
    + * @generated
    + */
    + protected Connection createConnectionFigure() {
    + return new LabeledLinkFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkFigure getPrimaryShape() {
    + return (LabeledLinkFigure) getFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public class LabeledLinkFigure extends PolylineConnectionEx {
    +
    + /**
    + * @generated
    + */
    + private WrappingLabel fFigureSourceNameFIgure;
    +
    + /**
    + * @generated
    + */
    + private WrappingLabel fFigureTargetNameFigure;
    +
    + /**
    + * @generated
    + */
    + private WrappingLabel fFigureLinkName;
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkFigure() {
    +
    + createContents();
    + }
    +
    + /**
    + * @generated
    + */
    + private void createContents() {
    +
    + fFigureLinkName = new WrappingLabel();
    +
    + fFigureLinkName.setText("LabeldLink");
    +
    + this.add(fFigureLinkName);
    +
    + fFigureSourceNameFIgure = new WrappingLabel();
    +
    + fFigureSourceNameFIgure.setText("Source");
    +
    + this.add(fFigureSourceNameFIgure);
    +
    + fFigureTargetNameFigure = new WrappingLabel();
    +
    + fFigureTargetNameFigure.setText("Target");
    +
    + this.add(fFigureTargetNameFigure);
    +
    + }
    +
    + /**
    + * @generated
    + */
    + public WrappingLabel getFigureSourceNameFIgure() {
    + return fFigureSourceNameFIgure;
    + }
    +
    + /**
    + * @generated
    + */
    + public WrappingLabel getFigureTargetNameFigure() {
    + return fFigureTargetNameFigure;
    + }
    +
    + /**
    + * @generated
    + */
    + public WrappingLabel getFigureLinkName() {
    + return fFigureLinkName;
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkLinkNameEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkLinkNameEditPart.java
    new file mode 100644
    index 000000000..e9ba431c9
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkLinkNameEditPart.java
    @@ -0,0 +1,583 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import java.util.Collections;
    +import java.util.List;
    +
    +import org.eclipse.draw2d.ConnectionLocator;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Label;
    +import org.eclipse.draw2d.geometry.Point;
    +import org.eclipse.emf.common.notify.Notification;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.emf.transaction.RunnableWithResult;
    +import org.eclipse.gef.AccessibleEditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.requests.DirectEditRequest;
    +import org.eclipse.gef.tools.DirectEditManager;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
    +import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
    +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
    +import org.eclipse.gmf.runtime.notation.FontStyle;
    +import org.eclipse.gmf.runtime.notation.NotationPackage;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfTextSelectionEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfParserProvider;
    +import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
    +import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.DefaultLinkLabelDragPolicy;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
    +import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
    +import org.eclipse.jface.viewers.ICellEditorValidator;
    +import org.eclipse.swt.SWT;
    +import org.eclipse.swt.accessibility.AccessibleEvent;
    +import org.eclipse.swt.graphics.Color;
    +import org.eclipse.swt.graphics.FontData;
    +import org.eclipse.swt.graphics.Image;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkLinkNameEditPart extends LabelEditPart implements ITextAwareEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 6003;
    +
    + /**
    + * @generated
    + */
    + private DirectEditManager manager;
    +
    + /**
    + * @generated
    + */
    + private IParser parser;
    +
    + /**
    + * @generated
    + */
    + private List<?> parserElements;
    +
    + /**
    + * @generated
    + */
    + private String defaultText;
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate labelDelegate;
    +
    + /**
    + * @generated
    + */
    + static {
    + registerSnapBackPosition(LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkLinkNameEditPart.VISUAL_ID), new Point(0, 80));
    + }
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkLinkNameEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new LinklfTextSelectionEditPolicy());
    + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
    + }
    +
    + /**
    + * @generated
    + */
    + public int getKeyPoint() {
    + return ConnectionLocator.MIDDLE;
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelTextHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getText();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getText();
    + } else {
    + return getLabelDelegate().getText();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelTextHelper(IFigure figure, String text) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setText(text);
    + } else if (figure instanceof Label) {
    + ((Label) figure).setText(text);
    + } else {
    + getLabelDelegate().setText(text);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIconHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getIcon();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getIcon();
    + } else {
    + return getLabelDelegate().getIcon(0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelIconHelper(IFigure figure, Image icon) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setIcon(icon);
    + return;
    + } else if (figure instanceof Label) {
    + ((Label) figure).setIcon(icon);
    + return;
    + } else {
    + getLabelDelegate().setIcon(icon, 0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabel(WrappingLabel figure) {
    + unregisterVisuals();
    + setFigure(figure);
    + defaultText = getLabelTextHelper(figure);
    + registerVisuals();
    + refreshVisuals();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getModelChildren() {
    + return Collections.EMPTY_LIST;
    + }
    +
    + /**
    + * @generated
    + */
    + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + protected EObject getParserElement() {
    + return resolveSemanticElement();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIcon() {
    + EObject parserElement = getParserElement();
    + if (parserElement == null) {
    + return null;
    + }
    + return LinklfElementTypes.getImage(parserElement.eClass());
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelText() {
    + String text = null;
    + EObject parserElement = getParserElement();
    + if (parserElement != null && getParser() != null) {
    + text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
    + }
    + if (text == null || text.length() == 0) {
    + text = defaultText;
    + }
    + return text;
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabelText(String text) {
    + setLabelTextHelper(getFigure(), text);
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + public String getEditText() {
    + if (getParserElement() == null || getParser() == null) {
    + return ""; //$NON-NLS-1$
    + }
    + return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isEditable() {
    + return getParser() != null;
    + }
    +
    + /**
    + * @generated
    + */
    + public ICellEditorValidator getEditTextValidator() {
    + return new ICellEditorValidator() {
    +
    + public String isValid(final Object value) {
    + if (value instanceof String) {
    + final EObject element = getParserElement();
    + final IParser parser = getParser();
    + try {
    + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {
    +
    + public void run() {
    + setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
    + }
    + });
    + return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
    + } catch (InterruptedException ie) {
    + ie.printStackTrace();
    + }
    + }
    +
    + // shouldn't get here
    + return null;
    + }
    + };
    + }
    +
    + /**
    + * @generated
    + */
    + public IContentAssistProcessor getCompletionProcessor() {
    + if (getParserElement() == null || getParser() == null) {
    + return null;
    + }
    + return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
    + }
    +
    + /**
    + * @generated
    + */
    + public ParserOptions getParserOptions() {
    + return ParserOptions.NONE;
    + }
    +
    + /**
    + * @generated
    + */
    + public IParser getParser() {
    + if (parser == null) {
    + parser = LinklfParserProvider.getParser(LinklfElementTypes.LabeledLink_4002, getParserElement(),
    + LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkLinkNameEditPart.VISUAL_ID));
    + }
    + return parser;
    + }
    +
    + /**
    + * @generated
    + */
    + protected DirectEditManager getManager() {
    + if (manager == null) {
    + setManager(new TextDirectEditManager2(this, null, LinklfEditPartFactory.getTextCellEditorLocator(this)));
    + }
    + return manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setManager(DirectEditManager manager) {
    + this.manager = manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit() {
    + getManager().show();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit(Point eventLocation) {
    + if (getManager().getClass() == TextDirectEditManager2.class) {
    + ((TextDirectEditManager2) getManager()).show(eventLocation.getSWTPoint());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void performDirectEdit(char initialCharacter) {
    + if (getManager() instanceof TextDirectEditManager) {
    + ((TextDirectEditManager) getManager()).show(initialCharacter);
    + } else //
    + if (getManager() instanceof TextDirectEditManager2) {
    + ((TextDirectEditManager2) getManager()).show(initialCharacter);
    + } else //
    + {
    + performDirectEdit();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEditRequest(Request request) {
    + final Request theRequest = request;
    + try {
    + getEditingDomain().runExclusive(new Runnable() {
    +
    + public void run() {
    + if (isActive() && isEditable()) {
    + if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
    + Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
    + performDirectEdit(initialChar.charValue());
    + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
    + DirectEditRequest editRequest = (DirectEditRequest) theRequest;
    + performDirectEdit(editRequest.getLocation());
    + } else {
    + performDirectEdit();
    + }
    + }
    + }
    + });
    + } catch (InterruptedException e) {
    + e.printStackTrace();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshVisuals() {
    + super.refreshVisuals();
    + refreshLabel();
    + refreshFont();
    + refreshFontColor();
    + refreshUnderline();
    + refreshStrikeThrough();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshLabel() {
    + setLabelTextHelper(getFigure(), getLabelText());
    + setLabelIconHelper(getFigure(), getLabelIcon());
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshUnderline() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshStrikeThrough() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshFont() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null) {
    + FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
    + setFont(fontData);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void refreshSelectionFeedback() {
    + requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
    + requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
    + Object editPolicy = getEditPolicy(editPolicyKey);
    + if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
    + ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setFontColor(Color color) {
    + getFigure().setForegroundColor(color);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addSemanticListeners() {
    + if (getParser() instanceof ISemanticParser) {
    + EObject element = resolveSemanticElement();
    + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
    + for (int i = 0; i < parserElements.size(); i++) {
    + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
    + }
    + } else {
    + super.addSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeSemanticListeners() {
    + if (parserElements != null) {
    + for (int i = 0; i < parserElements.size(); i++) {
    + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
    + }
    + } else {
    + super.removeSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected AccessibleEditPart getAccessibleEditPart() {
    + if (accessibleEP == null) {
    + accessibleEP = new AccessibleGraphicalEditPart() {
    +
    + public void getName(AccessibleEvent e) {
    + e.result = getLabelTextHelper(getFigure());
    + }
    + };
    + }
    + return accessibleEP;
    + }
    +
    + /**
    + * @generated
    + */
    + private View getFontStyleOwnerView() {
    + return getPrimaryView();
    + }
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate getLabelDelegate() {
    + if (labelDelegate == null) {
    + IFigure label = getFigure();
    + if (label instanceof WrappingLabel) {
    + labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
    + } else {
    + labelDelegate = new SimpleLabelDelegate((Label) label);
    + }
    + }
    + return labelDelegate;
    + }
    +
    + /**
    + * @generated
    + */
    + @Override
    + public Object getAdapter(Class key) {
    + if (ILabelDelegate.class.equals(key)) {
    + return getLabelDelegate();
    + }
    + return super.getAdapter(key);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void handleNotificationEvent(Notification event) {
    + Object feature = event.getFeature();
    + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
    + Integer c = (Integer) event.getNewValue();
    + setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
    + refreshUnderline();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
    + refreshStrikeThrough();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
    + || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
    + refreshFont();
    + } else {
    + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
    + refreshLabel();
    + }
    + if (getParser() instanceof ISemanticParser) {
    + ISemanticParser modelParser = (ISemanticParser) getParser();
    + if (modelParser.areSemanticElementsAffected(null, event)) {
    + removeSemanticListeners();
    + if (resolveSemanticElement() != null) {
    + addSemanticListeners();
    + }
    + refreshLabel();
    + }
    + }
    + }
    + super.handleNotificationEvent(event);
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createFigure() {
    + // Parent should assign one using setLabel() method
    + return null;
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkSourceNameEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkSourceNameEditPart.java
    new file mode 100644
    index 000000000..0c86ecf77
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkSourceNameEditPart.java
    @@ -0,0 +1,583 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import java.util.Collections;
    +import java.util.List;
    +
    +import org.eclipse.draw2d.ConnectionLocator;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Label;
    +import org.eclipse.draw2d.geometry.Point;
    +import org.eclipse.emf.common.notify.Notification;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.emf.transaction.RunnableWithResult;
    +import org.eclipse.gef.AccessibleEditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.requests.DirectEditRequest;
    +import org.eclipse.gef.tools.DirectEditManager;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
    +import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
    +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
    +import org.eclipse.gmf.runtime.notation.FontStyle;
    +import org.eclipse.gmf.runtime.notation.NotationPackage;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfTextSelectionEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfParserProvider;
    +import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
    +import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.DefaultLinkLabelDragPolicy;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
    +import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
    +import org.eclipse.jface.viewers.ICellEditorValidator;
    +import org.eclipse.swt.SWT;
    +import org.eclipse.swt.accessibility.AccessibleEvent;
    +import org.eclipse.swt.graphics.Color;
    +import org.eclipse.swt.graphics.FontData;
    +import org.eclipse.swt.graphics.Image;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkSourceNameEditPart extends LabelEditPart implements ITextAwareEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 6001;
    +
    + /**
    + * @generated
    + */
    + private DirectEditManager manager;
    +
    + /**
    + * @generated
    + */
    + private IParser parser;
    +
    + /**
    + * @generated
    + */
    + private List<?> parserElements;
    +
    + /**
    + * @generated
    + */
    + private String defaultText;
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate labelDelegate;
    +
    + /**
    + * @generated
    + */
    + static {
    + registerSnapBackPosition(LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkSourceNameEditPart.VISUAL_ID), new Point(0, 40));
    + }
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkSourceNameEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new LinklfTextSelectionEditPolicy());
    + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
    + }
    +
    + /**
    + * @generated
    + */
    + public int getKeyPoint() {
    + return ConnectionLocator.TARGET;
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelTextHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getText();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getText();
    + } else {
    + return getLabelDelegate().getText();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelTextHelper(IFigure figure, String text) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setText(text);
    + } else if (figure instanceof Label) {
    + ((Label) figure).setText(text);
    + } else {
    + getLabelDelegate().setText(text);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIconHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getIcon();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getIcon();
    + } else {
    + return getLabelDelegate().getIcon(0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelIconHelper(IFigure figure, Image icon) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setIcon(icon);
    + return;
    + } else if (figure instanceof Label) {
    + ((Label) figure).setIcon(icon);
    + return;
    + } else {
    + getLabelDelegate().setIcon(icon, 0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabel(WrappingLabel figure) {
    + unregisterVisuals();
    + setFigure(figure);
    + defaultText = getLabelTextHelper(figure);
    + registerVisuals();
    + refreshVisuals();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getModelChildren() {
    + return Collections.EMPTY_LIST;
    + }
    +
    + /**
    + * @generated
    + */
    + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + protected EObject getParserElement() {
    + return resolveSemanticElement();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIcon() {
    + EObject parserElement = getParserElement();
    + if (parserElement == null) {
    + return null;
    + }
    + return LinklfElementTypes.getImage(parserElement.eClass());
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelText() {
    + String text = null;
    + EObject parserElement = getParserElement();
    + if (parserElement != null && getParser() != null) {
    + text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
    + }
    + if (text == null || text.length() == 0) {
    + text = defaultText;
    + }
    + return text;
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabelText(String text) {
    + setLabelTextHelper(getFigure(), text);
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + public String getEditText() {
    + if (getParserElement() == null || getParser() == null) {
    + return ""; //$NON-NLS-1$
    + }
    + return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isEditable() {
    + return getParser() != null;
    + }
    +
    + /**
    + * @generated
    + */
    + public ICellEditorValidator getEditTextValidator() {
    + return new ICellEditorValidator() {
    +
    + public String isValid(final Object value) {
    + if (value instanceof String) {
    + final EObject element = getParserElement();
    + final IParser parser = getParser();
    + try {
    + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {
    +
    + public void run() {
    + setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
    + }
    + });
    + return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
    + } catch (InterruptedException ie) {
    + ie.printStackTrace();
    + }
    + }
    +
    + // shouldn't get here
    + return null;
    + }
    + };
    + }
    +
    + /**
    + * @generated
    + */
    + public IContentAssistProcessor getCompletionProcessor() {
    + if (getParserElement() == null || getParser() == null) {
    + return null;
    + }
    + return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
    + }
    +
    + /**
    + * @generated
    + */
    + public ParserOptions getParserOptions() {
    + return ParserOptions.NONE;
    + }
    +
    + /**
    + * @generated
    + */
    + public IParser getParser() {
    + if (parser == null) {
    + parser = LinklfParserProvider.getParser(LinklfElementTypes.LabeledLink_4002, getParserElement(),
    + LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkSourceNameEditPart.VISUAL_ID));
    + }
    + return parser;
    + }
    +
    + /**
    + * @generated
    + */
    + protected DirectEditManager getManager() {
    + if (manager == null) {
    + setManager(new TextDirectEditManager2(this, null, LinklfEditPartFactory.getTextCellEditorLocator(this)));
    + }
    + return manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setManager(DirectEditManager manager) {
    + this.manager = manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit() {
    + getManager().show();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit(Point eventLocation) {
    + if (getManager().getClass() == TextDirectEditManager2.class) {
    + ((TextDirectEditManager2) getManager()).show(eventLocation.getSWTPoint());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void performDirectEdit(char initialCharacter) {
    + if (getManager() instanceof TextDirectEditManager) {
    + ((TextDirectEditManager) getManager()).show(initialCharacter);
    + } else //
    + if (getManager() instanceof TextDirectEditManager2) {
    + ((TextDirectEditManager2) getManager()).show(initialCharacter);
    + } else //
    + {
    + performDirectEdit();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEditRequest(Request request) {
    + final Request theRequest = request;
    + try {
    + getEditingDomain().runExclusive(new Runnable() {
    +
    + public void run() {
    + if (isActive() && isEditable()) {
    + if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
    + Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
    + performDirectEdit(initialChar.charValue());
    + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
    + DirectEditRequest editRequest = (DirectEditRequest) theRequest;
    + performDirectEdit(editRequest.getLocation());
    + } else {
    + performDirectEdit();
    + }
    + }
    + }
    + });
    + } catch (InterruptedException e) {
    + e.printStackTrace();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshVisuals() {
    + super.refreshVisuals();
    + refreshLabel();
    + refreshFont();
    + refreshFontColor();
    + refreshUnderline();
    + refreshStrikeThrough();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshLabel() {
    + setLabelTextHelper(getFigure(), getLabelText());
    + setLabelIconHelper(getFigure(), getLabelIcon());
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshUnderline() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshStrikeThrough() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshFont() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null) {
    + FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
    + setFont(fontData);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void refreshSelectionFeedback() {
    + requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
    + requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
    + Object editPolicy = getEditPolicy(editPolicyKey);
    + if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
    + ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setFontColor(Color color) {
    + getFigure().setForegroundColor(color);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addSemanticListeners() {
    + if (getParser() instanceof ISemanticParser) {
    + EObject element = resolveSemanticElement();
    + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
    + for (int i = 0; i < parserElements.size(); i++) {
    + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
    + }
    + } else {
    + super.addSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeSemanticListeners() {
    + if (parserElements != null) {
    + for (int i = 0; i < parserElements.size(); i++) {
    + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
    + }
    + } else {
    + super.removeSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected AccessibleEditPart getAccessibleEditPart() {
    + if (accessibleEP == null) {
    + accessibleEP = new AccessibleGraphicalEditPart() {
    +
    + public void getName(AccessibleEvent e) {
    + e.result = getLabelTextHelper(getFigure());
    + }
    + };
    + }
    + return accessibleEP;
    + }
    +
    + /**
    + * @generated
    + */
    + private View getFontStyleOwnerView() {
    + return getPrimaryView();
    + }
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate getLabelDelegate() {
    + if (labelDelegate == null) {
    + IFigure label = getFigure();
    + if (label instanceof WrappingLabel) {
    + labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
    + } else {
    + labelDelegate = new SimpleLabelDelegate((Label) label);
    + }
    + }
    + return labelDelegate;
    + }
    +
    + /**
    + * @generated
    + */
    + @Override
    + public Object getAdapter(Class key) {
    + if (ILabelDelegate.class.equals(key)) {
    + return getLabelDelegate();
    + }
    + return super.getAdapter(key);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void handleNotificationEvent(Notification event) {
    + Object feature = event.getFeature();
    + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
    + Integer c = (Integer) event.getNewValue();
    + setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
    + refreshUnderline();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
    + refreshStrikeThrough();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
    + || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
    + refreshFont();
    + } else {
    + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
    + refreshLabel();
    + }
    + if (getParser() instanceof ISemanticParser) {
    + ISemanticParser modelParser = (ISemanticParser) getParser();
    + if (modelParser.areSemanticElementsAffected(null, event)) {
    + removeSemanticListeners();
    + if (resolveSemanticElement() != null) {
    + addSemanticListeners();
    + }
    + refreshLabel();
    + }
    + }
    + }
    + super.handleNotificationEvent(event);
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createFigure() {
    + // Parent should assign one using setLabel() method
    + return null;
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkTargetNameEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkTargetNameEditPart.java
    new file mode 100644
    index 000000000..9dfa09e97
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LabeledLinkTargetNameEditPart.java
    @@ -0,0 +1,583 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import java.util.Collections;
    +import java.util.List;
    +
    +import org.eclipse.draw2d.ConnectionLocator;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Label;
    +import org.eclipse.draw2d.geometry.Point;
    +import org.eclipse.emf.common.notify.Notification;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.emf.transaction.RunnableWithResult;
    +import org.eclipse.gef.AccessibleEditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.requests.DirectEditRequest;
    +import org.eclipse.gef.tools.DirectEditManager;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
    +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
    +import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
    +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
    +import org.eclipse.gmf.runtime.notation.FontStyle;
    +import org.eclipse.gmf.runtime.notation.NotationPackage;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinklfTextSelectionEditPolicy;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfParserProvider;
    +import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
    +import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.DefaultLinkLabelDragPolicy;
    +import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
    +import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
    +import org.eclipse.jface.viewers.ICellEditorValidator;
    +import org.eclipse.swt.SWT;
    +import org.eclipse.swt.accessibility.AccessibleEvent;
    +import org.eclipse.swt.graphics.Color;
    +import org.eclipse.swt.graphics.FontData;
    +import org.eclipse.swt.graphics.Image;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkTargetNameEditPart extends LabelEditPart implements ITextAwareEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 6002;
    +
    + /**
    + * @generated
    + */
    + private DirectEditManager manager;
    +
    + /**
    + * @generated
    + */
    + private IParser parser;
    +
    + /**
    + * @generated
    + */
    + private List<?> parserElements;
    +
    + /**
    + * @generated
    + */
    + private String defaultText;
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate labelDelegate;
    +
    + /**
    + * @generated
    + */
    + static {
    + registerSnapBackPosition(LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkTargetNameEditPart.VISUAL_ID), new Point(0, 60));
    + }
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkTargetNameEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
    + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new LinklfTextSelectionEditPolicy());
    + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new DefaultLinkLabelDragPolicy());
    + }
    +
    + /**
    + * @generated
    + */
    + public int getKeyPoint() {
    + return ConnectionLocator.SOURCE;
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelTextHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getText();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getText();
    + } else {
    + return getLabelDelegate().getText();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelTextHelper(IFigure figure, String text) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setText(text);
    + } else if (figure instanceof Label) {
    + ((Label) figure).setText(text);
    + } else {
    + getLabelDelegate().setText(text);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIconHelper(IFigure figure) {
    + if (figure instanceof WrappingLabel) {
    + return ((WrappingLabel) figure).getIcon();
    + } else if (figure instanceof Label) {
    + return ((Label) figure).getIcon();
    + } else {
    + return getLabelDelegate().getIcon(0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLabelIconHelper(IFigure figure, Image icon) {
    + if (figure instanceof WrappingLabel) {
    + ((WrappingLabel) figure).setIcon(icon);
    + return;
    + } else if (figure instanceof Label) {
    + ((Label) figure).setIcon(icon);
    + return;
    + } else {
    + getLabelDelegate().setIcon(icon, 0);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabel(WrappingLabel figure) {
    + unregisterVisuals();
    + setFigure(figure);
    + defaultText = getLabelTextHelper(figure);
    + registerVisuals();
    + refreshVisuals();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getModelChildren() {
    + return Collections.EMPTY_LIST;
    + }
    +
    + /**
    + * @generated
    + */
    + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + protected EObject getParserElement() {
    + return resolveSemanticElement();
    + }
    +
    + /**
    + * @generated
    + */
    + protected Image getLabelIcon() {
    + EObject parserElement = getParserElement();
    + if (parserElement == null) {
    + return null;
    + }
    + return LinklfElementTypes.getImage(parserElement.eClass());
    + }
    +
    + /**
    + * @generated
    + */
    + protected String getLabelText() {
    + String text = null;
    + EObject parserElement = getParserElement();
    + if (parserElement != null && getParser() != null) {
    + text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
    + }
    + if (text == null || text.length() == 0) {
    + text = defaultText;
    + }
    + return text;
    + }
    +
    + /**
    + * @generated
    + */
    + public void setLabelText(String text) {
    + setLabelTextHelper(getFigure(), text);
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + public String getEditText() {
    + if (getParserElement() == null || getParser() == null) {
    + return ""; //$NON-NLS-1$
    + }
    + return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isEditable() {
    + return getParser() != null;
    + }
    +
    + /**
    + * @generated
    + */
    + public ICellEditorValidator getEditTextValidator() {
    + return new ICellEditorValidator() {
    +
    + public String isValid(final Object value) {
    + if (value instanceof String) {
    + final EObject element = getParserElement();
    + final IParser parser = getParser();
    + try {
    + IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl<IParserEditStatus>() {
    +
    + public void run() {
    + setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
    + }
    + });
    + return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
    + } catch (InterruptedException ie) {
    + ie.printStackTrace();
    + }
    + }
    +
    + // shouldn't get here
    + return null;
    + }
    + };
    + }
    +
    + /**
    + * @generated
    + */
    + public IContentAssistProcessor getCompletionProcessor() {
    + if (getParserElement() == null || getParser() == null) {
    + return null;
    + }
    + return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
    + }
    +
    + /**
    + * @generated
    + */
    + public ParserOptions getParserOptions() {
    + return ParserOptions.NONE;
    + }
    +
    + /**
    + * @generated
    + */
    + public IParser getParser() {
    + if (parser == null) {
    + parser = LinklfParserProvider.getParser(LinklfElementTypes.LabeledLink_4002, getParserElement(),
    + LinklfVisualIDRegistry.getType(org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkTargetNameEditPart.VISUAL_ID));
    + }
    + return parser;
    + }
    +
    + /**
    + * @generated
    + */
    + protected DirectEditManager getManager() {
    + if (manager == null) {
    + setManager(new TextDirectEditManager2(this, null, LinklfEditPartFactory.getTextCellEditorLocator(this)));
    + }
    + return manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setManager(DirectEditManager manager) {
    + this.manager = manager;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit() {
    + getManager().show();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEdit(Point eventLocation) {
    + if (getManager().getClass() == TextDirectEditManager2.class) {
    + ((TextDirectEditManager2) getManager()).show(eventLocation.getSWTPoint());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void performDirectEdit(char initialCharacter) {
    + if (getManager() instanceof TextDirectEditManager) {
    + ((TextDirectEditManager) getManager()).show(initialCharacter);
    + } else //
    + if (getManager() instanceof TextDirectEditManager2) {
    + ((TextDirectEditManager2) getManager()).show(initialCharacter);
    + } else //
    + {
    + performDirectEdit();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void performDirectEditRequest(Request request) {
    + final Request theRequest = request;
    + try {
    + getEditingDomain().runExclusive(new Runnable() {
    +
    + public void run() {
    + if (isActive() && isEditable()) {
    + if (theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
    + Character initialChar = (Character) theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
    + performDirectEdit(initialChar.charValue());
    + } else if ((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
    + DirectEditRequest editRequest = (DirectEditRequest) theRequest;
    + performDirectEdit(editRequest.getLocation());
    + } else {
    + performDirectEdit();
    + }
    + }
    + }
    + });
    + } catch (InterruptedException e) {
    + e.printStackTrace();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshVisuals() {
    + super.refreshVisuals();
    + refreshLabel();
    + refreshFont();
    + refreshFontColor();
    + refreshUnderline();
    + refreshStrikeThrough();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshLabel() {
    + setLabelTextHelper(getFigure(), getLabelText());
    + setLabelIconHelper(getFigure(), getLabelIcon());
    + refreshSelectionFeedback();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshUnderline() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshStrikeThrough() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null && getFigure() instanceof WrappingLabel) {
    + ((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshFont() {
    + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
    + if (style != null) {
    + FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
    + setFont(fontData);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + private void refreshSelectionFeedback() {
    + requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
    + requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
    + Object editPolicy = getEditPolicy(editPolicyKey);
    + if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
    + ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setFontColor(Color color) {
    + getFigure().setForegroundColor(color);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void addSemanticListeners() {
    + if (getParser() instanceof ISemanticParser) {
    + EObject element = resolveSemanticElement();
    + parserElements = ((ISemanticParser) getParser()).getSemanticElementsBeingParsed(element);
    + for (int i = 0; i < parserElements.size(); i++) {
    + addListenerFilter("SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
    + }
    + } else {
    + super.addSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void removeSemanticListeners() {
    + if (parserElements != null) {
    + for (int i = 0; i < parserElements.size(); i++) {
    + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
    + }
    + } else {
    + super.removeSemanticListeners();
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected AccessibleEditPart getAccessibleEditPart() {
    + if (accessibleEP == null) {
    + accessibleEP = new AccessibleGraphicalEditPart() {
    +
    + public void getName(AccessibleEvent e) {
    + e.result = getLabelTextHelper(getFigure());
    + }
    + };
    + }
    + return accessibleEP;
    + }
    +
    + /**
    + * @generated
    + */
    + private View getFontStyleOwnerView() {
    + return getPrimaryView();
    + }
    +
    + /**
    + * @generated
    + */
    + private ILabelDelegate getLabelDelegate() {
    + if (labelDelegate == null) {
    + IFigure label = getFigure();
    + if (label instanceof WrappingLabel) {
    + labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
    + } else {
    + labelDelegate = new SimpleLabelDelegate((Label) label);
    + }
    + }
    + return labelDelegate;
    + }
    +
    + /**
    + * @generated
    + */
    + @Override
    + public Object getAdapter(Class key) {
    + if (ILabelDelegate.class.equals(key)) {
    + return getLabelDelegate();
    + }
    + return super.getAdapter(key);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void handleNotificationEvent(Notification event) {
    + Object feature = event.getFeature();
    + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
    + Integer c = (Integer) event.getNewValue();
    + setFontColor(DiagramColorRegistry.getInstance().getColor(c));
    + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
    + refreshUnderline();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
    + refreshStrikeThrough();
    + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
    + || NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature) || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
    + refreshFont();
    + } else {
    + if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
    + refreshLabel();
    + }
    + if (getParser() instanceof ISemanticParser) {
    + ISemanticParser modelParser = (ISemanticParser) getParser();
    + if (modelParser.areSemanticElementsAffected(null, event)) {
    + removeSemanticListeners();
    + if (resolveSemanticElement() != null) {
    + addSemanticListeners();
    + }
    + refreshLabel();
    + }
    + }
    + }
    + super.handleNotificationEvent(event);
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createFigure() {
    + // Parent should assign one using setLabel() method
    + return null;
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinkEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinkEditPart.java
    new file mode 100644
    index 000000000..8d85714db
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinkEditPart.java
    @@ -0,0 +1,58 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.Connection;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.LinkItemSemanticEditPolicy;
    +
    +/**
    + * @generated
    + */
    +public class LinkEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 4001;
    +
    + /**
    + * @generated
    + */
    + public LinkEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new LinkItemSemanticEditPolicy());
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + /**
    + * @generated
    + */
    + protected Connection createConnectionFigure() {
    + return new PolylineConnectionEx();
    + }
    +
    + /**
    + * @generated
    + */
    + public PolylineConnectionEx getPrimaryShape() {
    + return (PolylineConnectionEx) getFigure();
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinklfEditPartFactory.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinklfEditPartFactory.java
    new file mode 100644
    index 000000000..7f15f9504
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/LinklfEditPartFactory.java
    @@ -0,0 +1,101 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPartFactory;
    +import org.eclipse.gef.tools.CellEditorLocator;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.runtime.directedit.locator.CellEditorLocatorAccess;
    +
    +/**
    + * @generated
    + */
    +public class LinklfEditPartFactory implements EditPartFactory {
    +
    + /**
    + * @generated
    + */
    + public EditPart createEditPart(EditPart context, Object model) {
    + if (model instanceof View) {
    + View view = (View) model;
    + switch (LinklfVisualIDRegistry.getVisualID(view)) {
    +
    + case CanvasEditPart.VISUAL_ID:
    + return new CanvasEditPart(view);
    +
    + case CircleEditPart.VISUAL_ID:
    + return new CircleEditPart(view);
    +
    + case RectangleEditPart.VISUAL_ID:
    + return new RectangleEditPart(view);
    +
    + case ContainerEditPart.VISUAL_ID:
    + return new ContainerEditPart(view);
    +
    + case ContainerNameEditPart.VISUAL_ID:
    + return new ContainerNameEditPart(view);
    +
    + case RhombusEditPart.VISUAL_ID:
    + return new RhombusEditPart(view);
    +
    + case Circle2EditPart.VISUAL_ID:
    + return new Circle2EditPart(view);
    +
    + case Container2EditPart.VISUAL_ID:
    + return new Container2EditPart(view);
    +
    + case ContainerName2EditPart.VISUAL_ID:
    + return new ContainerName2EditPart(view);
    +
    + case Rectangle2EditPart.VISUAL_ID:
    + return new Rectangle2EditPart(view);
    +
    + case Rhombus2EditPart.VISUAL_ID:
    + return new Rhombus2EditPart(view);
    +
    + case PortEditPart.VISUAL_ID:
    + return new PortEditPart(view);
    +
    + case ContainerContainerCompartmentEditPart.VISUAL_ID:
    + return new ContainerContainerCompartmentEditPart(view);
    +
    + case ContainerContainerCompartment2EditPart.VISUAL_ID:
    + return new ContainerContainerCompartment2EditPart(view);
    +
    + case LinkEditPart.VISUAL_ID:
    + return new LinkEditPart(view);
    +
    + case LabeledLinkEditPart.VISUAL_ID:
    + return new LabeledLinkEditPart(view);
    +
    + case LabeledLinkSourceNameEditPart.VISUAL_ID:
    + return new LabeledLinkSourceNameEditPart(view);
    +
    + case LabeledLinkTargetNameEditPart.VISUAL_ID:
    + return new LabeledLinkTargetNameEditPart(view);
    +
    + case LabeledLinkLinkNameEditPart.VISUAL_ID:
    + return new LabeledLinkLinkNameEditPart(view);
    +
    + }
    + }
    + return createUnrecognizedEditPart(context, model);
    + }
    +
    + /**
    + * @generated
    + */
    + private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
    + // Handle creation of unrecognized child node EditParts here
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
    + return CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/PortEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/PortEditPart.java
    new file mode 100644
    index 000000000..b4c27f7a8
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/PortEditPart.java
    @@ -0,0 +1,184 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.RectangleFigure;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
    +import org.eclipse.gef.requests.CreateRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.PortItemSemanticEditPolicy;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class PortEditPart extends AbstractBorderItemEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 3005;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public PortEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new PortItemSemanticEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    + if (result == null) {
    + result = new NonResizableEditPolicy();
    + }
    + return result;
    + }
    +
    + protected Command getMoveChildrenCommand(Request request) {
    + return null;
    + }
    +
    + protected Command getCreateCommand(CreateRequest request) {
    + return null;
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new RectangleFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public RectangleFigure getPrimaryShape() {
    + return (RectangleFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    +
    + //FIXME: workaround for #154536
    + result.getBounds().setSize(result.getPreferredSize());
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createNodeFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rectangle2EditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rectangle2EditPart.java
    new file mode 100644
    index 000000000..338c103f1
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rectangle2EditPart.java
    @@ -0,0 +1,196 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.ColorConstants;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
    +import org.eclipse.gef.requests.CreateRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.Rectangle2ItemSemanticEditPolicy;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class Rectangle2EditPart extends ShapeNodeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 3003;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public Rectangle2EditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Rectangle2ItemSemanticEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    + if (result == null) {
    + result = new NonResizableEditPolicy();
    + }
    + return result;
    + }
    +
    + protected Command getMoveChildrenCommand(Request request) {
    + return null;
    + }
    +
    + protected Command getCreateCommand(CreateRequest request) {
    + return null;
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new RectangleFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public RectangleFigure getPrimaryShape() {
    + return (RectangleFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createNodeFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public class RectangleFigure extends org.eclipse.draw2d.RectangleFigure {
    +
    + /**
    + * @generated
    + */
    + public RectangleFigure() {
    + this.setLayoutManager(new StackLayout());
    + this.setLineWidth(2);
    + this.setForegroundColor(ColorConstants.darkGreen);
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RectangleEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RectangleEditPart.java
    new file mode 100644
    index 000000000..f1b0dbd54
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RectangleEditPart.java
    @@ -0,0 +1,196 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.ColorConstants;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
    +import org.eclipse.gef.requests.CreateRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.RectangleItemSemanticEditPolicy;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class RectangleEditPart extends ShapeNodeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 2002;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public RectangleEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new RectangleItemSemanticEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    + if (result == null) {
    + result = new NonResizableEditPolicy();
    + }
    + return result;
    + }
    +
    + protected Command getMoveChildrenCommand(Request request) {
    + return null;
    + }
    +
    + protected Command getCreateCommand(CreateRequest request) {
    + return null;
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new RectangleFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public RectangleFigure getPrimaryShape() {
    + return (RectangleFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createNodeFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public class RectangleFigure extends org.eclipse.draw2d.RectangleFigure {
    +
    + /**
    + * @generated
    + */
    + public RectangleFigure() {
    + this.setLayoutManager(new StackLayout());
    + this.setLineWidth(2);
    + this.setForegroundColor(ColorConstants.darkGreen);
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rhombus2EditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rhombus2EditPart.java
    new file mode 100644
    index 000000000..6ab1a9a8f
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/Rhombus2EditPart.java
    @@ -0,0 +1,204 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.ColorConstants;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.ScalablePolygonShape;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.draw2d.geometry.Point;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
    +import org.eclipse.gef.requests.CreateRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.Rhombus2ItemSemanticEditPolicy;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class Rhombus2EditPart extends ShapeNodeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 3004;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public Rhombus2EditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Rhombus2ItemSemanticEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    + if (result == null) {
    + result = new NonResizableEditPolicy();
    + }
    + return result;
    + }
    +
    + protected Command getMoveChildrenCommand(Request request) {
    + return null;
    + }
    +
    + protected Command getCreateCommand(CreateRequest request) {
    + return null;
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new RhombusFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public RhombusFigure getPrimaryShape() {
    + return (RhombusFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createNodeFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public class RhombusFigure extends ScalablePolygonShape {
    +
    + /**
    + * @generated
    + */
    + public RhombusFigure() {
    + this.setLayoutManager(new StackLayout());
    + this.addPoint(new Point(20, 40));
    + this.addPoint(new Point(40, 20));
    + this.addPoint(new Point(20, 0));
    + this.addPoint(new Point(0, 20));
    + this.addPoint(new Point(20, 40));
    + this.setFill(true);
    + this.setLineWidth(2);
    + this.setForegroundColor(ColorConstants.yellow);
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RhombusEditPart.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RhombusEditPart.java
    new file mode 100644
    index 000000000..e4c862a48
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/parts/RhombusEditPart.java
    @@ -0,0 +1,204 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts;
    +
    +import org.eclipse.draw2d.ColorConstants;
    +import org.eclipse.draw2d.IFigure;
    +import org.eclipse.draw2d.ScalablePolygonShape;
    +import org.eclipse.draw2d.Shape;
    +import org.eclipse.draw2d.StackLayout;
    +import org.eclipse.draw2d.geometry.Point;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.EditPolicy;
    +import org.eclipse.gef.Request;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gef.editpolicies.LayoutEditPolicy;
    +import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
    +import org.eclipse.gef.requests.CreateRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
    +import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
    +import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies.RhombusItemSemanticEditPolicy;
    +import org.eclipse.swt.graphics.Color;
    +
    +/**
    + * @generated
    + */
    +public class RhombusEditPart extends ShapeNodeEditPart {
    +
    + /**
    + * @generated
    + */
    + public static final int VISUAL_ID = 2004;
    +
    + /**
    + * @generated
    + */
    + protected IFigure contentPane;
    +
    + /**
    + * @generated
    + */
    + protected IFigure primaryShape;
    +
    + /**
    + * @generated
    + */
    + public RhombusEditPart(View view) {
    + super(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void createDefaultEditPolicies() {
    + super.createDefaultEditPolicies();
    + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new RhombusItemSemanticEditPolicy());
    + installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
    + // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
    + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
    + }
    +
    + /**
    + * @generated
    + */
    + protected LayoutEditPolicy createLayoutEditPolicy() {
    + org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
    +
    + protected EditPolicy createChildEditPolicy(EditPart child) {
    + EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
    + if (result == null) {
    + result = new NonResizableEditPolicy();
    + }
    + return result;
    + }
    +
    + protected Command getMoveChildrenCommand(Request request) {
    + return null;
    + }
    +
    + protected Command getCreateCommand(CreateRequest request) {
    + return null;
    + }
    + };
    + return lep;
    + }
    +
    + /**
    + * @generated
    + */
    + protected IFigure createNodeShape() {
    + return primaryShape = new RhombusFigure();
    + }
    +
    + /**
    + * @generated
    + */
    + public RhombusFigure getPrimaryShape() {
    + return (RhombusFigure) primaryShape;
    + }
    +
    + /**
    + * @generated
    + */
    + protected NodeFigure createNodePlate() {
    + DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
    + return result;
    + }
    +
    + /**
    + * Creates figure for this edit part.
    + *
    + * Body of this method does not depend on settings in generation model
    + * so you may safely remove <i>generated</i> tag and modify it.
    + *
    + * @generated
    + */
    + protected NodeFigure createNodeFigure() {
    + NodeFigure figure = createNodePlate();
    + figure.setLayoutManager(new StackLayout());
    + IFigure shape = createNodeShape();
    + figure.add(shape);
    + contentPane = setupContentPane(shape);
    + return figure;
    + }
    +
    + /**
    + * 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 IFigure setupContentPane(IFigure nodeShape) {
    + return nodeShape; // use nodeShape itself as contentPane
    + }
    +
    + /**
    + * @generated
    + */
    + public IFigure getContentPane() {
    + if (contentPane != null) {
    + return contentPane;
    + }
    + return super.getContentPane();
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setForegroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setForegroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setBackgroundColor(Color color) {
    + if (primaryShape != null) {
    + primaryShape.setBackgroundColor(color);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineWidth(int width) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineWidth(width);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + protected void setLineType(int style) {
    + if (primaryShape instanceof Shape) {
    + ((Shape) primaryShape).setLineStyle(style);
    + }
    + }
    +
    + /**
    + * @generated
    + */
    + public class RhombusFigure extends ScalablePolygonShape {
    +
    + /**
    + * @generated
    + */
    + public RhombusFigure() {
    + this.setLayoutManager(new StackLayout());
    + this.addPoint(new Point(20, 40));
    + this.addPoint(new Point(40, 20));
    + this.addPoint(new Point(20, 0));
    + this.addPoint(new Point(0, 20));
    + this.addPoint(new Point(20, 40));
    + this.setFill(true);
    + this.setLineWidth(2);
    + this.setForegroundColor(ColorConstants.yellow);
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasCanonicalEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasCanonicalEditPolicy.java
    new file mode 100644
    index 000000000..8c4440a5b
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasCanonicalEditPolicy.java
    @@ -0,0 +1,432 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.ArrayList;
    +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 org.eclipse.core.runtime.IAdaptable;
    +import org.eclipse.emf.ecore.EObject;
    +import org.eclipse.emf.ecore.EStructuralFeature;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
    +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.CanonicalEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +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.gmf.tooling.examples.linklf.LinklfPackage;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.CanvasEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Circle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.CircleEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Container2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.ContainerEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.PortEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rectangle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.RectangleEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rhombus2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.RhombusEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramUpdater;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfLinkDescriptor;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfNodeDescriptor;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.runtime.update.UpdaterLinkDescriptor;
    +
    +/**
    + * @generated
    + */
    +public class CanvasCanonicalEditPolicy extends CanonicalEditPolicy {
    +
    + /**
    + * @generated
    + */
    + protected void refreshOnActivate() {
    + // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
    + List<?> c = getHost().getChildren();
    + for (int i = 0; i < c.size(); i++) {
    + ((EditPart) c.get(i)).activate();
    + }
    + super.refreshOnActivate();
    + }
    +
    + /**
    + * @generated
    + */
    + protected EStructuralFeature getFeatureToSynchronize() {
    + return LinklfPackage.eINSTANCE.getCanvasElementContainer_Elements();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getSemanticChildrenList() {
    + View viewObject = (View) getHost().getModel();
    + LinkedList<EObject> result = new LinkedList<EObject>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getCanvas_1000SemanticChildren(viewObject);
    + for (LinklfNodeDescriptor d : childDescriptors) {
    + result.add(d.getModelElement());
    + }
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
    + return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
    + }
    +
    + /**
    + * @generated
    + */
    + private boolean isMyDiagramElement(View view) {
    + int visualID = LinklfVisualIDRegistry.getVisualID(view);
    + switch (visualID) {
    + case CircleEditPart.VISUAL_ID:
    + case RectangleEditPart.VISUAL_ID:
    + case ContainerEditPart.VISUAL_ID:
    + case RhombusEditPart.VISUAL_ID:
    + return true;
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshSemantic() {
    + if (resolveSemanticElement() == null) {
    + return;
    + }
    + LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getCanvas_1000SemanticChildren((View) getHost().getModel());
    + LinkedList<View> orphaned = new LinkedList<View>();
    + // we care to check only views we recognize as ours
    + LinkedList<View> knownViewChildren = new LinkedList<View>();
    + for (View v : getViewChildren()) {
    + if (isMyDiagramElement(v)) {
    + knownViewChildren.add(v);
    + }
    + }
    + // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
    + //
    + // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    + // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    + // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    + for (Iterator<LinklfNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
    + LinklfNodeDescriptor next = descriptorsIterator.next();
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
    + for (View childView : getViewChildren()) {
    + EObject semanticElement = childView.getElement();
    + if (next.getModelElement().equals(semanticElement)) {
    + if (hint.equals(childView.getType())) {
    + perfectMatch.add(childView);
    + // actually, can stop iteration over view children here, but
    + // may want to use not the first view but last one as a 'real' match (the way original CEP does
    + // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
    + }
    + }
    + }
    + if (perfectMatch.size() > 0) {
    + descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
    + // use only one view (first or last?), keep rest as orphaned for further consideration
    + knownViewChildren.remove(perfectMatch.getFirst());
    + }
    + }
    + // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    + // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    + orphaned.addAll(knownViewChildren);
    + //
    + ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
    + for (LinklfNodeDescriptor next : childDescriptors) {
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
    + CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
    + viewDescriptors.add(descriptor);
    + }
    +
    + boolean changed = deleteViews(orphaned.iterator());
    + //
    + CreateViewRequest request = getCreateViewRequest(viewDescriptors);
    + Command cmd = getCreateViewCommand(request);
    + if (cmd != null && cmd.canExecute()) {
    + SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
    + executeCommand(cmd);
    + @SuppressWarnings("unchecked")
    + List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
    + createdViews.addAll(nl);
    + }
    + if (changed || createdViews.size() > 0) {
    + postProcessRefreshSemantic(createdViews);
    + }
    +
    + Collection<IAdaptable> createdConnectionViews = refreshConnections();
    +
    + if (createdViews.size() > 1) {
    + // perform a layout of the container
    + DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
    + executeCommand(new ICommandProxy(layoutCmd));
    + }
    +
    + createdViews.addAll(createdConnectionViews);
    +
    + makeViewsImmutable(createdViews);
    + }
    +
    + /**
    + * @generated
    + */
    + private Collection<IAdaptable> refreshConnections() {
    + Domain2Notation domain2NotationMap = new Domain2Notation();
    + Collection<LinklfLinkDescriptor> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
    + Collection existingLinks = new LinkedList(getDiagram().getEdges());
    + for (Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
    + Edge nextDiagramLink = (Edge) linksIterator.next();
    + int diagramLinkVisualID = LinklfVisualIDRegistry.getVisualID(nextDiagramLink);
    + if (diagramLinkVisualID == -1) {
    + if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {
    + linksIterator.remove();
    + }
    + continue;
    + }
    + EObject diagramLinkObject = nextDiagramLink.getElement();
    + EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
    + EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
    + for (Iterator<LinklfLinkDescriptor> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
    + LinklfLinkDescriptor nextLinkDescriptor = linkDescriptorsIterator.next();
    + if (diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination()
    + && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
    + linksIterator.remove();
    + linkDescriptorsIterator.remove();
    + break;
    + }
    + }
    + }
    + deleteViews(existingLinks.iterator());
    + return createConnections(linkDescriptors, domain2NotationMap);
    + }
    +
    + /**
    + * @generated
    + */
    + private Collection<LinklfLinkDescriptor> collectAllLinks(View view, Domain2Notation domain2NotationMap) {
    + if (!CanvasEditPart.MODEL_ID.equals(LinklfVisualIDRegistry.getModelID(view))) {
    + return Collections.emptyList();
    + }
    + LinkedList<LinklfLinkDescriptor> result = new LinkedList<LinklfLinkDescriptor>();
    + switch (LinklfVisualIDRegistry.getVisualID(view)) {
    + case CanvasEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getCanvas_1000ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case CircleEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getCircle_2001ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case RectangleEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getRectangle_2002ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case ContainerEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getContainer_2003ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case RhombusEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getRhombus_2004ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case Circle2EditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getCircle_3001ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case Container2EditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getContainer_3002ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case Rectangle2EditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getRectangle_3003ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case Rhombus2EditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getRhombus_3004ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case PortEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getPort_3005ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case LinkEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getLink_4001ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + case LabeledLinkEditPart.VISUAL_ID: {
    + if (!domain2NotationMap.containsKey(view.getElement())) {
    + result.addAll(LinklfDiagramUpdater.getLabeledLink_4002ContainedLinks(view));
    + }
    + domain2NotationMap.putView(view.getElement(), view);
    + break;
    + }
    + }
    + for (Iterator children = view.getChildren().iterator(); children.hasNext();) {
    + result.addAll(collectAllLinks((View) children.next(), domain2NotationMap));
    + }
    + for (Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) {
    + result.addAll(collectAllLinks((View) edges.next(), domain2NotationMap));
    + }
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + private Collection<IAdaptable> createConnections(Collection<LinklfLinkDescriptor> linkDescriptors, Domain2Notation domain2NotationMap) {
    + LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
    + for (LinklfLinkDescriptor nextLinkDescriptor : linkDescriptors) {
    + EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, domain2NotationMap);
    + EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, domain2NotationMap);
    + if (sourceEditPart == null || targetEditPart == null) {
    + continue;
    + }
    + CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(),
    + LinklfVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()), 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();
    + if (viewAdapter != null) {
    + adapters.add(viewAdapter);
    + }
    + }
    + }
    + return adapters;
    + }
    +
    + /**
    + * @generated
    + */
    + private EditPart getEditPart(EObject domainModelElement, Domain2Notation domain2NotationMap) {
    + View view = (View) domain2NotationMap.get(domainModelElement);
    + if (view != null) {
    + return (EditPart) getHost().getViewer().getEditPartRegistry().get(view);
    + }
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + private Diagram getDiagram() {
    + return ((View) getHost().getModel()).getDiagram();
    + }
    +
    + /**
    + * @generated
    + */
    + private EditPart getSourceEditPart(UpdaterLinkDescriptor descriptor, Domain2Notation domain2NotationMap) {
    + return getEditPart(descriptor.getSource(), domain2NotationMap);
    + }
    +
    + /**
    + * @generated
    + */
    + private EditPart getTargetEditPart(UpdaterLinkDescriptor descriptor, Domain2Notation domain2NotationMap) {
    + return getEditPart(descriptor.getDestination(), domain2NotationMap);
    + }
    +
    + /**
    + * @generated
    + */
    + protected final EditPart getHintedEditPart(EObject domainModelElement, Domain2Notation domain2NotationMap, int hintVisualId) {
    + View view = (View) domain2NotationMap.getHinted(domainModelElement, LinklfVisualIDRegistry.getType(hintVisualId));
    + if (view != null) {
    + return (EditPart) getHost().getViewer().getEditPartRegistry().get(view);
    + }
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("serial")
    + protected static class Domain2Notation extends HashMap<EObject, View> {
    +
    + /**
    + * @generated
    + */
    + public boolean containsDomainElement(EObject domainElement) {
    + return this.containsKey(domainElement);
    + }
    +
    + /**
    + * @generated
    + */
    + public View getHinted(EObject domainEObject, String hint) {
    + return this.get(domainEObject);
    + }
    +
    + /**
    + * @generated
    + */
    + public void putView(EObject domainElement, View view) {
    + if (!containsKey(view.getElement())) {
    + this.put(domainElement, view);
    + }
    + }
    +
    + }
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..ce4067c1a
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CanvasItemSemanticEditPolicy.java
    @@ -0,0 +1,68 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import org.eclipse.emf.transaction.TransactionalEditingDomain;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
    +import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.CircleCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.ContainerCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.RectangleCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.RhombusCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class CanvasItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public CanvasItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Canvas_1000);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCreateCommand(CreateElementRequest req) {
    + if (LinklfElementTypes.Circle_2001 == req.getElementType()) {
    + return getGEFWrapper(new CircleCreateCommand(req));
    + }
    + if (LinklfElementTypes.Rectangle_2002 == req.getElementType()) {
    + return getGEFWrapper(new RectangleCreateCommand(req));
    + }
    + if (LinklfElementTypes.Container_2003 == req.getElementType()) {
    + return getGEFWrapper(new ContainerCreateCommand(req));
    + }
    + if (LinklfElementTypes.Rhombus_2004 == req.getElementType()) {
    + return getGEFWrapper(new RhombusCreateCommand(req));
    + }
    + return super.getCreateCommand(req);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getDuplicateCommand(DuplicateElementsRequest req) {
    + TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
    + return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req));
    + }
    +
    + /**
    + * @generated
    + */
    + private static class DuplicateAnythingCommand extends DuplicateEObjectsCommand {
    +
    + /**
    + * @generated
    + */
    + public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req) {
    + super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap());
    + }
    +
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Circle2ItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Circle2ItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..1b2b88b95
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Circle2ItemSemanticEditPolicy.java
    @@ -0,0 +1,135 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.Iterator;
    +
    +import org.eclipse.emf.ecore.EAnnotation;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
    +import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
    +import org.eclipse.gmf.runtime.notation.Edge;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LabeledLinkCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LabeledLinkReorientCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LinkCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LinkReorientCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class Circle2ItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public Circle2ItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Circle_3001);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getDestroyElementCommand(DestroyElementRequest req) {
    + View view = (View) getHost().getModel();
    + CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
    + cmd.setTransactionNestingEnabled(false);
    + for (Iterator<?> it = view.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = view.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    + if (annotation == null) {
    + // there are indirectly referenced children, need extra commands: false
    + addDestroyShortcutsCommand(cmd, view);
    + // delete host element
    + cmd.add(new DestroyElementCommand(req));
    + } else {
    + cmd.add(new DeleteCommand(getEditingDomain(), view));
    + }
    + return getGEFWrapper(cmd.reduce());
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
    + Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
    + return command != null ? command : super.getCreateRelationshipCommand(req);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
    + if (LinklfElementTypes.Link_4001 == req.getElementType()) {
    + return getGEFWrapper(new LinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + if (LinklfElementTypes.LabeledLink_4002 == req.getElementType()) {
    + return getGEFWrapper(new LabeledLinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
    + if (LinklfElementTypes.Link_4001 == req.getElementType()) {
    + return getGEFWrapper(new LinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + if (LinklfElementTypes.LabeledLink_4002 == req.getElementType()) {
    + return getGEFWrapper(new LabeledLinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + return null;
    + }
    +
    + /**
    + * Returns command to reorient EClass based link. New link target or source
    + * should be the domain model element associated with this node.
    + *
    + * @generated
    + */
    + protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
    + switch (getVisualID(req)) {
    + case LinkEditPart.VISUAL_ID:
    + return getGEFWrapper(new LinkReorientCommand(req));
    + case LabeledLinkEditPart.VISUAL_ID:
    + return getGEFWrapper(new LabeledLinkReorientCommand(req));
    + }
    + return super.getReorientRelationshipCommand(req);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CircleItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CircleItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..a1b0e94e1
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/CircleItemSemanticEditPolicy.java
    @@ -0,0 +1,135 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.Iterator;
    +
    +import org.eclipse.emf.ecore.EAnnotation;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
    +import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
    +import org.eclipse.gmf.runtime.notation.Edge;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LabeledLinkCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LabeledLinkReorientCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LinkCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.LinkReorientCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class CircleItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public CircleItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Circle_2001);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getDestroyElementCommand(DestroyElementRequest req) {
    + View view = (View) getHost().getModel();
    + CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
    + cmd.setTransactionNestingEnabled(false);
    + for (Iterator<?> it = view.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = view.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    + if (annotation == null) {
    + // there are indirectly referenced children, need extra commands: false
    + addDestroyShortcutsCommand(cmd, view);
    + // delete host element
    + cmd.add(new DestroyElementCommand(req));
    + } else {
    + cmd.add(new DeleteCommand(getEditingDomain(), view));
    + }
    + return getGEFWrapper(cmd.reduce());
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
    + Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) : getCompleteCreateRelationshipCommand(req);
    + return command != null ? command : super.getCreateRelationshipCommand(req);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getStartCreateRelationshipCommand(CreateRelationshipRequest req) {
    + if (LinklfElementTypes.Link_4001 == req.getElementType()) {
    + return getGEFWrapper(new LinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + if (LinklfElementTypes.LabeledLink_4002 == req.getElementType()) {
    + return getGEFWrapper(new LabeledLinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + return null;
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
    + if (LinklfElementTypes.Link_4001 == req.getElementType()) {
    + return getGEFWrapper(new LinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + if (LinklfElementTypes.LabeledLink_4002 == req.getElementType()) {
    + return getGEFWrapper(new LabeledLinkCreateCommand(req, req.getSource(), req.getTarget()));
    + }
    + return null;
    + }
    +
    + /**
    + * Returns command to reorient EClass based link. New link target or source
    + * should be the domain model element associated with this node.
    + *
    + * @generated
    + */
    + protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
    + switch (getVisualID(req)) {
    + case LinkEditPart.VISUAL_ID:
    + return getGEFWrapper(new LinkReorientCommand(req));
    + case LabeledLinkEditPart.VISUAL_ID:
    + return getGEFWrapper(new LabeledLinkReorientCommand(req));
    + }
    + return super.getReorientRelationshipCommand(req);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2CanonicalEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2CanonicalEditPolicy.java
    new file mode 100644
    index 000000000..9d1ee1a50
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2CanonicalEditPolicy.java
    @@ -0,0 +1,158 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.ArrayList;
    +import java.util.Collection;
    +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.emf.ecore.EStructuralFeature;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.notation.Node;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfPackage;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.PortEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramUpdater;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfNodeDescriptor;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +
    +/**
    + * @generated
    + */
    +public class Container2CanonicalEditPolicy extends CanonicalEditPolicy {
    +
    + /**
    + * @generated
    + */
    + protected void refreshOnActivate() {
    + // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
    + List<?> c = getHost().getChildren();
    + for (int i = 0; i < c.size(); i++) {
    + ((EditPart) c.get(i)).activate();
    + }
    + super.refreshOnActivate();
    + }
    +
    + /**
    + * @generated
    + */
    + protected EStructuralFeature getFeatureToSynchronize() {
    + return LinklfPackage.eINSTANCE.getContainer_Porst();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getSemanticChildrenList() {
    + View viewObject = (View) getHost().getModel();
    + LinkedList<EObject> result = new LinkedList<EObject>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainer_3002SemanticChildren(viewObject);
    + for (LinklfNodeDescriptor d : childDescriptors) {
    + result.add(d.getModelElement());
    + }
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
    + return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
    + }
    +
    + /**
    + * @generated
    + */
    + private boolean isMyDiagramElement(View view) {
    + return PortEditPart.VISUAL_ID == LinklfVisualIDRegistry.getVisualID(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshSemantic() {
    + if (resolveSemanticElement() == null) {
    + return;
    + }
    + LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainer_3002SemanticChildren((View) getHost().getModel());
    + LinkedList<View> orphaned = new LinkedList<View>();
    + // we care to check only views we recognize as ours
    + LinkedList<View> knownViewChildren = new LinkedList<View>();
    + for (View v : getViewChildren()) {
    + if (isMyDiagramElement(v)) {
    + knownViewChildren.add(v);
    + }
    + }
    + // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
    + //
    + // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    + // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    + // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    + for (Iterator<LinklfNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
    + LinklfNodeDescriptor next = descriptorsIterator.next();
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
    + for (View childView : getViewChildren()) {
    + EObject semanticElement = childView.getElement();
    + if (next.getModelElement().equals(semanticElement)) {
    + if (hint.equals(childView.getType())) {
    + perfectMatch.add(childView);
    + // actually, can stop iteration over view children here, but
    + // may want to use not the first view but last one as a 'real' match (the way original CEP does
    + // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
    + }
    + }
    + }
    + if (perfectMatch.size() > 0) {
    + descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
    + // use only one view (first or last?), keep rest as orphaned for further consideration
    + knownViewChildren.remove(perfectMatch.getFirst());
    + }
    + }
    + // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    + // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    + orphaned.addAll(knownViewChildren);
    + //
    + ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
    + for (LinklfNodeDescriptor next : childDescriptors) {
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
    + CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
    + viewDescriptors.add(descriptor);
    + }
    +
    + boolean changed = deleteViews(orphaned.iterator());
    + //
    + CreateViewRequest request = getCreateViewRequest(viewDescriptors);
    + Command cmd = getCreateViewCommand(request);
    + if (cmd != null && cmd.canExecute()) {
    + SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
    + executeCommand(cmd);
    + @SuppressWarnings("unchecked")
    + List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
    + createdViews.addAll(nl);
    + }
    + if (changed || createdViews.size() > 0) {
    + postProcessRefreshSemantic(createdViews);
    + }
    + if (createdViews.size() > 1) {
    + // perform a layout of the container
    + DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
    + executeCommand(new ICommandProxy(layoutCmd));
    + }
    +
    + makeViewsImmutable(createdViews);
    + }
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2ItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2ItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..68b457420
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/Container2ItemSemanticEditPolicy.java
    @@ -0,0 +1,234 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.Iterator;
    +
    +import org.eclipse.emf.ecore.EAnnotation;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
    +import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
    +import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
    +import org.eclipse.gmf.runtime.notation.Edge;
    +import org.eclipse.gmf.runtime.notation.Node;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.PortCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Circle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Container2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.ContainerContainerCompartment2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.PortEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rectangle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rhombus2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class Container2ItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public Container2ItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Container_3002);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCreateCommand(CreateElementRequest req) {
    + if (LinklfElementTypes.Port_3005 == req.getElementType()) {
    + return getGEFWrapper(new PortCreateCommand(req));
    + }
    + return super.getCreateCommand(req);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getDestroyElementCommand(DestroyElementRequest req) {
    + View view = (View) getHost().getModel();
    + CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
    + cmd.setTransactionNestingEnabled(false);
    + EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    + if (annotation == null) {
    + // there are indirectly referenced children, need extra commands: false
    + addDestroyChildNodesCommand(cmd);
    + addDestroyShortcutsCommand(cmd, view);
    + // delete host element
    + cmd.add(new DestroyElementCommand(req));
    + } else {
    + cmd.add(new DeleteCommand(getEditingDomain(), view));
    + }
    + return getGEFWrapper(cmd.reduce());
    + }
    +
    + /**
    + * @generated
    + */
    + private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
    + View view = (View) getHost().getModel();
    + for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
    + Node node = (Node) nit.next();
    + switch (LinklfVisualIDRegistry.getVisualID(node)) {
    + case PortEditPart.VISUAL_ID:
    + for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of node as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
    + break;
    + case ContainerContainerCompartment2EditPart.VISUAL_ID:
    + for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
    + Node cnode = (Node) cit.next();
    + switch (LinklfVisualIDRegistry.getVisualID(cnode)) {
    + case Circle2EditPart.VISUAL_ID:
    + for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + case Container2EditPart.VISUAL_ID:
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + case Rectangle2EditPart.VISUAL_ID:
    + for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + case Rhombus2EditPart.VISUAL_ID:
    + for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + }
    + }
    + break;
    + }
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerCanonicalEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerCanonicalEditPolicy.java
    new file mode 100644
    index 000000000..cd26e8976
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerCanonicalEditPolicy.java
    @@ -0,0 +1,158 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.ArrayList;
    +import java.util.Collection;
    +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.emf.ecore.EStructuralFeature;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.notation.Node;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfPackage;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.PortEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramUpdater;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfNodeDescriptor;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +
    +/**
    + * @generated
    + */
    +public class ContainerCanonicalEditPolicy extends CanonicalEditPolicy {
    +
    + /**
    + * @generated
    + */
    + protected void refreshOnActivate() {
    + // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
    + List<?> c = getHost().getChildren();
    + for (int i = 0; i < c.size(); i++) {
    + ((EditPart) c.get(i)).activate();
    + }
    + super.refreshOnActivate();
    + }
    +
    + /**
    + * @generated
    + */
    + protected EStructuralFeature getFeatureToSynchronize() {
    + return LinklfPackage.eINSTANCE.getContainer_Porst();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getSemanticChildrenList() {
    + View viewObject = (View) getHost().getModel();
    + LinkedList<EObject> result = new LinkedList<EObject>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainer_2003SemanticChildren(viewObject);
    + for (LinklfNodeDescriptor d : childDescriptors) {
    + result.add(d.getModelElement());
    + }
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
    + return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
    + }
    +
    + /**
    + * @generated
    + */
    + private boolean isMyDiagramElement(View view) {
    + return PortEditPart.VISUAL_ID == LinklfVisualIDRegistry.getVisualID(view);
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshSemantic() {
    + if (resolveSemanticElement() == null) {
    + return;
    + }
    + LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainer_2003SemanticChildren((View) getHost().getModel());
    + LinkedList<View> orphaned = new LinkedList<View>();
    + // we care to check only views we recognize as ours
    + LinkedList<View> knownViewChildren = new LinkedList<View>();
    + for (View v : getViewChildren()) {
    + if (isMyDiagramElement(v)) {
    + knownViewChildren.add(v);
    + }
    + }
    + // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
    + //
    + // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    + // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    + // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    + for (Iterator<LinklfNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
    + LinklfNodeDescriptor next = descriptorsIterator.next();
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
    + for (View childView : getViewChildren()) {
    + EObject semanticElement = childView.getElement();
    + if (next.getModelElement().equals(semanticElement)) {
    + if (hint.equals(childView.getType())) {
    + perfectMatch.add(childView);
    + // actually, can stop iteration over view children here, but
    + // may want to use not the first view but last one as a 'real' match (the way original CEP does
    + // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
    + }
    + }
    + }
    + if (perfectMatch.size() > 0) {
    + descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
    + // use only one view (first or last?), keep rest as orphaned for further consideration
    + knownViewChildren.remove(perfectMatch.getFirst());
    + }
    + }
    + // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    + // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    + orphaned.addAll(knownViewChildren);
    + //
    + ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
    + for (LinklfNodeDescriptor next : childDescriptors) {
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
    + CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
    + viewDescriptors.add(descriptor);
    + }
    +
    + boolean changed = deleteViews(orphaned.iterator());
    + //
    + CreateViewRequest request = getCreateViewRequest(viewDescriptors);
    + Command cmd = getCreateViewCommand(request);
    + if (cmd != null && cmd.canExecute()) {
    + SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
    + executeCommand(cmd);
    + @SuppressWarnings("unchecked")
    + List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
    + createdViews.addAll(nl);
    + }
    + if (changed || createdViews.size() > 0) {
    + postProcessRefreshSemantic(createdViews);
    + }
    + if (createdViews.size() > 1) {
    + // perform a layout of the container
    + DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
    + executeCommand(new ICommandProxy(layoutCmd));
    + }
    +
    + makeViewsImmutable(createdViews);
    + }
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2CanonicalEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2CanonicalEditPolicy.java
    new file mode 100644
    index 000000000..ea869db37
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2CanonicalEditPolicy.java
    @@ -0,0 +1,169 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.ArrayList;
    +import java.util.Collection;
    +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.emf.ecore.EStructuralFeature;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.notation.Node;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfPackage;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Circle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Container2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rectangle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rhombus2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramUpdater;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfNodeDescriptor;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +
    +/**
    + * @generated
    + */
    +public class ContainerContainerCompartment2CanonicalEditPolicy extends CanonicalEditPolicy {
    +
    + /**
    + * @generated
    + */
    + protected void refreshOnActivate() {
    + // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
    + List<?> c = getHost().getChildren();
    + for (int i = 0; i < c.size(); i++) {
    + ((EditPart) c.get(i)).activate();
    + }
    + super.refreshOnActivate();
    + }
    +
    + /**
    + * @generated
    + */
    + protected EStructuralFeature getFeatureToSynchronize() {
    + return LinklfPackage.eINSTANCE.getCanvasElementContainer_Elements();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getSemanticChildrenList() {
    + View viewObject = (View) getHost().getModel();
    + LinkedList<EObject> result = new LinkedList<EObject>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainerContainerCompartment_7002SemanticChildren(viewObject);
    + for (LinklfNodeDescriptor d : childDescriptors) {
    + result.add(d.getModelElement());
    + }
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
    + return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
    + }
    +
    + /**
    + * @generated
    + */
    + private boolean isMyDiagramElement(View view) {
    + int visualID = LinklfVisualIDRegistry.getVisualID(view);
    + switch (visualID) {
    + case Circle2EditPart.VISUAL_ID:
    + case Container2EditPart.VISUAL_ID:
    + case Rectangle2EditPart.VISUAL_ID:
    + case Rhombus2EditPart.VISUAL_ID:
    + return true;
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshSemantic() {
    + if (resolveSemanticElement() == null) {
    + return;
    + }
    + LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainerContainerCompartment_7002SemanticChildren((View) getHost().getModel());
    + LinkedList<View> orphaned = new LinkedList<View>();
    + // we care to check only views we recognize as ours
    + LinkedList<View> knownViewChildren = new LinkedList<View>();
    + for (View v : getViewChildren()) {
    + if (isMyDiagramElement(v)) {
    + knownViewChildren.add(v);
    + }
    + }
    + // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
    + //
    + // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    + // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    + // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    + for (Iterator<LinklfNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
    + LinklfNodeDescriptor next = descriptorsIterator.next();
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
    + for (View childView : getViewChildren()) {
    + EObject semanticElement = childView.getElement();
    + if (next.getModelElement().equals(semanticElement)) {
    + if (hint.equals(childView.getType())) {
    + perfectMatch.add(childView);
    + // actually, can stop iteration over view children here, but
    + // may want to use not the first view but last one as a 'real' match (the way original CEP does
    + // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
    + }
    + }
    + }
    + if (perfectMatch.size() > 0) {
    + descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
    + // use only one view (first or last?), keep rest as orphaned for further consideration
    + knownViewChildren.remove(perfectMatch.getFirst());
    + }
    + }
    + // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    + // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    + orphaned.addAll(knownViewChildren);
    + //
    + ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
    + for (LinklfNodeDescriptor next : childDescriptors) {
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
    + CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
    + viewDescriptors.add(descriptor);
    + }
    +
    + boolean changed = deleteViews(orphaned.iterator());
    + //
    + CreateViewRequest request = getCreateViewRequest(viewDescriptors);
    + Command cmd = getCreateViewCommand(request);
    + if (cmd != null && cmd.canExecute()) {
    + SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
    + executeCommand(cmd);
    + @SuppressWarnings("unchecked")
    + List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
    + createdViews.addAll(nl);
    + }
    + if (changed || createdViews.size() > 0) {
    + postProcessRefreshSemantic(createdViews);
    + }
    + if (createdViews.size() > 1) {
    + // perform a layout of the container
    + DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
    + executeCommand(new ICommandProxy(layoutCmd));
    + }
    +
    + makeViewsImmutable(createdViews);
    + }
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2ItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2ItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..8c1ea7a43
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartment2ItemSemanticEditPolicy.java
    @@ -0,0 +1,42 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Circle2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Container2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Rectangle2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Rhombus2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class ContainerContainerCompartment2ItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public ContainerContainerCompartment2ItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Container_3002);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCreateCommand(CreateElementRequest req) {
    + if (LinklfElementTypes.Circle_3001 == req.getElementType()) {
    + return getGEFWrapper(new Circle2CreateCommand(req));
    + }
    + if (LinklfElementTypes.Container_3002 == req.getElementType()) {
    + return getGEFWrapper(new Container2CreateCommand(req));
    + }
    + if (LinklfElementTypes.Rectangle_3003 == req.getElementType()) {
    + return getGEFWrapper(new Rectangle2CreateCommand(req));
    + }
    + if (LinklfElementTypes.Rhombus_3004 == req.getElementType()) {
    + return getGEFWrapper(new Rhombus2CreateCommand(req));
    + }
    + return super.getCreateCommand(req);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentCanonicalEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentCanonicalEditPolicy.java
    new file mode 100644
    index 000000000..f32cf0bd0
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentCanonicalEditPolicy.java
    @@ -0,0 +1,169 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.ArrayList;
    +import java.util.Collection;
    +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.emf.ecore.EStructuralFeature;
    +import org.eclipse.gef.EditPart;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
    +import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
    +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
    +import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
    +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
    +import org.eclipse.gmf.runtime.notation.Node;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.LinklfPackage;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Circle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Container2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rectangle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rhombus2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfDiagramUpdater;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfNodeDescriptor;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +
    +/**
    + * @generated
    + */
    +public class ContainerContainerCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
    +
    + /**
    + * @generated
    + */
    + protected void refreshOnActivate() {
    + // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
    + List<?> c = getHost().getChildren();
    + for (int i = 0; i < c.size(); i++) {
    + ((EditPart) c.get(i)).activate();
    + }
    + super.refreshOnActivate();
    + }
    +
    + /**
    + * @generated
    + */
    + protected EStructuralFeature getFeatureToSynchronize() {
    + return LinklfPackage.eINSTANCE.getCanvasElementContainer_Elements();
    + }
    +
    + /**
    + * @generated
    + */
    + @SuppressWarnings("rawtypes")
    + protected List getSemanticChildrenList() {
    + View viewObject = (View) getHost().getModel();
    + LinkedList<EObject> result = new LinkedList<EObject>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainerContainerCompartment_7001SemanticChildren(viewObject);
    + for (LinklfNodeDescriptor d : childDescriptors) {
    + result.add(d.getModelElement());
    + }
    + return result;
    + }
    +
    + /**
    + * @generated
    + */
    + protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
    + return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
    + }
    +
    + /**
    + * @generated
    + */
    + private boolean isMyDiagramElement(View view) {
    + int visualID = LinklfVisualIDRegistry.getVisualID(view);
    + switch (visualID) {
    + case Circle2EditPart.VISUAL_ID:
    + case Container2EditPart.VISUAL_ID:
    + case Rectangle2EditPart.VISUAL_ID:
    + case Rhombus2EditPart.VISUAL_ID:
    + return true;
    + }
    + return false;
    + }
    +
    + /**
    + * @generated
    + */
    + protected void refreshSemantic() {
    + if (resolveSemanticElement() == null) {
    + return;
    + }
    + LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
    + List<LinklfNodeDescriptor> childDescriptors = LinklfDiagramUpdater.getContainerContainerCompartment_7001SemanticChildren((View) getHost().getModel());
    + LinkedList<View> orphaned = new LinkedList<View>();
    + // we care to check only views we recognize as ours
    + LinkedList<View> knownViewChildren = new LinkedList<View>();
    + for (View v : getViewChildren()) {
    + if (isMyDiagramElement(v)) {
    + knownViewChildren.add(v);
    + }
    + }
    + // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
    + //
    + // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    + // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    + // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    + for (Iterator<LinklfNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
    + LinklfNodeDescriptor next = descriptorsIterator.next();
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
    + for (View childView : getViewChildren()) {
    + EObject semanticElement = childView.getElement();
    + if (next.getModelElement().equals(semanticElement)) {
    + if (hint.equals(childView.getType())) {
    + perfectMatch.add(childView);
    + // actually, can stop iteration over view children here, but
    + // may want to use not the first view but last one as a 'real' match (the way original CEP does
    + // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
    + }
    + }
    + }
    + if (perfectMatch.size() > 0) {
    + descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
    + // use only one view (first or last?), keep rest as orphaned for further consideration
    + knownViewChildren.remove(perfectMatch.getFirst());
    + }
    + }
    + // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    + // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    + orphaned.addAll(knownViewChildren);
    + //
    + ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
    + for (LinklfNodeDescriptor next : childDescriptors) {
    + String hint = LinklfVisualIDRegistry.getType(next.getVisualID());
    + IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
    + CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
    + viewDescriptors.add(descriptor);
    + }
    +
    + boolean changed = deleteViews(orphaned.iterator());
    + //
    + CreateViewRequest request = getCreateViewRequest(viewDescriptors);
    + Command cmd = getCreateViewCommand(request);
    + if (cmd != null && cmd.canExecute()) {
    + SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
    + executeCommand(cmd);
    + @SuppressWarnings("unchecked")
    + List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject();
    + createdViews.addAll(nl);
    + }
    + if (changed || createdViews.size() > 0) {
    + postProcessRefreshSemantic(createdViews);
    + }
    + if (createdViews.size() > 1) {
    + // perform a layout of the container
    + DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
    + executeCommand(new ICommandProxy(layoutCmd));
    + }
    +
    + makeViewsImmutable(createdViews);
    + }
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..1c3281fee
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerContainerCompartmentItemSemanticEditPolicy.java
    @@ -0,0 +1,42 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Circle2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Container2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Rectangle2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.Rhombus2CreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class ContainerContainerCompartmentItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public ContainerContainerCompartmentItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Container_2003);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCreateCommand(CreateElementRequest req) {
    + if (LinklfElementTypes.Circle_3001 == req.getElementType()) {
    + return getGEFWrapper(new Circle2CreateCommand(req));
    + }
    + if (LinklfElementTypes.Container_3002 == req.getElementType()) {
    + return getGEFWrapper(new Container2CreateCommand(req));
    + }
    + if (LinklfElementTypes.Rectangle_3003 == req.getElementType()) {
    + return getGEFWrapper(new Rectangle2CreateCommand(req));
    + }
    + if (LinklfElementTypes.Rhombus_3004 == req.getElementType()) {
    + return getGEFWrapper(new Rhombus2CreateCommand(req));
    + }
    + return super.getCreateCommand(req);
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..150b8bc27
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/ContainerItemSemanticEditPolicy.java
    @@ -0,0 +1,234 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import java.util.Iterator;
    +
    +import org.eclipse.emf.ecore.EAnnotation;
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
    +import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
    +import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
    +import org.eclipse.gmf.runtime.notation.Edge;
    +import org.eclipse.gmf.runtime.notation.Node;
    +import org.eclipse.gmf.runtime.notation.View;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.commands.PortCreateCommand;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Circle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Container2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.ContainerContainerCompartmentEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LabeledLinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.LinkEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.PortEditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rectangle2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.edit.parts.Rhombus2EditPart;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.part.LinklfVisualIDRegistry;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class ContainerItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public ContainerItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Container_2003);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getCreateCommand(CreateElementRequest req) {
    + if (LinklfElementTypes.Port_3005 == req.getElementType()) {
    + return getGEFWrapper(new PortCreateCommand(req));
    + }
    + return super.getCreateCommand(req);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getDestroyElementCommand(DestroyElementRequest req) {
    + View view = (View) getHost().getModel();
    + CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
    + cmd.setTransactionNestingEnabled(false);
    + EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
    + if (annotation == null) {
    + // there are indirectly referenced children, need extra commands: false
    + addDestroyChildNodesCommand(cmd);
    + addDestroyShortcutsCommand(cmd, view);
    + // delete host element
    + cmd.add(new DestroyElementCommand(req));
    + } else {
    + cmd.add(new DeleteCommand(getEditingDomain(), view));
    + }
    + return getGEFWrapper(cmd.reduce());
    + }
    +
    + /**
    + * @generated
    + */
    + private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
    + View view = (View) getHost().getModel();
    + for (Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
    + Node node = (Node) nit.next();
    + switch (LinklfVisualIDRegistry.getVisualID(node)) {
    + case PortEditPart.VISUAL_ID:
    + for (Iterator<?> it = node.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = node.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), node.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of node as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), node));
    + break;
    + case ContainerContainerCompartmentEditPart.VISUAL_ID:
    + for (Iterator<?> cit = node.getChildren().iterator(); cit.hasNext();) {
    + Node cnode = (Node) cit.next();
    + switch (LinklfVisualIDRegistry.getVisualID(cnode)) {
    + case Circle2EditPart.VISUAL_ID:
    + for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + case Container2EditPart.VISUAL_ID:
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + case Rectangle2EditPart.VISUAL_ID:
    + for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + case Rhombus2EditPart.VISUAL_ID:
    + for (Iterator<?> it = cnode.getTargetEdges().iterator(); it.hasNext();) {
    + Edge incomingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(incomingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
    + continue;
    + }
    + }
    + for (Iterator<?> it = cnode.getSourceEdges().iterator(); it.hasNext();) {
    + Edge outgoingLink = (Edge) it.next();
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + if (LinklfVisualIDRegistry.getVisualID(outgoingLink) == LabeledLinkEditPart.VISUAL_ID) {
    + DestroyElementRequest r = new DestroyElementRequest(outgoingLink.getElement(), false);
    + cmd.add(new DestroyElementCommand(r));
    + cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
    + continue;
    + }
    + }
    + cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: true
    + // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
    + // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
    + break;
    + }
    + }
    + break;
    + }
    + }
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LabeledLinkItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LabeledLinkItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..0a8c965c6
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LabeledLinkItemSemanticEditPolicy.java
    @@ -0,0 +1,27 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class LabeledLinkItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public LabeledLinkItemSemanticEditPolicy() {
    + super(LinklfElementTypes.LabeledLink_4002);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getDestroyElementCommand(DestroyElementRequest req) {
    + return getGEFWrapper(new DestroyElementCommand(req));
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinkItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinkItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..c464dc25d
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinkItemSemanticEditPolicy.java
    @@ -0,0 +1,27 @@
    +package org.eclipse.gmf.tooling.examples.linklf.diagram.edit.policies;
    +
    +import org.eclipse.gef.commands.Command;
    +import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
    +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
    +import org.eclipse.gmf.tooling.examples.linklf.diagram.providers.LinklfElementTypes;
    +
    +/**
    + * @generated
    + */
    +public class LinkItemSemanticEditPolicy extends LinklfBaseItemSemanticEditPolicy {
    +
    + /**
    + * @generated
    + */
    + public LinkItemSemanticEditPolicy() {
    + super(LinklfElementTypes.Link_4001);
    + }
    +
    + /**
    + * @generated
    + */
    + protected Command getDestroyElementCommand(DestroyElementRequest req) {
    + return getGEFWrapper(new DestroyElementCommand(req));
    + }
    +
    +}
    diff --git a/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinklfBaseItemSemanticEditPolicy.java b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinklfBaseItemSemanticEditPolicy.java
    new file mode 100644
    index 000000000..4778ab6eb
    --- /dev/null
    +++ b/test-examples/linklf/xtend/org.eclipse.gmf.tooling.examples.linklf.diagram/src/org/eclipse/gmf/tooling/examples/linklf/diagram/edit/policies/LinklfBaseItemSemanticEditPolicy.java