Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-07-19 08:22:04 +0000
committerEike Stepper2012-07-19 08:22:04 +0000
commit1460904fd3c193ffaf809913b2983a400fce9d94 (patch)
tree72f3a17b75fedba3ae1060df1d32c9c7889be954 /plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram
parent5f360965ae87478e0681899bf310a210cafc2c44 (diff)
downloadcdo-1460904fd3c193ffaf809913b2983a400fce9d94.tar.gz
cdo-1460904fd3c193ffaf809913b2983a400fce9d94.tar.xz
cdo-1460904fd3c193ffaf809913b2983a400fce9d94.zip
Fix line endings in master (dos2unix)
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/META-INF/MANIFEST.MF96
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/copyright.txt14
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/messages.properties204
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/plugin.xml1176
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttribute2CreateCommand.java204
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttributeCreateCommand.java204
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsCreateCommand.java236
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsReorientCommand.java364
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsCreateCommand.java236
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsReorientCommand.java364
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsCreateCommand.java236
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsReorientCommand.java364
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCreateCommand.java202
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesCreateCommand.java240
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesReorientCommand.java366
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesCreateCommand.java236
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesReorientCommand.java364
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AInterfaceCreateCommand.java204
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperation2CreateCommand.java204
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperationCreateCommand.java204
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AAttributeEditHelper.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AClassEditHelper.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/ACoreRootEditHelper.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AInterfaceEditHelper.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AOperationEditHelper.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AcoreBaseEditHelper.java216
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttribute2EditPart.java1368
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttributeEditPart.java1368
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAAttributeCompartmentEditPart.java188
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAOperationClassCompartmentEditPart.java188
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAggregationsEditPart.java236
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAssociationsEditPart.java140
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassCompositionsEditPart.java236
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassEditPart.java1164
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassImplementedInterfacesEditPart.java206
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassNameEditPart.java1370
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassSubClassesEditPart.java234
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/ACoreRootEditPart.java112
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAAttributeInterfaceCompartmentEditPart.java190
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAOperationInterfaceCompartmentEditPart.java190
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceNameEditPart.java1372
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperation2EditPart.java1368
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperationEditPart.java1368
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AcoreEditPartFactory.java456
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AAttribute2ItemSemanticEditPolicy.java124
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AAttributeItemSemanticEditPolicy.java124
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassAAttributeCompartmentCanonicalEditPolicy.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassAAttributeCompartmentItemSemanticEditPolicy.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassAOperationClassCompartmentCanonicalEditPolicy.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassAOperationClassCompartmentItemSemanticEditPolicy.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassAggregationsItemSemanticEditPolicy.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassAssociationsItemSemanticEditPolicy.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassCompositionsItemSemanticEditPolicy.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassImplementedInterfacesItemSemanticEditPolicy.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassItemSemanticEditPolicy.java614
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AClassSubClassesItemSemanticEditPolicy.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/ACoreRootCanonicalEditPolicy.java696
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/ACoreRootItemSemanticEditPolicy.java162
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAAttributeInterfaceCompartmentItemSemanticEditPolicy.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAOperationInterfaceCompartmentCanonicalEditPolicy.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceAOperationInterfaceCompartmentItemSemanticEditPolicy.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AInterfaceItemSemanticEditPolicy.java374
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AOperation2ItemSemanticEditPolicy.java124
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AOperationItemSemanticEditPolicy.java124
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AcoreBaseItemSemanticEditPolicy.java948
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AcoreTextNonResizableEditPolicy.java562
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/policies/AcoreTextSelectionEditPolicy.java528
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreAbstractNavigatorItem.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreDomainNavigatorContentProvider.java530
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreDomainNavigatorItem.java270
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreDomainNavigatorLabelProvider.java242
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreNavigatorActionProvider.java420
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreNavigatorContentProvider.java1334
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreNavigatorGroup.java240
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreNavigatorItem.java222
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreNavigatorLabelProvider.java932
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreNavigatorLinkHelper.java298
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/navigator/AcoreNavigatorSorter.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/parsers/AbstractParser.java1170
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/parsers/MessageFormatParser.java456
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreCreationWizard.java388
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreCreationWizardPage.java212
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreDiagramActionBarContributor.java106
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreDiagramEditor.java654
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreDiagramEditorPlugin.java570
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreDiagramEditorUtil.java902
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreDiagramUpdateCommand.java204
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreDiagramUpdater.java1308
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreDocumentProvider.java2424
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreInitDiagramFileAction.java220
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreLinkDescriptor.java232
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreMatchingStrategy.java106
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreNewDiagramFileWizard.java412
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreNodeDescriptor.java114
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcorePaletteFactory.java544
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreUriEditorInputTester.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/AcoreVisualIDRegistry.java644
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/DeleteElementAction.java208
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/DiagramEditorContextMenuProvider.java176
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/LoadResourceAction.java88
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/Messages.java976
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/ModelElementSelectionPage.java348
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/preferences/DiagramAppearancePreferencePage.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/preferences/DiagramConnectionsPreferencePage.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/preferences/DiagramGeneralPreferencePage.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/preferences/DiagramPreferenceInitializer.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/preferences/DiagramPrintingPreferencePage.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/preferences/DiagramRulersAndGridPreferencePage.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/providers/AcoreEditPartProvider.java346
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/providers/AcoreElementTypes.java714
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/providers/AcoreIconProvider.java92
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/providers/AcoreModelingAssistantProvider.java456
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/providers/AcoreParserProvider.java552
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/providers/AcoreViewProvider.java1498
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/providers/ElementInitializers.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/sheet/AcorePropertySection.java282
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/sheet/AcoreSheetLabelProvider.java204
119 files changed, 22768 insertions, 22768 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/.settings/org.eclipse.core.resources.prefs
index ad4c89c6f2..555b7cffc3 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,3 @@
-#Mon Jul 04 12:52:23 CEST 2011
-eclipse.preferences.version=1
-encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
+#Mon Jul 04 12:52:23 CEST 2011
+eclipse.preferences.version=1
+encoding//model/org.eclipse.emf.cdo.defs.ecorediag=UTF-8
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/META-INF/MANIFEST.MF
index 3c378746cd..b9c67cdfd6 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/META-INF/MANIFEST.MF
@@ -1,48 +1,48 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.emf.cdo.dawn.examples.acore.diagram; singleton:=true
-Bundle-Version: 1.0.100.qualifier
-Bundle-ClassPath: .
-Bundle-Activator: org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.parsers;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.part;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers;version="1.0.100",
- org.eclipse.emf.cdo.dawn.examples.acore.diagram.sheet;version="1.0.100"
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.navigator.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.6.0,3.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.emf.edit.ui;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.gmf.runtime.emf.core;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gmf.runtime.emf.commands.core;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gmf.runtime.emf.ui.properties;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.4.0,2.0.0)",
- org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.gmf.runtime.draw2d.ui;bundle-version="[1.4.0,2.0.0)";visibility:=reexport,
- org.eclipse.gef;bundle-version="[3.6.0,4.0.0)";visibility:=reexport,
- org.eclipse.draw2d;bundle-version="[3.6.0,4.0.0)";visibility:=reexport,
- org.eclipse.emf.cdo.dawn.examples.acore;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
- org.eclipse.emf.cdo.dawn.examples.acore.edit;bundle-version="[1.0.0,2.0.0)";visibility:=reexport
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Eclipse-ExtensibleAPI: true
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.cdo.dawn.examples.acore.diagram; singleton:=true
+Bundle-Version: 1.0.100.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorPlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.parsers;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.part;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers;version="1.0.100",
+ org.eclipse.emf.cdo.dawn.examples.acore.diagram.sheet;version="1.0.100"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.jface;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui.navigator;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui.navigator.resources;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.emf.ecore;bundle-version="[2.6.0,3.0.0)",
+ org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
+ org.eclipse.emf.edit.ui;bundle-version="[2.4.0,3.0.0)",
+ org.eclipse.gmf.runtime.emf.core;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.gmf.runtime.emf.ui.properties;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="[1.4.0,2.0.0)",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.gmf.runtime.draw2d.ui;bundle-version="[1.4.0,2.0.0)";visibility:=reexport,
+ org.eclipse.gef;bundle-version="[3.6.0,4.0.0)";visibility:=reexport,
+ org.eclipse.draw2d;bundle-version="[3.6.0,4.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.dawn.examples.acore;bundle-version="[1.0.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.cdo.dawn.examples.acore.edit;bundle-version="[1.0.0,2.0.0)";visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-ExtensibleAPI: true
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/copyright.txt b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/copyright.txt
index 9cbb3ba084..cea141de92 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/copyright.txt
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/copyright.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
-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
-
-Contributors:
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+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
+
+Contributors:
Martin Fluegge - initial API and implementation \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/messages.properties b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/messages.properties
index 0c6d9ad307..81efb01ebf 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/messages.properties
@@ -1,102 +1,102 @@
-# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
-# 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
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-# TODO: manually put keys and values
-AcoreCreationWizardTitle=New Acore Diagram
-AcoreCreationWizard_DiagramModelFilePageTitle=Create Acore Diagram
-AcoreCreationWizard_DiagramModelFilePageDescription=Select resource that will contain diagram model.
-AcoreCreationWizard_DomainModelFilePageTitle=Create Acore Domain Model
-AcoreCreationWizard_DomainModelFilePageDescription=Select resource that will contain domain model.
-AcoreCreationWizardOpenEditorError=Error opening diagram editor
-AcoreCreationWizardCreationError=Creation Problems
-AcoreCreationWizardPageExtensionError=File name should have {0} extension.
-AcoreDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
-AcoreDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
-AcoreDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
-AcoreDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
-AcoreDocumentProvider_isModifiable=Updating cache failed
-AcoreDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
-AcoreDocumentProvider_IncorrectInputError={1}
-AcoreDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
-AcoreDocumentProvider_DiagramLoadingError=Error loading diagram
-AcoreDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
-AcoreDocumentProvider_SaveDiagramTask=Saving diagram
-AcoreDocumentProvider_SaveNextResourceTask=Saving {0}
-AcoreDocumentProvider_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
-AcoreNewDiagramFileWizard_CreationPageName=Initialize new diagram file
-AcoreNewDiagramFileWizard_CreationPageTitle=Diagram file
-AcoreNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
-AcoreNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
-AcoreNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
-AcoreNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
-AcoreNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
-AcoreNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
-AcoreNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
-AcoreNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
-AcoreNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
-AcoreDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
-AcoreDiagramEditor_SaveAsErrorTitle=Problem During Save As...
-AcoreDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
-AcoreDiagramEditor_SaveErrorTitle=Save Problems
-AcoreDiagramEditor_SaveErrorMessage=Could not save file.
-AcoreElementChooserDialog_SelectModelElementTitle=Select model element
-ModelElementSelectionPageMessage=Select model element:
-ValidateActionMessage=Validate
-Node1Group_title=Node
-Connections2Group_title=Connections
-AClass1CreationTool_title=AClass
-AClass1CreationTool_desc=Create new AClass
-AInterface2CreationTool_title=AInterface
-AInterface2CreationTool_desc=Create new AInterface
-AAttribute3CreationTool_title=AAttribute
-AAttribute3CreationTool_desc=Create an Attribute
-AOperation4CreationTool_title=AOperation
-AOperation4CreationTool_desc=Create an Operation
-Inherits1CreationTool_title=inherits
-Inherits1CreationTool_desc=Create new AClassSubClasses
-Implements2CreationTool_title=implements
-Implements2CreationTool_desc=Create new AClassImplementedInterfaces
-Association3CreationTool_title=association
-Association3CreationTool_desc=Create new AClassSubClasses
-Aggregation4CreationTool_title=aggregation
-Aggregation4CreationTool_desc=Create new AClassSubClasses
-Composition5CreationTool_title=composition
-Composition5CreationTool_desc=Create new AClassSubClasses
-AInterfaceAAttributeInterfaceCompartmentEditPart_title=AAttributeInterfaceCompartment
-AInterfaceAOperationInterfaceCompartmentEditPart_title=AOperationInterfaceCompartment
-AClassAAttributeCompartmentEditPart_title=AAttributeCompartment
-AClassAOperationClassCompartmentEditPart_title=AOperationClassCompartment
-
-CommandName_OpenDiagram=Open Diagram
-NavigatorGroupName_AClassSubClasses_4001_target=target
-NavigatorGroupName_AClassSubClasses_4001_source=source
-NavigatorGroupName_AClassCompositions_4005_target=target
-NavigatorGroupName_AClassCompositions_4005_source=source
-NavigatorGroupName_AInterface_2001_incominglinks=incoming links
-NavigatorGroupName_AClassAggregations_4004_target=target
-NavigatorGroupName_AClassAggregations_4004_source=source
-NavigatorGroupName_AClassImplementedInterfaces_4002_target=target
-NavigatorGroupName_AClassImplementedInterfaces_4002_source=source
-NavigatorGroupName_AClass_2002_incominglinks=incoming links
-NavigatorGroupName_AClass_2002_outgoinglinks=outgoing links
-NavigatorGroupName_ACoreRoot_1000_links=links
-NavigatorGroupName_AClassAssociations_4003_target=target
-NavigatorGroupName_AClassAssociations_4003_source=source
-NavigatorActionProvider_OpenDiagramActionName=Open Diagram
-AbstractParser_UnexpectedValueType=Value of type {0} is expected
-AbstractParser_WrongStringConversion=String value does not convert to {0} value
-AbstractParser_UnknownLiteral=Unknown literal: {0}
-
-MessageFormatParser_InvalidInputError=Invalid input at {0}
-AcoreModelingAssistantProviderTitle=Select domain model element
-AcoreModelingAssistantProviderMessage=Available domain model elements:
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# 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
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# TODO: manually put keys and values
+AcoreCreationWizardTitle=New Acore Diagram
+AcoreCreationWizard_DiagramModelFilePageTitle=Create Acore Diagram
+AcoreCreationWizard_DiagramModelFilePageDescription=Select resource that will contain diagram model.
+AcoreCreationWizard_DomainModelFilePageTitle=Create Acore Domain Model
+AcoreCreationWizard_DomainModelFilePageDescription=Select resource that will contain domain model.
+AcoreCreationWizardOpenEditorError=Error opening diagram editor
+AcoreCreationWizardCreationError=Creation Problems
+AcoreCreationWizardPageExtensionError=File name should have {0} extension.
+AcoreDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
+AcoreDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
+AcoreDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
+AcoreDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
+AcoreDocumentProvider_isModifiable=Updating cache failed
+AcoreDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
+AcoreDocumentProvider_IncorrectInputError={1}
+AcoreDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
+AcoreDocumentProvider_DiagramLoadingError=Error loading diagram
+AcoreDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
+AcoreDocumentProvider_SaveDiagramTask=Saving diagram
+AcoreDocumentProvider_SaveNextResourceTask=Saving {0}
+AcoreDocumentProvider_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
+AcoreNewDiagramFileWizard_CreationPageName=Initialize new diagram file
+AcoreNewDiagramFileWizard_CreationPageTitle=Diagram file
+AcoreNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
+AcoreNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
+AcoreNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
+AcoreNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
+AcoreNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
+AcoreNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
+AcoreNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
+AcoreNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
+AcoreNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
+AcoreDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
+AcoreDiagramEditor_SaveAsErrorTitle=Problem During Save As...
+AcoreDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
+AcoreDiagramEditor_SaveErrorTitle=Save Problems
+AcoreDiagramEditor_SaveErrorMessage=Could not save file.
+AcoreElementChooserDialog_SelectModelElementTitle=Select model element
+ModelElementSelectionPageMessage=Select model element:
+ValidateActionMessage=Validate
+Node1Group_title=Node
+Connections2Group_title=Connections
+AClass1CreationTool_title=AClass
+AClass1CreationTool_desc=Create new AClass
+AInterface2CreationTool_title=AInterface
+AInterface2CreationTool_desc=Create new AInterface
+AAttribute3CreationTool_title=AAttribute
+AAttribute3CreationTool_desc=Create an Attribute
+AOperation4CreationTool_title=AOperation
+AOperation4CreationTool_desc=Create an Operation
+Inherits1CreationTool_title=inherits
+Inherits1CreationTool_desc=Create new AClassSubClasses
+Implements2CreationTool_title=implements
+Implements2CreationTool_desc=Create new AClassImplementedInterfaces
+Association3CreationTool_title=association
+Association3CreationTool_desc=Create new AClassSubClasses
+Aggregation4CreationTool_title=aggregation
+Aggregation4CreationTool_desc=Create new AClassSubClasses
+Composition5CreationTool_title=composition
+Composition5CreationTool_desc=Create new AClassSubClasses
+AInterfaceAAttributeInterfaceCompartmentEditPart_title=AAttributeInterfaceCompartment
+AInterfaceAOperationInterfaceCompartmentEditPart_title=AOperationInterfaceCompartment
+AClassAAttributeCompartmentEditPart_title=AAttributeCompartment
+AClassAOperationClassCompartmentEditPart_title=AOperationClassCompartment
+
+CommandName_OpenDiagram=Open Diagram
+NavigatorGroupName_AClassSubClasses_4001_target=target
+NavigatorGroupName_AClassSubClasses_4001_source=source
+NavigatorGroupName_AClassCompositions_4005_target=target
+NavigatorGroupName_AClassCompositions_4005_source=source
+NavigatorGroupName_AInterface_2001_incominglinks=incoming links
+NavigatorGroupName_AClassAggregations_4004_target=target
+NavigatorGroupName_AClassAggregations_4004_source=source
+NavigatorGroupName_AClassImplementedInterfaces_4002_target=target
+NavigatorGroupName_AClassImplementedInterfaces_4002_source=source
+NavigatorGroupName_AClass_2002_incominglinks=incoming links
+NavigatorGroupName_AClass_2002_outgoinglinks=outgoing links
+NavigatorGroupName_ACoreRoot_1000_links=links
+NavigatorGroupName_AClassAssociations_4003_target=target
+NavigatorGroupName_AClassAssociations_4003_source=source
+NavigatorActionProvider_OpenDiagramActionName=Open Diagram
+AbstractParser_UnexpectedValueType=Value of type {0} is expected
+AbstractParser_WrongStringConversion=String value does not convert to {0} value
+AbstractParser_UnknownLiteral=Unknown literal: {0}
+
+MessageFormatParser_InvalidInputError=Invalid input at {0}
+AcoreModelingAssistantProviderTitle=Select domain model element
+AcoreModelingAssistantProviderMessage=Available domain model elements:
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/plugin.xml b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/plugin.xml
index 5f49533db2..245b5be5e5 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/plugin.xml
@@ -1,588 +1,588 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
-Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
-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
-
-Contributors:
- Martin Fluegge - initial API and implementation
-
--->
-<plugin>
-
- <extension point="org.eclipse.team.core.fileTypes" id="repo-ftype">
- <?gmfgen generated="true"?>
- <fileTypes type="text" extension="acore_diagram"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser" id="resource-factory">
- <?gmfgen generated="true"?>
- <parser
- type="acore_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.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID"
- name="%editorName"
- icon="icons/obj16/AcoreDiagramFile.gif"
- extensions="acore_diagram"
- default="true"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditor"
- matchingStrategy="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreMatchingStrategy"
- contributorClass="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramActionBarContributor">
- </editor>
- </extension>
-
- <extension point="org.eclipse.ui.contexts" id="ui-context">
- <?gmfgen generated="true"?>
- <context
- description="%context.description"
- id="org.eclipse.emf.cdo.dawn.examples.acore.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/AcoreDiagramFile.gif"
- category="org.eclipse.ui.Examples"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreCreationWizard"
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreCreationWizardID">
- <description>%newWizardDesc</description>
- </wizard>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus" id="init-diagram-action">
- <?gmfgen generated="true"?>
- <objectContribution
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.InitDiagram"
- nameFilter="*.acore"
- objectClass="org.eclipse.core.resources.IFile">
- <action
- label="%initDiagramActionLabel"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreInitDiagramFileAction"
- menubarPath="additions"
- enablesFor="1"
- id="org.eclipse.emf.cdo.dawn.examples.acore.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="AcorePresentation">
- <Priority name="Lowest"/>
- <ViewId id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID">
- <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>
- </ViewId>
- </GlobalActionHandlerProvider>
- <GlobalActionHandlerProvider
- class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
- id="AcorePresentationIDE">
- <Priority name="Lowest"/>
- <ViewId id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID">
- <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="AcoreRender">
- <Priority name="Lowest"/>
- <ViewId id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID">
- <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.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramPreferenceInitializer"/>
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages" id="prefpages">
- <?gmfgen generated="true"?>
- <page
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
- name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramGeneralPreferencePage">
- </page>
- <page
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.appearance"
- name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.appearance"
- category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramAppearancePreferencePage">
- </page>
- <page
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.connections"
- name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.connections"
- category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramConnectionsPreferencePage">
- </page>
- <page
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.printing"
- name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.printing"
- category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramPrintingPreferencePage">
- </page>
- <page
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.rulersAndGrid"
- name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.rulersAndGrid"
- category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramRulersAndGridPreferencePage">
- </page>
- </extension>
-
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
- <?gmfgen generated="true"?>
- <propertyContributor
- contributorId="org.eclipse.emf.cdo.dawn.examples.acore.diagram"
- labelProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.sheet.AcoreSheetLabelProvider">
- <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.emf.cdo.dawn.examples.acore.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.emf.cdo.dawn.examples.acore.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.emf.cdo.dawn.examples.acore.diagram.sheet.AcorePropertySection">
- <input type="org.eclipse.gmf.runtime.notation.View"/>
- <input type="org.eclipse.gef.EditPart"/>
- <input type="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
- </propertySection>
- </propertySections>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- <?gmfgen generated="true"?>
- <viewProvider class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreViewProvider">
- <Priority name="Lowest"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="Acore"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001,2002,3001,3002,3003,3004"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001,4002,4003,4004,4005"/>
- </viewProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- <?gmfgen generated="true"?>
- <editpartProvider class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreEditPartProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- <method name="getType()" value="Acore"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="2001,2002,3001,3002,3003,3004"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="4001,4002,4003,4004,4005"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="5001,5002"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value="7001,7002,7003,7004"/>
- </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.emf.cdo.dawn.examples.acore.diagram.providers.AcoreModelingAssistantProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.ACoreRootEditPart" id="ACoreRoot_1000"/>
- <object class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AInterfaceEditPart" id="AInterface_2001"/>
- <object class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart" id="AClass_2002"/>
- <context elements="ACoreRoot_1000,AInterface_2001,AClass_2002"/>
- </modelingAssistantProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- <?gmfgen generated="true"?>
- <IconProvider class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreIconProvider">
- <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.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider">
- <Priority name="Lowest"/>
- </ParserProvider>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
- <?gmfgen generated="true"?>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <metamodelType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.ACoreRoot_1000"
- name="%metatype.name.ACoreRoot_1000"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ACoreRoot"
- edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.ACoreRootEditHelper">
- <param name="semanticHint" value="1000"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <metamodelType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AInterface_2001"
- name="%metatype.name.AInterface_2001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="AInterface"
- edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AInterfaceEditHelper">
- <param name="semanticHint" value="2001"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <metamodelType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClass_2002"
- name="%metatype.name.AClass_2002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="AClass"
- edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AClassEditHelper">
- <param name="semanticHint" value="2002"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <metamodelType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3001"
- name="%metatype.name.AAttribute_3001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="AAttribute"
- edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AAttributeEditHelper">
- <param name="semanticHint" value="3001"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <metamodelType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3002"
- name="%metatype.name.AOperation_3002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="AOperation"
- edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AOperationEditHelper">
- <param name="semanticHint" value="3002"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <specializationType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3003"
- name="%metatype.name.AAttribute_3003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3001"/>
- <param name="semanticHint" value="3003"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <specializationType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3004"
- name="%metatype.name.AOperation_3004"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3002"/>
- <param name="semanticHint" value="3004"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <specializationType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassSubClasses_4001"
- name="%metatype.name.AClassSubClasses_4001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4001"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <specializationType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassImplementedInterfaces_4002"
- name="%metatype.name.AClassImplementedInterfaces_4002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4002"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <specializationType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAssociations_4003"
- name="%metatype.name.AClassAssociations_4003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4003"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <specializationType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAggregations_4004"
- name="%metatype.name.AClassAggregations_4004"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4004"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
- <specializationType
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassCompositions_4005"
- name="%metatype.name.AClassCompositions_4005"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
- <param name="semanticHint" value="4005"/>
- </specializationType>
- </metamodel>
- </extension>
-
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
- <?gmfgen generated="true"?>
- <clientContext id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.TypeContext">
- <enablement>
- <test
- property="org.eclipse.gmf.runtime.emf.core.editingDomain"
- value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.EditingDomain"/>
- </enablement>
- </clientContext>
- <binding context="org.eclipse.emf.cdo.dawn.examples.acore.diagram.TypeContext">
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.ACoreRoot_1000"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AInterface_2001"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClass_2002"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3001"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3002"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3003"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3004"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassSubClasses_4001"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassImplementedInterfaces_4002"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAssociations_4003"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAggregations_4004"/>
- <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassCompositions_4005"/>
- <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.emf.cdo.dawn.examples.acore.diagram.URIEditorInputPropertyTester"
- type="org.eclipse.emf.common.ui.URIEditorInput"
- namespace="org.eclipse.emf.cdo.dawn.examples.acore.diagram"
- properties="isURIEditorInput"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreUriEditorInputTester">
- </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.emf.cdo.dawn.examples.acore.diagram.resourceContent"/>
- <contentExtension pattern="org.eclipse.emf.cdo.dawn.examples.acore.diagram.domainResourceContent"/>
- <contentExtension pattern="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorLinkHelper"/>
- </includes>
- </viewerContentBinding>
- <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <actionExtension pattern="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorActionProvider"/>
- </includes>
- </viewerActionBinding>
- </extension>
-
- <extension point="org.eclipse.ui.navigator.navigatorContent" id="navigator-content">
- <?gmfgen generated="true"?>
- <navigatorContent
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.resourceContent"
- name="%navigatorContentName"
- priority="normal"
- contentProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorContentProvider"
- labelProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorLabelProvider"
- icon="icons/obj16/AcoreDiagramFile.gif"
- activeByDefault="true">
- <triggerPoints>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="acore_diagram"/>
- </and>
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
- </or>
- </triggerPoints>
- <possibleChildren>
- <or>
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
- </or>
- </possibleChildren>
- <commonSorter
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorSorter"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorSorter">
- <parentExpression>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="acore_diagram"/>
- </and>
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
- </or>
- </parentExpression>
- </commonSorter>
- </navigatorContent>
- <navigatorContent
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.domainResourceContent"
- name="%domainNavigatorContentName"
- priority="normal"
- contentProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorContentProvider"
- labelProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorLabelProvider"
- icon="icons/obj16/AcoreDiagramFile.gif"
- activeByDefault="true">
- <triggerPoints>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="acore"/>
- </and>
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorItem"/>
- </or>
- </triggerPoints>
- <possibleChildren>
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorItem"/>
- </possibleChildren>
- </navigatorContent>
- <actionProvider
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorActionProvider"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorActionProvider">
- <enablement>
- <or>
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
- </or>
- </enablement>
- </actionProvider>
- </extension>
-
- <extension point="org.eclipse.ui.navigator.linkHelper" id="navigator-linkhelper">
- <?gmfgen generated="true"?>
- <linkHelper
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorLinkHelper"
- class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorLinkHelper">
- <editorInputEnablement>
- <and>
- <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/>
- <test property="org.eclipse.emf.cdo.dawn.examples.acore.diagram.isURIEditorInput"/>
- </and>
- </editorInputEnablement>
- <selectionEnablement>
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
- </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.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramUpdateCommand"
- description="%update.diagram.description"
- id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.updateDiagram"
- name="%update.diagram.name"/>
- </extension>
-
- <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
- <?gmfgen generated="true"?>
- <key
- commandId="org.eclipse.emf.cdo.dawn.examples.acore.diagram.updateDiagram"
- contextId="org.eclipse.emf.cdo.dawn.examples.acore.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.emf.cdo.dawn.examples.acore.diagram.LoadResourceAction">
- <visibleWhen>
- <and>
- <with variable="activePartId"><equals value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID"/></with>
- <with variable="selection"><iterate ifEmpty="false">
- <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.ACoreRootEditPart"/>
- </iterate></with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
- <extension point="org.eclipse.ui.commands" id="menu-commands">
- <?gmfgen generated="true"?>
- <category id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
- <command id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.LoadResourceAction"
- name="Load Resource"
- categoryId="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID"
- defaultHandler="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.LoadResourceAction"/>
- </extension>
-
- <extension point="org.eclipse.ui.handlers" id="menu-handlers">
- <?gmfgen generated="true"?>
- </extension>
-
- <!-- optionally, specify keybindings -->
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+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
+
+Contributors:
+ Martin Fluegge - initial API and implementation
+
+-->
+<plugin>
+
+ <extension point="org.eclipse.team.core.fileTypes" id="repo-ftype">
+ <?gmfgen generated="true"?>
+ <fileTypes type="text" extension="acore_diagram"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.extension_parser" id="resource-factory">
+ <?gmfgen generated="true"?>
+ <parser
+ type="acore_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.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID"
+ name="%editorName"
+ icon="icons/obj16/AcoreDiagramFile.gif"
+ extensions="acore_diagram"
+ default="true"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditor"
+ matchingStrategy="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreMatchingStrategy"
+ contributorClass="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.contexts" id="ui-context">
+ <?gmfgen generated="true"?>
+ <context
+ description="%context.description"
+ id="org.eclipse.emf.cdo.dawn.examples.acore.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/AcoreDiagramFile.gif"
+ category="org.eclipse.ui.Examples"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreCreationWizard"
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreCreationWizardID">
+ <description>%newWizardDesc</description>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.popupMenus" id="init-diagram-action">
+ <?gmfgen generated="true"?>
+ <objectContribution
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.InitDiagram"
+ nameFilter="*.acore"
+ objectClass="org.eclipse.core.resources.IFile">
+ <action
+ label="%initDiagramActionLabel"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreInitDiagramFileAction"
+ menubarPath="additions"
+ enablesFor="1"
+ id="org.eclipse.emf.cdo.dawn.examples.acore.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="AcorePresentation">
+ <Priority name="Lowest"/>
+ <ViewId id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID">
+ <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>
+ </ViewId>
+ </GlobalActionHandlerProvider>
+ <GlobalActionHandlerProvider
+ class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
+ id="AcorePresentationIDE">
+ <Priority name="Lowest"/>
+ <ViewId id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID">
+ <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="AcoreRender">
+ <Priority name="Lowest"/>
+ <ViewId id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID">
+ <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.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramPreferenceInitializer"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.preferencePages" id="prefpages">
+ <?gmfgen generated="true"?>
+ <page
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
+ name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramGeneralPreferencePage">
+ </page>
+ <page
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.appearance"
+ name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.appearance"
+ category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramAppearancePreferencePage">
+ </page>
+ <page
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.connections"
+ name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.connections"
+ category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramConnectionsPreferencePage">
+ </page>
+ <page
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.printing"
+ name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.printing"
+ category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramPrintingPreferencePage">
+ </page>
+ <page
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.rulersAndGrid"
+ name="%prefpage.org.eclipse.emf.cdo.dawn.examples.acore.diagram.rulersAndGrid"
+ category="org.eclipse.emf.cdo.dawn.examples.acore.diagram.general"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.preferences.DiagramRulersAndGridPreferencePage">
+ </page>
+ </extension>
+
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
+ <?gmfgen generated="true"?>
+ <propertyContributor
+ contributorId="org.eclipse.emf.cdo.dawn.examples.acore.diagram"
+ labelProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.sheet.AcoreSheetLabelProvider">
+ <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.emf.cdo.dawn.examples.acore.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.emf.cdo.dawn.examples.acore.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.emf.cdo.dawn.examples.acore.diagram.sheet.AcorePropertySection">
+ <input type="org.eclipse.gmf.runtime.notation.View"/>
+ <input type="org.eclipse.gef.EditPart"/>
+ <input type="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
+ </propertySection>
+ </propertySections>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
+ <?gmfgen generated="true"?>
+ <viewProvider class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreViewProvider">
+ <Priority name="Lowest"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="Acore"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001,2002,3001,3002,3003,3004"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001,4002,4003,4004,4005"/>
+ </viewProvider>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
+ <?gmfgen generated="true"?>
+ <editpartProvider class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreEditPartProvider">
+ <Priority name="Lowest"/>
+ <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
+ <method name="getType()" value="Acore"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
+ <method name="getType()" value="2001,2002,3001,3002,3003,3004"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
+ <method name="getType()" value="4001,4002,4003,4004,4005"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
+ <method name="getType()" value="5001,5002"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
+ <method name="getType()" value="7001,7002,7003,7004"/>
+ </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.emf.cdo.dawn.examples.acore.diagram.providers.AcoreModelingAssistantProvider">
+ <Priority name="Lowest"/>
+ <object class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.ACoreRootEditPart" id="ACoreRoot_1000"/>
+ <object class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AInterfaceEditPart" id="AInterface_2001"/>
+ <object class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart" id="AClass_2002"/>
+ <context elements="ACoreRoot_1000,AInterface_2001,AClass_2002"/>
+ </modelingAssistantProvider>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
+ <?gmfgen generated="true"?>
+ <IconProvider class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreIconProvider">
+ <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.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider">
+ <Priority name="Lowest"/>
+ </ParserProvider>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
+ <?gmfgen generated="true"?>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <metamodelType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.ACoreRoot_1000"
+ name="%metatype.name.ACoreRoot_1000"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="ACoreRoot"
+ edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.ACoreRootEditHelper">
+ <param name="semanticHint" value="1000"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <metamodelType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AInterface_2001"
+ name="%metatype.name.AInterface_2001"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="AInterface"
+ edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AInterfaceEditHelper">
+ <param name="semanticHint" value="2001"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <metamodelType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClass_2002"
+ name="%metatype.name.AClass_2002"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="AClass"
+ edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AClassEditHelper">
+ <param name="semanticHint" value="2002"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <metamodelType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3001"
+ name="%metatype.name.AAttribute_3001"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="AAttribute"
+ edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AAttributeEditHelper">
+ <param name="semanticHint" value="3001"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <metamodelType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3002"
+ name="%metatype.name.AOperation_3002"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="AOperation"
+ edithelper="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers.AOperationEditHelper">
+ <param name="semanticHint" value="3002"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <specializationType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3003"
+ name="%metatype.name.AAttribute_3003"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3001"/>
+ <param name="semanticHint" value="3003"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <specializationType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3004"
+ name="%metatype.name.AOperation_3004"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3002"/>
+ <param name="semanticHint" value="3004"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <specializationType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassSubClasses_4001"
+ name="%metatype.name.AClassSubClasses_4001"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4001"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <specializationType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassImplementedInterfaces_4002"
+ name="%metatype.name.AClassImplementedInterfaces_4002"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4002"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <specializationType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAssociations_4003"
+ name="%metatype.name.AClassAssociations_4003"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4003"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <specializationType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAggregations_4004"
+ name="%metatype.name.AClassAggregations_4004"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4004"/>
+ </specializationType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/emf/cdo/dawn/examples/2010/ACore">
+ <specializationType
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassCompositions_4005"
+ name="%metatype.name.AClassCompositions_4005"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+ <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/>
+ <param name="semanticHint" value="4005"/>
+ </specializationType>
+ </metamodel>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
+ <?gmfgen generated="true"?>
+ <clientContext id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.TypeContext">
+ <enablement>
+ <test
+ property="org.eclipse.gmf.runtime.emf.core.editingDomain"
+ value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.EditingDomain"/>
+ </enablement>
+ </clientContext>
+ <binding context="org.eclipse.emf.cdo.dawn.examples.acore.diagram.TypeContext">
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.ACoreRoot_1000"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AInterface_2001"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClass_2002"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3001"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3002"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AAttribute_3003"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AOperation_3004"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassSubClasses_4001"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassImplementedInterfaces_4002"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAssociations_4003"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassAggregations_4004"/>
+ <elementType ref="org.eclipse.emf.cdo.dawn.examples.acore.diagram.AClassCompositions_4005"/>
+ <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.emf.cdo.dawn.examples.acore.diagram.URIEditorInputPropertyTester"
+ type="org.eclipse.emf.common.ui.URIEditorInput"
+ namespace="org.eclipse.emf.cdo.dawn.examples.acore.diagram"
+ properties="isURIEditorInput"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreUriEditorInputTester">
+ </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.emf.cdo.dawn.examples.acore.diagram.resourceContent"/>
+ <contentExtension pattern="org.eclipse.emf.cdo.dawn.examples.acore.diagram.domainResourceContent"/>
+ <contentExtension pattern="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorLinkHelper"/>
+ </includes>
+ </viewerContentBinding>
+ <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
+ <includes>
+ <actionExtension pattern="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorActionProvider"/>
+ </includes>
+ </viewerActionBinding>
+ </extension>
+
+ <extension point="org.eclipse.ui.navigator.navigatorContent" id="navigator-content">
+ <?gmfgen generated="true"?>
+ <navigatorContent
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.resourceContent"
+ name="%navigatorContentName"
+ priority="normal"
+ contentProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorContentProvider"
+ labelProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorLabelProvider"
+ icon="icons/obj16/AcoreDiagramFile.gif"
+ activeByDefault="true">
+ <triggerPoints>
+ <or>
+ <and>
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ <test property="org.eclipse.core.resources.extension" value="acore_diagram"/>
+ </and>
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
+ </or>
+ </triggerPoints>
+ <possibleChildren>
+ <or>
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
+ </or>
+ </possibleChildren>
+ <commonSorter
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorSorter"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorSorter">
+ <parentExpression>
+ <or>
+ <and>
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ <test property="org.eclipse.core.resources.extension" value="acore_diagram"/>
+ </and>
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
+ </or>
+ </parentExpression>
+ </commonSorter>
+ </navigatorContent>
+ <navigatorContent
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.domainResourceContent"
+ name="%domainNavigatorContentName"
+ priority="normal"
+ contentProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorContentProvider"
+ labelProvider="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorLabelProvider"
+ icon="icons/obj16/AcoreDiagramFile.gif"
+ activeByDefault="true">
+ <triggerPoints>
+ <or>
+ <and>
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ <test property="org.eclipse.core.resources.extension" value="acore"/>
+ </and>
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorItem"/>
+ </or>
+ </triggerPoints>
+ <possibleChildren>
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreDomainNavigatorItem"/>
+ </possibleChildren>
+ </navigatorContent>
+ <actionProvider
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorActionProvider"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorActionProvider">
+ <enablement>
+ <or>
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
+ </or>
+ </enablement>
+ </actionProvider>
+ </extension>
+
+ <extension point="org.eclipse.ui.navigator.linkHelper" id="navigator-linkhelper">
+ <?gmfgen generated="true"?>
+ <linkHelper
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigatorLinkHelper"
+ class="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreNavigatorLinkHelper">
+ <editorInputEnablement>
+ <and>
+ <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/>
+ <test property="org.eclipse.emf.cdo.dawn.examples.acore.diagram.isURIEditorInput"/>
+ </and>
+ </editorInputEnablement>
+ <selectionEnablement>
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.navigator.AcoreAbstractNavigatorItem"/>
+ </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.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramUpdateCommand"
+ description="%update.diagram.description"
+ id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.updateDiagram"
+ name="%update.diagram.name"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
+ <?gmfgen generated="true"?>
+ <key
+ commandId="org.eclipse.emf.cdo.dawn.examples.acore.diagram.updateDiagram"
+ contextId="org.eclipse.emf.cdo.dawn.examples.acore.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.emf.cdo.dawn.examples.acore.diagram.LoadResourceAction">
+ <visibleWhen>
+ <and>
+ <with variable="activePartId"><equals value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID"/></with>
+ <with variable="selection"><iterate ifEmpty="false">
+ <instanceof value="org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.ACoreRootEditPart"/>
+ </iterate></with>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+ <extension point="org.eclipse.ui.commands" id="menu-commands">
+ <?gmfgen generated="true"?>
+ <category id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
+ <command id="org.eclipse.emf.cdo.dawn.examples.acore.diagram.LoadResourceAction"
+ name="Load Resource"
+ categoryId="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreDiagramEditorID"
+ defaultHandler="org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.LoadResourceAction"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.handlers" id="menu-handlers">
+ <?gmfgen generated="true"?>
+ </extension>
+
+ <!-- optionally, specify keybindings -->
+</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttribute2CreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttribute2CreateCommand.java
index 116273e8a7..5da19ac916 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttribute2CreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttribute2CreateCommand.java
@@ -1,102 +1,102 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AAttribute;
-import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * @generated
- */
-public class AAttribute2CreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- public AAttribute2CreateCommand(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
- {
- AAttribute newElement = AcoreFactory.eINSTANCE.createAAttribute();
-
- ABasicClass owner = (ABasicClass)getElementToEdit();
- owner.getAttributes().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(AAttribute 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);
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AAttribute;
+import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+
+/**
+ * @generated
+ */
+public class AAttribute2CreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ public AAttribute2CreateCommand(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
+ {
+ AAttribute newElement = AcoreFactory.eINSTANCE.createAAttribute();
+
+ ABasicClass owner = (ABasicClass)getElementToEdit();
+ owner.getAttributes().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(AAttribute 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttributeCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttributeCreateCommand.java
index e62293c931..65f4d3e058 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttributeCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AAttributeCreateCommand.java
@@ -1,102 +1,102 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AAttribute;
-import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * @generated
- */
-public class AAttributeCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- public AAttributeCreateCommand(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
- {
- AAttribute newElement = AcoreFactory.eINSTANCE.createAAttribute();
-
- ABasicClass owner = (ABasicClass)getElementToEdit();
- owner.getAttributes().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(AAttribute 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);
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AAttribute;
+import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+
+/**
+ * @generated
+ */
+public class AAttributeCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ public AAttributeCreateCommand(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
+ {
+ AAttribute newElement = AcoreFactory.eINSTANCE.createAAttribute();
+
+ ABasicClass owner = (ABasicClass)getElementToEdit();
+ owner.getAttributes().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(AAttribute 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsCreateCommand.java
index 8e21ad7f20..2dddb72ec7 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsCreateCommand.java
@@ -1,118 +1,118 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.CreateRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassAggregationsCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final EObject source;
-
- /**
- * @generated
- */
- private final EObject target;
-
- /**
- * @generated
- */
- public AClassAggregationsCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
- {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (source == null && target == null)
- {
- return false;
- }
- if (source != null && false == source instanceof AClass)
- {
- return false;
- }
- if (target != null && false == target instanceof AClass)
- {
- 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
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassAggregations_4004(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$
- }
-
- if (getSource() != null && getTarget() != null)
- {
- getSource().getAggregations().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected AClass getSource()
- {
- return (AClass)source;
- }
-
- /**
- * @generated
- */
- protected AClass getTarget()
- {
- return (AClass)target;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.CreateRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassAggregationsCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public AClassAggregationsCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
+ {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (source == null && target == null)
+ {
+ return false;
+ }
+ if (source != null && false == source instanceof AClass)
+ {
+ return false;
+ }
+ if (target != null && false == target instanceof AClass)
+ {
+ 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
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassAggregations_4004(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$
+ }
+
+ if (getSource() != null && getTarget() != null)
+ {
+ getSource().getAggregations().add(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getSource()
+ {
+ return (AClass)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getTarget()
+ {
+ return (AClass)target;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsReorientCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsReorientCommand.java
index f2bda55b40..255f919652 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsReorientCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAggregationsReorientCommand.java
@@ -1,182 +1,182 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassAggregationsReorientCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public AClassAggregationsReorientCommand(ReorientReferenceRelationshipRequest request)
- {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (false == referenceOwner instanceof AClass)
- {
- 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 AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAggregations_4004(getNewSource(),
- getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget()
- {
- if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAggregations_4004(getOldSource(),
- 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
- {
- getOldSource().getAggregations().remove(getOldTarget());
- getNewSource().getAggregations().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException
- {
- getOldSource().getAggregations().remove(getOldTarget());
- getOldSource().getAggregations().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected AClass getOldSource()
- {
- return (AClass)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected AClass getNewSource()
- {
- return (AClass)newEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getOldTarget()
- {
- return (AClass)oldEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getNewTarget()
- {
- return (AClass)newEnd;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassAggregationsReorientCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public AClassAggregationsReorientCommand(ReorientReferenceRelationshipRequest request)
+ {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (false == referenceOwner instanceof AClass)
+ {
+ 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 AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAggregations_4004(getNewSource(),
+ getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget()
+ {
+ if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAggregations_4004(getOldSource(),
+ 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
+ {
+ getOldSource().getAggregations().remove(getOldTarget());
+ getNewSource().getAggregations().add(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException
+ {
+ getOldSource().getAggregations().remove(getOldTarget());
+ getOldSource().getAggregations().add(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldSource()
+ {
+ return (AClass)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewSource()
+ {
+ return (AClass)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldTarget()
+ {
+ return (AClass)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewTarget()
+ {
+ return (AClass)newEnd;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsCreateCommand.java
index 029e79b740..29ce911dfa 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsCreateCommand.java
@@ -1,118 +1,118 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.CreateRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassAssociationsCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final EObject source;
-
- /**
- * @generated
- */
- private final EObject target;
-
- /**
- * @generated
- */
- public AClassAssociationsCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
- {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (source == null && target == null)
- {
- return false;
- }
- if (source != null && false == source instanceof AClass)
- {
- return false;
- }
- if (target != null && false == target instanceof AClass)
- {
- 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
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassAssociations_4003(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$
- }
-
- if (getSource() != null && getTarget() != null)
- {
- getSource().getAssociations().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected AClass getSource()
- {
- return (AClass)source;
- }
-
- /**
- * @generated
- */
- protected AClass getTarget()
- {
- return (AClass)target;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.CreateRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassAssociationsCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public AClassAssociationsCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
+ {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (source == null && target == null)
+ {
+ return false;
+ }
+ if (source != null && false == source instanceof AClass)
+ {
+ return false;
+ }
+ if (target != null && false == target instanceof AClass)
+ {
+ 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
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassAssociations_4003(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$
+ }
+
+ if (getSource() != null && getTarget() != null)
+ {
+ getSource().getAssociations().add(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getSource()
+ {
+ return (AClass)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getTarget()
+ {
+ return (AClass)target;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsReorientCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsReorientCommand.java
index 978bba6111..b16ed5bbf3 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsReorientCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassAssociationsReorientCommand.java
@@ -1,182 +1,182 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassAssociationsReorientCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public AClassAssociationsReorientCommand(ReorientReferenceRelationshipRequest request)
- {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (false == referenceOwner instanceof AClass)
- {
- 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 AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAssociations_4003(getNewSource(),
- getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget()
- {
- if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAssociations_4003(getOldSource(),
- 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
- {
- getOldSource().getAssociations().remove(getOldTarget());
- getNewSource().getAssociations().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException
- {
- getOldSource().getAssociations().remove(getOldTarget());
- getOldSource().getAssociations().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected AClass getOldSource()
- {
- return (AClass)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected AClass getNewSource()
- {
- return (AClass)newEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getOldTarget()
- {
- return (AClass)oldEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getNewTarget()
- {
- return (AClass)newEnd;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassAssociationsReorientCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public AClassAssociationsReorientCommand(ReorientReferenceRelationshipRequest request)
+ {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (false == referenceOwner instanceof AClass)
+ {
+ 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 AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAssociations_4003(getNewSource(),
+ getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget()
+ {
+ if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassAssociations_4003(getOldSource(),
+ 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
+ {
+ getOldSource().getAssociations().remove(getOldTarget());
+ getNewSource().getAssociations().add(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException
+ {
+ getOldSource().getAssociations().remove(getOldTarget());
+ getOldSource().getAssociations().add(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldSource()
+ {
+ return (AClass)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewSource()
+ {
+ return (AClass)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldTarget()
+ {
+ return (AClass)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewTarget()
+ {
+ return (AClass)newEnd;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsCreateCommand.java
index 2c9c79131f..cf0b1983a0 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsCreateCommand.java
@@ -1,118 +1,118 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.CreateRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassCompositionsCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final EObject source;
-
- /**
- * @generated
- */
- private final EObject target;
-
- /**
- * @generated
- */
- public AClassCompositionsCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
- {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (source == null && target == null)
- {
- return false;
- }
- if (source != null && false == source instanceof AClass)
- {
- return false;
- }
- if (target != null && false == target instanceof AClass)
- {
- 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
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassCompositions_4005(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$
- }
-
- if (getSource() != null && getTarget() != null)
- {
- getSource().getCompositions().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected AClass getSource()
- {
- return (AClass)source;
- }
-
- /**
- * @generated
- */
- protected AClass getTarget()
- {
- return (AClass)target;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.CreateRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassCompositionsCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public AClassCompositionsCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
+ {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (source == null && target == null)
+ {
+ return false;
+ }
+ if (source != null && false == source instanceof AClass)
+ {
+ return false;
+ }
+ if (target != null && false == target instanceof AClass)
+ {
+ 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
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassCompositions_4005(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$
+ }
+
+ if (getSource() != null && getTarget() != null)
+ {
+ getSource().getCompositions().add(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getSource()
+ {
+ return (AClass)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getTarget()
+ {
+ return (AClass)target;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsReorientCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsReorientCommand.java
index 72ccc734b2..53afaa928e 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsReorientCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCompositionsReorientCommand.java
@@ -1,182 +1,182 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassCompositionsReorientCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public AClassCompositionsReorientCommand(ReorientReferenceRelationshipRequest request)
- {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (false == referenceOwner instanceof AClass)
- {
- 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 AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassCompositions_4005(getNewSource(),
- getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget()
- {
- if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassCompositions_4005(getOldSource(),
- 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
- {
- getOldSource().getCompositions().remove(getOldTarget());
- getNewSource().getCompositions().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException
- {
- getOldSource().getCompositions().remove(getOldTarget());
- getOldSource().getCompositions().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected AClass getOldSource()
- {
- return (AClass)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected AClass getNewSource()
- {
- return (AClass)newEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getOldTarget()
- {
- return (AClass)oldEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getNewTarget()
- {
- return (AClass)newEnd;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassCompositionsReorientCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public AClassCompositionsReorientCommand(ReorientReferenceRelationshipRequest request)
+ {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (false == referenceOwner instanceof AClass)
+ {
+ 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 AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassCompositions_4005(getNewSource(),
+ getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget()
+ {
+ if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassCompositions_4005(getOldSource(),
+ 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
+ {
+ getOldSource().getCompositions().remove(getOldTarget());
+ getNewSource().getCompositions().add(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException
+ {
+ getOldSource().getCompositions().remove(getOldTarget());
+ getOldSource().getCompositions().add(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldSource()
+ {
+ return (AClass)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewSource()
+ {
+ return (AClass)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldTarget()
+ {
+ return (AClass)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewTarget()
+ {
+ return (AClass)newEnd;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCreateCommand.java
index 40e351fa75..2c8fcd7059 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassCreateCommand.java
@@ -1,101 +1,101 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.ACoreRoot;
-import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * @generated
- */
-public class AClassCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- public AClassCreateCommand(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
- {
- AClass newElement = AcoreFactory.eINSTANCE.createAClass();
-
- ACoreRoot owner = (ACoreRoot)getElementToEdit();
- owner.getClasses().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(AClass 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);
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.ACoreRoot;
+import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+
+/**
+ * @generated
+ */
+public class AClassCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ public AClassCreateCommand(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
+ {
+ AClass newElement = AcoreFactory.eINSTANCE.createAClass();
+
+ ACoreRoot owner = (ACoreRoot)getElementToEdit();
+ owner.getClasses().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(AClass 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesCreateCommand.java
index 36b091094b..00525674db 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesCreateCommand.java
@@ -1,120 +1,120 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.AInterface;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.CreateRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassImplementedInterfacesCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final EObject source;
-
- /**
- * @generated
- */
- private final EObject target;
-
- /**
- * @generated
- */
- public AClassImplementedInterfacesCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
- {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (source == null && target == null)
- {
- return false;
- }
- if (source != null && false == source instanceof AClass)
- {
- return false;
- }
- if (target != null && false == target instanceof AInterface)
- {
- 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
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassImplementedInterfaces_4002(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$
- }
-
- if (getSource() != null && getTarget() != null)
- {
- getSource().getImplementedInterfaces().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected AClass getSource()
- {
- return (AClass)source;
- }
-
- /**
- * @generated
- */
- protected AInterface getTarget()
- {
- return (AInterface)target;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.AInterface;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.CreateRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassImplementedInterfacesCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public AClassImplementedInterfacesCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
+ {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (source == null && target == null)
+ {
+ return false;
+ }
+ if (source != null && false == source instanceof AClass)
+ {
+ return false;
+ }
+ if (target != null && false == target instanceof AInterface)
+ {
+ 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
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassImplementedInterfaces_4002(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$
+ }
+
+ if (getSource() != null && getTarget() != null)
+ {
+ getSource().getImplementedInterfaces().add(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getSource()
+ {
+ return (AClass)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected AInterface getTarget()
+ {
+ return (AInterface)target;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesReorientCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesReorientCommand.java
index bed77d2f9f..fd421e8fda 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesReorientCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassImplementedInterfacesReorientCommand.java
@@ -1,183 +1,183 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.AInterface;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassImplementedInterfacesReorientCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public AClassImplementedInterfacesReorientCommand(ReorientReferenceRelationshipRequest request)
- {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (false == referenceOwner instanceof AClass)
- {
- 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 AInterface && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassImplementedInterfaces_4002(getNewSource(),
- getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget()
- {
- if (!(oldEnd instanceof AInterface && newEnd instanceof AInterface))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassImplementedInterfaces_4002(getOldSource(),
- 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
- {
- getOldSource().getImplementedInterfaces().remove(getOldTarget());
- getNewSource().getImplementedInterfaces().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException
- {
- getOldSource().getImplementedInterfaces().remove(getOldTarget());
- getOldSource().getImplementedInterfaces().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected AClass getOldSource()
- {
- return (AClass)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected AClass getNewSource()
- {
- return (AClass)newEnd;
- }
-
- /**
- * @generated
- */
- protected AInterface getOldTarget()
- {
- return (AInterface)oldEnd;
- }
-
- /**
- * @generated
- */
- protected AInterface getNewTarget()
- {
- return (AInterface)newEnd;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.AInterface;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassImplementedInterfacesReorientCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public AClassImplementedInterfacesReorientCommand(ReorientReferenceRelationshipRequest request)
+ {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (false == referenceOwner instanceof AClass)
+ {
+ 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 AInterface && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassImplementedInterfaces_4002(getNewSource(),
+ getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget()
+ {
+ if (!(oldEnd instanceof AInterface && newEnd instanceof AInterface))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canExistAClassImplementedInterfaces_4002(getOldSource(),
+ 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
+ {
+ getOldSource().getImplementedInterfaces().remove(getOldTarget());
+ getNewSource().getImplementedInterfaces().add(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException
+ {
+ getOldSource().getImplementedInterfaces().remove(getOldTarget());
+ getOldSource().getImplementedInterfaces().add(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldSource()
+ {
+ return (AClass)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewSource()
+ {
+ return (AClass)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AInterface getOldTarget()
+ {
+ return (AInterface)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AInterface getNewTarget()
+ {
+ return (AInterface)newEnd;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesCreateCommand.java
index 8d4c3d99e1..eb2957af29 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesCreateCommand.java
@@ -1,118 +1,118 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.CreateRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassSubClassesCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final EObject source;
-
- /**
- * @generated
- */
- private final EObject target;
-
- /**
- * @generated
- */
- public AClassSubClassesCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
- {
- super(request.getLabel(), null, request);
- this.source = source;
- this.target = target;
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (source == null && target == null)
- {
- return false;
- }
- if (source != null && false == source instanceof AClass)
- {
- return false;
- }
- if (target != null && false == target instanceof AClass)
- {
- 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
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassSubClasses_4001(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$
- }
-
- if (getSource() != null && getTarget() != null)
- {
- getSource().getSubClasses().add(getTarget());
- }
- return CommandResult.newOKCommandResult();
-
- }
-
- /**
- * @generated
- */
- protected void setElementToEdit(EObject element)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * @generated
- */
- protected AClass getSource()
- {
- return (AClass)source;
- }
-
- /**
- * @generated
- */
- protected AClass getTarget()
- {
- return (AClass)target;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.CreateRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassSubClassesCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final EObject source;
+
+ /**
+ * @generated
+ */
+ private final EObject target;
+
+ /**
+ * @generated
+ */
+ public AClassSubClassesCreateCommand(CreateRelationshipRequest request, EObject source, EObject target)
+ {
+ super(request.getLabel(), null, request);
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (source == null && target == null)
+ {
+ return false;
+ }
+ if (source != null && false == source instanceof AClass)
+ {
+ return false;
+ }
+ if (target != null && false == target instanceof AClass)
+ {
+ 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
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints.canCreateAClassSubClasses_4001(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$
+ }
+
+ if (getSource() != null && getTarget() != null)
+ {
+ getSource().getSubClasses().add(getTarget());
+ }
+ return CommandResult.newOKCommandResult();
+
+ }
+
+ /**
+ * @generated
+ */
+ protected void setElementToEdit(EObject element)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getSource()
+ {
+ return (AClass)source;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getTarget()
+ {
+ return (AClass)target;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesReorientCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesReorientCommand.java
index abe92bf6ef..33f8107bfb 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesReorientCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AClassSubClassesReorientCommand.java
@@ -1,182 +1,182 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-
-/**
- * @generated
- */
-public class AClassSubClassesReorientCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject referenceOwner;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public AClassSubClassesReorientCommand(ReorientReferenceRelationshipRequest request)
- {
- super(request.getLabel(), null, request);
- reorientDirection = request.getDirection();
- referenceOwner = request.getReferenceOwner();
- oldEnd = request.getOldRelationshipEnd();
- newEnd = request.getNewRelationshipEnd();
- }
-
- /**
- * @generated
- */
- public boolean canExecute()
- {
- if (false == referenceOwner instanceof AClass)
- {
- 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 AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints
- .canExistAClassSubClasses_4001(getNewSource(), getOldTarget());
- }
-
- /**
- * @generated
- */
- protected boolean canReorientTarget()
- {
- if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
- {
- return false;
- }
- return AcoreBaseItemSemanticEditPolicy.LinkConstraints
- .canExistAClassSubClasses_4001(getOldSource(), 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
- {
- getOldSource().getSubClasses().remove(getOldTarget());
- getNewSource().getSubClasses().add(getOldTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected CommandResult reorientTarget() throws ExecutionException
- {
- getOldSource().getSubClasses().remove(getOldTarget());
- getOldSource().getSubClasses().add(getNewTarget());
- return CommandResult.newOKCommandResult(referenceOwner);
- }
-
- /**
- * @generated
- */
- protected AClass getOldSource()
- {
- return (AClass)referenceOwner;
- }
-
- /**
- * @generated
- */
- protected AClass getNewSource()
- {
- return (AClass)newEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getOldTarget()
- {
- return (AClass)oldEnd;
- }
-
- /**
- * @generated
- */
- protected AClass getNewTarget()
- {
- return (AClass)newEnd;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.AClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreBaseItemSemanticEditPolicy;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+
+/**
+ * @generated
+ */
+public class AClassSubClassesReorientCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ private final int reorientDirection;
+
+ /**
+ * @generated
+ */
+ private final EObject referenceOwner;
+
+ /**
+ * @generated
+ */
+ private final EObject oldEnd;
+
+ /**
+ * @generated
+ */
+ private final EObject newEnd;
+
+ /**
+ * @generated
+ */
+ public AClassSubClassesReorientCommand(ReorientReferenceRelationshipRequest request)
+ {
+ super(request.getLabel(), null, request);
+ reorientDirection = request.getDirection();
+ referenceOwner = request.getReferenceOwner();
+ oldEnd = request.getOldRelationshipEnd();
+ newEnd = request.getNewRelationshipEnd();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute()
+ {
+ if (false == referenceOwner instanceof AClass)
+ {
+ 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 AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints
+ .canExistAClassSubClasses_4001(getNewSource(), getOldTarget());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean canReorientTarget()
+ {
+ if (!(oldEnd instanceof AClass && newEnd instanceof AClass))
+ {
+ return false;
+ }
+ return AcoreBaseItemSemanticEditPolicy.LinkConstraints
+ .canExistAClassSubClasses_4001(getOldSource(), 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
+ {
+ getOldSource().getSubClasses().remove(getOldTarget());
+ getNewSource().getSubClasses().add(getOldTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult reorientTarget() throws ExecutionException
+ {
+ getOldSource().getSubClasses().remove(getOldTarget());
+ getOldSource().getSubClasses().add(getNewTarget());
+ return CommandResult.newOKCommandResult(referenceOwner);
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldSource()
+ {
+ return (AClass)referenceOwner;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewSource()
+ {
+ return (AClass)newEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getOldTarget()
+ {
+ return (AClass)oldEnd;
+ }
+
+ /**
+ * @generated
+ */
+ protected AClass getNewTarget()
+ {
+ return (AClass)newEnd;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AInterfaceCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AInterfaceCreateCommand.java
index e1b3526947..3c84685886 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AInterfaceCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AInterfaceCreateCommand.java
@@ -1,102 +1,102 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.ACoreRoot;
-import org.eclipse.emf.cdo.dawn.examples.acore.AInterface;
-import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * @generated
- */
-public class AInterfaceCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- public AInterfaceCreateCommand(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
- {
- AInterface newElement = AcoreFactory.eINSTANCE.createAInterface();
-
- ACoreRoot owner = (ACoreRoot)getElementToEdit();
- owner.getInterfaces().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(AInterface 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);
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.ACoreRoot;
+import org.eclipse.emf.cdo.dawn.examples.acore.AInterface;
+import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+
+/**
+ * @generated
+ */
+public class AInterfaceCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ public AInterfaceCreateCommand(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
+ {
+ AInterface newElement = AcoreFactory.eINSTANCE.createAInterface();
+
+ ACoreRoot owner = (ACoreRoot)getElementToEdit();
+ owner.getInterfaces().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(AInterface 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperation2CreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperation2CreateCommand.java
index 013bcdea73..098ad999fa 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperation2CreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperation2CreateCommand.java
@@ -1,102 +1,102 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.AOperation;
-import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * @generated
- */
-public class AOperation2CreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- public AOperation2CreateCommand(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
- {
- AOperation newElement = AcoreFactory.eINSTANCE.createAOperation();
-
- ABasicClass owner = (ABasicClass)getElementToEdit();
- owner.getOperations().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(AOperation 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);
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.AOperation;
+import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+
+/**
+ * @generated
+ */
+public class AOperation2CreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ public AOperation2CreateCommand(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
+ {
+ AOperation newElement = AcoreFactory.eINSTANCE.createAOperation();
+
+ ABasicClass owner = (ABasicClass)getElementToEdit();
+ owner.getOperations().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(AOperation 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperationCreateCommand.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperationCreateCommand.java
index 11ae81aabc..574ca8f173 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperationCreateCommand.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/commands/AOperationCreateCommand.java
@@ -1,102 +1,102 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
-import org.eclipse.emf.cdo.dawn.examples.acore.AOperation;
-import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * @generated
- */
-public class AOperationCreateCommand extends EditElementCommand
-{
-
- /**
- * @generated
- */
- public AOperationCreateCommand(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
- {
- AOperation newElement = AcoreFactory.eINSTANCE.createAOperation();
-
- ABasicClass owner = (ABasicClass)getElementToEdit();
- owner.getOperations().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(AOperation 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);
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.commands;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.ABasicClass;
+import org.eclipse.emf.cdo.dawn.examples.acore.AOperation;
+import org.eclipse.emf.cdo.dawn.examples.acore.AcoreFactory;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+
+/**
+ * @generated
+ */
+public class AOperationCreateCommand extends EditElementCommand
+{
+
+ /**
+ * @generated
+ */
+ public AOperationCreateCommand(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
+ {
+ AOperation newElement = AcoreFactory.eINSTANCE.createAOperation();
+
+ ABasicClass owner = (ABasicClass)getElementToEdit();
+ owner.getOperations().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(AOperation 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AAttributeEditHelper.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AAttributeEditHelper.java
index 3a5875f45c..4fb3483349 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AAttributeEditHelper.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AAttributeEditHelper.java
@@ -1,19 +1,19 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
-
-/**
- * @generated
- */
-public class AAttributeEditHelper extends AcoreBaseEditHelper
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class AAttributeEditHelper extends AcoreBaseEditHelper
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AClassEditHelper.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AClassEditHelper.java
index 4d0f978a6e..178d40abc3 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AClassEditHelper.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AClassEditHelper.java
@@ -1,19 +1,19 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
-
-/**
- * @generated
- */
-public class AClassEditHelper extends AcoreBaseEditHelper
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class AClassEditHelper extends AcoreBaseEditHelper
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/ACoreRootEditHelper.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/ACoreRootEditHelper.java
index 4d743c1604..029f8a294f 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/ACoreRootEditHelper.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/ACoreRootEditHelper.java
@@ -1,19 +1,19 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
-
-/**
- * @generated
- */
-public class ACoreRootEditHelper extends AcoreBaseEditHelper
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class ACoreRootEditHelper extends AcoreBaseEditHelper
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AInterfaceEditHelper.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AInterfaceEditHelper.java
index 458de9b7fa..520b655de1 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AInterfaceEditHelper.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AInterfaceEditHelper.java
@@ -1,19 +1,19 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
-
-/**
- * @generated
- */
-public class AInterfaceEditHelper extends AcoreBaseEditHelper
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class AInterfaceEditHelper extends AcoreBaseEditHelper
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AOperationEditHelper.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AOperationEditHelper.java
index c09604c7e0..d9f8c9b9ad 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AOperationEditHelper.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AOperationEditHelper.java
@@ -1,19 +1,19 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
-
-/**
- * @generated
- */
-public class AOperationEditHelper extends AcoreBaseEditHelper
-{
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class AOperationEditHelper extends AcoreBaseEditHelper
+{
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AcoreBaseEditHelper.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AcoreBaseEditHelper.java
index 7f6c6c8f5b..38c541a880 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AcoreBaseEditHelper.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/helpers/AcoreBaseEditHelper.java
@@ -1,108 +1,108 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
-
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-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.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-/**
- * @generated
- */
-public class AcoreBaseEditHelper extends AbstractEditHelper
-{
-
- /**
- * @generated
- */
- public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ELEMENT_TYPE = "context element type"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req)
- {
- if (req.getParameter(CONTEXT_ELEMENT_TYPE) instanceof IElementType)
- {
- return ElementTypeRegistry.getInstance()
- .getEditHelperAdvice((IElementType)req.getParameter(CONTEXT_ELEMENT_TYPE));
- }
- return super.getEditHelperAdvice(req);
- }
-
- /**
- * @generated
- */
- protected ICommand getInsteadCommand(IEditCommandRequest req)
- {
- ICommand epCommand = (ICommand)req.getParameter(EDIT_POLICY_COMMAND);
- req.setParameter(EDIT_POLICY_COMMAND, null);
- ICommand ehCommand = super.getInsteadCommand(req);
- if (epCommand == null)
- {
- return ehCommand;
- }
- if (ehCommand == null)
- {
- return epCommand;
- }
- CompositeCommand command = new CompositeCommand(null);
- command.add(epCommand);
- command.add(ehCommand);
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateCommand(CreateElementRequest req)
- {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req)
- {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyElementCommand(DestroyElementRequest req)
- {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req)
- {
- return null;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.helpers;
+
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+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.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+
+/**
+ * @generated
+ */
+public class AcoreBaseEditHelper extends AbstractEditHelper
+{
+
+ /**
+ * @generated
+ */
+ public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final String CONTEXT_ELEMENT_TYPE = "context element type"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req)
+ {
+ if (req.getParameter(CONTEXT_ELEMENT_TYPE) instanceof IElementType)
+ {
+ return ElementTypeRegistry.getInstance()
+ .getEditHelperAdvice((IElementType)req.getParameter(CONTEXT_ELEMENT_TYPE));
+ }
+ return super.getEditHelperAdvice(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getInsteadCommand(IEditCommandRequest req)
+ {
+ ICommand epCommand = (ICommand)req.getParameter(EDIT_POLICY_COMMAND);
+ req.setParameter(EDIT_POLICY_COMMAND, null);
+ ICommand ehCommand = super.getInsteadCommand(req);
+ if (epCommand == null)
+ {
+ return ehCommand;
+ }
+ if (ehCommand == null)
+ {
+ return epCommand;
+ }
+ CompositeCommand command = new CompositeCommand(null);
+ command.add(epCommand);
+ command.add(ehCommand);
+ return command;
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getCreateCommand(CreateElementRequest req)
+ {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req)
+ {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getDestroyElementCommand(DestroyElementRequest req)
+ {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req)
+ {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttribute2EditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttribute2EditPart.java
index 00a7190eb0..5efa0b8025 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttribute2EditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttribute2EditPart.java
@@ -1,684 +1,684 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AAttribute2ItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RunnableWithResult;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.SelectionRequest;
-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.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-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.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;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @generated
- */
-public class AAttribute2EditPart extends CompartmentEditPart implements ITextAwareEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3003;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * @generated
- */
- public AAttribute2EditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- public DragTracker getDragTracker(Request request)
- {
- if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
- {
- return null;
- }
- return new DragEditPartsTrackerEx(this);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AAttribute2ItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getText();
- }
- else
- {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setText(text);
- }
- else
- {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getIcon();
- }
- else
- {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setIcon(icon);
- }
- else
- {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure)
- {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- 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()
- {
- return null;
- }
-
- /**
- * @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);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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()
- {
-
- 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 = AcoreParserProvider.getParser(AcoreElementTypes.AAttribute_3003, getParserElement(),
- AcoreVisualIDRegistry
- .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AAttribute2EditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager()
- {
- if (manager == null)
- {
- setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
- AcoreEditPartFactory.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() == TextDirectEditManager.class)
- {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter)
- {
- if (getManager() instanceof TextDirectEditManager)
- {
- ((TextDirectEditManager)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());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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
- */
- 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
- */
- 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()
- {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim()
- {
- return new WrappingLabel();
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AAttribute2ItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RunnableWithResult;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+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.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+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.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;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @generated
+ */
+public class AAttribute2EditPart extends CompartmentEditPart implements ITextAwareEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3003;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+ /**
+ * @generated
+ */
+ public AAttribute2EditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ public DragTracker getDragTracker(Request request)
+ {
+ if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
+ {
+ return null;
+ }
+ return new DragEditPartsTrackerEx(this);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AAttribute2ItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getText();
+ }
+ else
+ {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setText(text);
+ }
+ else
+ {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getIcon();
+ }
+ else
+ {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setIcon(icon);
+ }
+ else
+ {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure)
+ {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ 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()
+ {
+ return null;
+ }
+
+ /**
+ * @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);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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()
+ {
+
+ 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 = AcoreParserProvider.getParser(AcoreElementTypes.AAttribute_3003, getParserElement(),
+ AcoreVisualIDRegistry
+ .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AAttribute2EditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager()
+ {
+ if (manager == null)
+ {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
+ AcoreEditPartFactory.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() == TextDirectEditManager.class)
+ {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter)
+ {
+ if (getManager() instanceof TextDirectEditManager)
+ {
+ ((TextDirectEditManager)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());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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
+ */
+ 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
+ */
+ 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()
+ {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim()
+ {
+ return new WrappingLabel();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttributeEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttributeEditPart.java
index a1e62535a9..18c8876534 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttributeEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AAttributeEditPart.java
@@ -1,684 +1,684 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AAttributeItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RunnableWithResult;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.SelectionRequest;
-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.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-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.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;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @generated
- */
-public class AAttributeEditPart extends CompartmentEditPart implements ITextAwareEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3001;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * @generated
- */
- public AAttributeEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- public DragTracker getDragTracker(Request request)
- {
- if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
- {
- return null;
- }
- return new DragEditPartsTrackerEx(this);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AAttributeItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getText();
- }
- else
- {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setText(text);
- }
- else
- {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getIcon();
- }
- else
- {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setIcon(icon);
- }
- else
- {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure)
- {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- 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()
- {
- return null;
- }
-
- /**
- * @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);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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()
- {
-
- 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 = AcoreParserProvider.getParser(AcoreElementTypes.AAttribute_3001, getParserElement(),
- AcoreVisualIDRegistry
- .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AAttributeEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager()
- {
- if (manager == null)
- {
- setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
- AcoreEditPartFactory.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() == TextDirectEditManager.class)
- {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter)
- {
- if (getManager() instanceof TextDirectEditManager)
- {
- ((TextDirectEditManager)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());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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
- */
- 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
- */
- 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()
- {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim()
- {
- return new WrappingLabel();
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AAttributeItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RunnableWithResult;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+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.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+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.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;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @generated
+ */
+public class AAttributeEditPart extends CompartmentEditPart implements ITextAwareEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3001;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+ /**
+ * @generated
+ */
+ public AAttributeEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ public DragTracker getDragTracker(Request request)
+ {
+ if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
+ {
+ return null;
+ }
+ return new DragEditPartsTrackerEx(this);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AAttributeItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getText();
+ }
+ else
+ {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setText(text);
+ }
+ else
+ {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getIcon();
+ }
+ else
+ {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setIcon(icon);
+ }
+ else
+ {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure)
+ {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ 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()
+ {
+ return null;
+ }
+
+ /**
+ * @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);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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()
+ {
+
+ 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 = AcoreParserProvider.getParser(AcoreElementTypes.AAttribute_3001, getParserElement(),
+ AcoreVisualIDRegistry
+ .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AAttributeEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager()
+ {
+ if (manager == null)
+ {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
+ AcoreEditPartFactory.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() == TextDirectEditManager.class)
+ {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter)
+ {
+ if (getManager() instanceof TextDirectEditManager)
+ {
+ ((TextDirectEditManager)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());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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
+ */
+ 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
+ */
+ 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()
+ {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim()
+ {
+ return new WrappingLabel();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAAttributeCompartmentEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAAttributeCompartmentEditPart.java
index e3c72b0585..d6296a1592 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAAttributeCompartmentEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAAttributeCompartmentEditPart.java
@@ -1,94 +1,94 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAAttributeCompartmentCanonicalEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAAttributeCompartmentItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class AClassAAttributeCompartmentEditPart extends ListCompartmentEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7003;
-
- /**
- * @generated
- */
- public AClassAAttributeCompartmentEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected boolean hasModelChildrenChanged(Notification evt)
- {
- return false;
- }
-
- /**
- * @generated
- */
- public String getCompartmentName()
- {
- return Messages.AClassAAttributeCompartmentEditPart_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 AClassAAttributeCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AClassAAttributeCompartmentCanonicalEditPolicy());
- }
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio)
- {
- // nothing to do -- parent layout does not accept Double constraints as ratio
- // super.setRatio(ratio);
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAAttributeCompartmentCanonicalEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAAttributeCompartmentItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class AClassAAttributeCompartmentEditPart extends ListCompartmentEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 7003;
+
+ /**
+ * @generated
+ */
+ public AClassAAttributeCompartmentEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean hasModelChildrenChanged(Notification evt)
+ {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public String getCompartmentName()
+ {
+ return Messages.AClassAAttributeCompartmentEditPart_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 AClassAAttributeCompartmentItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+ installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AClassAAttributeCompartmentCanonicalEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected void setRatio(Double ratio)
+ {
+ // nothing to do -- parent layout does not accept Double constraints as ratio
+ // super.setRatio(ratio);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAOperationClassCompartmentEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAOperationClassCompartmentEditPart.java
index f0834ad306..30ba4f2546 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAOperationClassCompartmentEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAOperationClassCompartmentEditPart.java
@@ -1,94 +1,94 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAOperationClassCompartmentCanonicalEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAOperationClassCompartmentItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class AClassAOperationClassCompartmentEditPart extends ListCompartmentEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7004;
-
- /**
- * @generated
- */
- public AClassAOperationClassCompartmentEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected boolean hasModelChildrenChanged(Notification evt)
- {
- return false;
- }
-
- /**
- * @generated
- */
- public String getCompartmentName()
- {
- return Messages.AClassAOperationClassCompartmentEditPart_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 AClassAOperationClassCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AClassAOperationClassCompartmentCanonicalEditPolicy());
- }
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio)
- {
- // nothing to do -- parent layout does not accept Double constraints as ratio
- // super.setRatio(ratio);
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAOperationClassCompartmentCanonicalEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAOperationClassCompartmentItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class AClassAOperationClassCompartmentEditPart extends ListCompartmentEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 7004;
+
+ /**
+ * @generated
+ */
+ public AClassAOperationClassCompartmentEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean hasModelChildrenChanged(Notification evt)
+ {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public String getCompartmentName()
+ {
+ return Messages.AClassAOperationClassCompartmentEditPart_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 AClassAOperationClassCompartmentItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+ installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AClassAOperationClassCompartmentCanonicalEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected void setRatio(Double ratio)
+ {
+ // nothing to do -- parent layout does not accept Double constraints as ratio
+ // super.setRatio(ratio);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAggregationsEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAggregationsEditPart.java
index e653c4ab8e..61ed40ebe7 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAggregationsEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAggregationsEditPart.java
@@ -1,118 +1,118 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAggregationsItemSemanticEditPolicy;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.RotatableDecoration;
-import org.eclipse.draw2d.geometry.PointList;
-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.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class AClassAggregationsEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4004;
-
- /**
- * @generated
- */
- public AClassAggregationsEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassAggregationsItemSemanticEditPolicy());
- }
-
- /**
- * 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 Connection createConnectionFigure()
- {
- return new AClassAggregationClassesFigure();
- }
-
- /**
- * @generated
- */
- public AClassAggregationClassesFigure getPrimaryShape()
- {
- return (AClassAggregationClassesFigure)getFigure();
- }
-
- /**
- * @generated
- */
- public class AClassAggregationClassesFigure extends PolylineConnectionEx
- {
-
- /**
- * @generated
- */
- public AClassAggregationClassesFigure()
- {
- this.setLineWidth(1);
-
- setTargetDecoration(createTargetDecoration());
- }
-
- /**
- * @generated
- */
- private RotatableDecoration createTargetDecoration()
- {
- PolygonDecoration df = new PolygonDecoration();
- df.setFill(true);
- df.setLineWidth(1);
- df.setBackgroundColor(DF_BACK);
- PointList pl = new PointList();
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
- pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
- pl.addPoint(getMapMode().DPtoLP(-4), getMapMode().DPtoLP(0));
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
- df.setTemplate(pl);
- df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
- return df;
- }
-
- }
-
- /**
- * @generated
- */
- static final Color DF_BACK = new Color(null, 255, 255, 255);
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAggregationsItemSemanticEditPolicy;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+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.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class AClassAggregationsEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4004;
+
+ /**
+ * @generated
+ */
+ public AClassAggregationsEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassAggregationsItemSemanticEditPolicy());
+ }
+
+ /**
+ * 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 Connection createConnectionFigure()
+ {
+ return new AClassAggregationClassesFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public AClassAggregationClassesFigure getPrimaryShape()
+ {
+ return (AClassAggregationClassesFigure)getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class AClassAggregationClassesFigure extends PolylineConnectionEx
+ {
+
+ /**
+ * @generated
+ */
+ public AClassAggregationClassesFigure()
+ {
+ this.setLineWidth(1);
+
+ setTargetDecoration(createTargetDecoration());
+ }
+
+ /**
+ * @generated
+ */
+ private RotatableDecoration createTargetDecoration()
+ {
+ PolygonDecoration df = new PolygonDecoration();
+ df.setFill(true);
+ df.setLineWidth(1);
+ df.setBackgroundColor(DF_BACK);
+ PointList pl = new PointList();
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
+ pl.addPoint(getMapMode().DPtoLP(-4), getMapMode().DPtoLP(0));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ df.setTemplate(pl);
+ df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
+ return df;
+ }
+
+ }
+
+ /**
+ * @generated
+ */
+ static final Color DF_BACK = new Color(null, 255, 255, 255);
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAssociationsEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAssociationsEditPart.java
index 60be995495..fee580220e 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAssociationsEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassAssociationsEditPart.java
@@ -1,70 +1,70 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAssociationsItemSemanticEditPolicy;
-
-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;
-
-/**
- * @generated
- */
-public class AClassAssociationsEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4003;
-
- /**
- * @generated
- */
- public AClassAssociationsEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassAssociationsItemSemanticEditPolicy());
- }
-
- /**
- * 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 Connection createConnectionFigure()
- {
- return new PolylineConnectionEx();
- }
-
- /**
- * @generated
- */
- public PolylineConnectionEx getPrimaryShape()
- {
- return (PolylineConnectionEx)getFigure();
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassAssociationsItemSemanticEditPolicy;
+
+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;
+
+/**
+ * @generated
+ */
+public class AClassAssociationsEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4003;
+
+ /**
+ * @generated
+ */
+ public AClassAssociationsEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassAssociationsItemSemanticEditPolicy());
+ }
+
+ /**
+ * 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 Connection createConnectionFigure()
+ {
+ return new PolylineConnectionEx();
+ }
+
+ /**
+ * @generated
+ */
+ public PolylineConnectionEx getPrimaryShape()
+ {
+ return (PolylineConnectionEx)getFigure();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassCompositionsEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassCompositionsEditPart.java
index 35ce2cbbfb..1a45bcf342 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassCompositionsEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassCompositionsEditPart.java
@@ -1,118 +1,118 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassCompositionsItemSemanticEditPolicy;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.RotatableDecoration;
-import org.eclipse.draw2d.geometry.PointList;
-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.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class AClassCompositionsEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4005;
-
- /**
- * @generated
- */
- public AClassCompositionsEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassCompositionsItemSemanticEditPolicy());
- }
-
- /**
- * 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 Connection createConnectionFigure()
- {
- return new AClassCompositionClassesFigure();
- }
-
- /**
- * @generated
- */
- public AClassCompositionClassesFigure getPrimaryShape()
- {
- return (AClassCompositionClassesFigure)getFigure();
- }
-
- /**
- * @generated
- */
- public class AClassCompositionClassesFigure extends PolylineConnectionEx
- {
-
- /**
- * @generated
- */
- public AClassCompositionClassesFigure()
- {
- this.setLineWidth(1);
-
- setTargetDecoration(createTargetDecoration());
- }
-
- /**
- * @generated
- */
- private RotatableDecoration createTargetDecoration()
- {
- PolygonDecoration df = new PolygonDecoration();
- df.setFill(true);
- df.setLineWidth(1);
- df.setBackgroundColor(DF_BACK);
- PointList pl = new PointList();
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
- pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
- pl.addPoint(getMapMode().DPtoLP(-4), getMapMode().DPtoLP(0));
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
- df.setTemplate(pl);
- df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
- return df;
- }
-
- }
-
- /**
- * @generated
- */
- static final Color DF_BACK = new Color(null, 0, 0, 0);
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassCompositionsItemSemanticEditPolicy;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+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.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class AClassCompositionsEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4005;
+
+ /**
+ * @generated
+ */
+ public AClassCompositionsEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassCompositionsItemSemanticEditPolicy());
+ }
+
+ /**
+ * 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 Connection createConnectionFigure()
+ {
+ return new AClassCompositionClassesFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public AClassCompositionClassesFigure getPrimaryShape()
+ {
+ return (AClassCompositionClassesFigure)getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class AClassCompositionClassesFigure extends PolylineConnectionEx
+ {
+
+ /**
+ * @generated
+ */
+ public AClassCompositionClassesFigure()
+ {
+ this.setLineWidth(1);
+
+ setTargetDecoration(createTargetDecoration());
+ }
+
+ /**
+ * @generated
+ */
+ private RotatableDecoration createTargetDecoration()
+ {
+ PolygonDecoration df = new PolygonDecoration();
+ df.setFill(true);
+ df.setLineWidth(1);
+ df.setBackgroundColor(DF_BACK);
+ PointList pl = new PointList();
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
+ pl.addPoint(getMapMode().DPtoLP(-4), getMapMode().DPtoLP(0));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ df.setTemplate(pl);
+ df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
+ return df;
+ }
+
+ }
+
+ /**
+ * @generated
+ */
+ static final Color DF_BACK = new Color(null, 0, 0, 0);
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassEditPart.java
index f89f752bf4..2a8a510fcd 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassEditPart.java
@@ -1,582 +1,582 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
-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.ShapeNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-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.swt.graphics.Color;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * @generated
- */
-public class AClassEditPart extends ShapeNodeEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2002;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public AClassEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassItemSemanticEditPolicy());
- 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)
- {
- if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null)
- {
- if (child instanceof ITextAwareEditPart)
- {
- return new AcoreTextSelectionEditPolicy();
- }
- }
- return super.createChildEditPolicy(child);
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape()
- {
- AClassFigure figure = new AClassFigure();
- return primaryShape = figure;
- }
-
- /**
- * @generated
- */
- public AClassFigure getPrimaryShape()
- {
- return (AClassFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart)
- {
- if (childEditPart instanceof AClassNameEditPart)
- {
- ((AClassNameEditPart)childEditPart).setLabel(getPrimaryShape().getFigureAClassNameFigure());
- return true;
- }
- if (childEditPart instanceof AClassAAttributeCompartmentEditPart)
- {
- IFigure pane = getPrimaryShape().getFigureClassAttributes();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((AClassAAttributeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- if (childEditPart instanceof AClassAOperationClassCompartmentEditPart)
- {
- IFigure pane = getPrimaryShape().getFigureClassOperations();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.add(((AClassAOperationClassCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart)
- {
- if (childEditPart instanceof AClassNameEditPart)
- {
- return true;
- }
- if (childEditPart instanceof AClassAAttributeCompartmentEditPart)
- {
- IFigure pane = getPrimaryShape().getFigureClassAttributes();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((AClassAAttributeCompartmentEditPart)childEditPart).getFigure());
- return true;
- }
- if (childEditPart instanceof AClassAOperationClassCompartmentEditPart)
- {
- IFigure pane = getPrimaryShape().getFigureClassOperations();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
- pane.remove(((AClassAOperationClassCompartmentEditPart)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 AClassAAttributeCompartmentEditPart)
- {
- return getPrimaryShape().getFigureClassAttributes();
- }
- if (editPart instanceof AClassAOperationClassCompartmentEditPart)
- {
- return getPrimaryShape().getFigureClassOperations();
- }
- 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 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)
- {
- 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(AcoreVisualIDRegistry.getType(AClassNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource()
- {
- ArrayList<IElementType> types = new ArrayList<IElementType>(5);
- types.add(AcoreElementTypes.AClassSubClasses_4001);
- types.add(AcoreElementTypes.AClassImplementedInterfaces_4002);
- types.add(AcoreElementTypes.AClassAssociations_4003);
- types.add(AcoreElementTypes.AClassAggregations_4004);
- types.add(AcoreElementTypes.AClassCompositions_4005);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart)
- {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
- {
- types.add(AcoreElementTypes.AClassSubClasses_4001);
- }
- if (targetEditPart instanceof AInterfaceEditPart)
- {
- types.add(AcoreElementTypes.AClassImplementedInterfaces_4002);
- }
- if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
- {
- types.add(AcoreElementTypes.AClassAssociations_4003);
- }
- if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
- {
- types.add(AcoreElementTypes.AClassAggregations_4004);
- }
- if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
- {
- types.add(AcoreElementTypes.AClassCompositions_4005);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType)
- {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == AcoreElementTypes.AClassSubClasses_4001)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- else if (relationshipType == AcoreElementTypes.AClassImplementedInterfaces_4002)
- {
- types.add(AcoreElementTypes.AInterface_2001);
- }
- else if (relationshipType == AcoreElementTypes.AClassAssociations_4003)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- else if (relationshipType == AcoreElementTypes.AClassAggregations_4004)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- else if (relationshipType == AcoreElementTypes.AClassCompositions_4005)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget()
- {
- ArrayList<IElementType> types = new ArrayList<IElementType>(4);
- types.add(AcoreElementTypes.AClassSubClasses_4001);
- types.add(AcoreElementTypes.AClassAssociations_4003);
- types.add(AcoreElementTypes.AClassAggregations_4004);
- types.add(AcoreElementTypes.AClassCompositions_4005);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType)
- {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if (relationshipType == AcoreElementTypes.AClassSubClasses_4001)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- else if (relationshipType == AcoreElementTypes.AClassAssociations_4003)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- else if (relationshipType == AcoreElementTypes.AClassAggregations_4004)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- else if (relationshipType == AcoreElementTypes.AClassCompositions_4005)
- {
- types.add(AcoreElementTypes.AClass_2002);
- }
- return types;
- }
-
- /**
- * @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 == AcoreElementTypes.AAttribute_3003)
- {
- return getChildBySemanticHint(AcoreVisualIDRegistry.getType(AClassAAttributeCompartmentEditPart.VISUAL_ID));
- }
- if (type == AcoreElementTypes.AOperation_3004)
- {
- return getChildBySemanticHint(AcoreVisualIDRegistry.getType(AClassAOperationClassCompartmentEditPart.VISUAL_ID));
- }
- }
- return super.getTargetEditPart(request);
- }
-
- /**
- * @generated
- */
- public class AClassFigure extends RectangleFigure
- {
-
- /**
- * @generated
- */
- private RectangleFigure fFigureClassAttributes;
-
- /**
- * @generated
- */
- private WrappingLabel fFigureAClassNameFigure;
-
- /**
- * @generated
- */
- private RectangleFigure fFigureClassOperations;
-
- /**
- * @generated
- */
- public AClassFigure()
- {
-
- ToolbarLayout layoutThis = new ToolbarLayout();
- layoutThis.setStretchMinorAxis(true);
- layoutThis.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
-
- layoutThis.setSpacing(0);
- layoutThis.setVertical(true);
-
- this.setLayoutManager(layoutThis);
-
- this.setLineWidth(1);
- this.setBackgroundColor(THIS_BACK);
- createContents();
- }
-
- /**
- * @generated
- */
- private void createContents()
- {
-
- fFigureAClassNameFigure = new WrappingLabel();
- fFigureAClassNameFigure.setText("<...>");
-
- this.add(fFigureAClassNameFigure);
-
- fFigureClassAttributes = new RectangleFigure();
- fFigureClassAttributes.setLineWidth(1);
-
- this.add(fFigureClassAttributes);
- fFigureClassAttributes.setLayoutManager(new StackLayout());
-
- fFigureClassOperations = new RectangleFigure();
- fFigureClassOperations.setLineWidth(1);
-
- this.add(fFigureClassOperations);
- fFigureClassOperations.setLayoutManager(new StackLayout());
-
- }
-
- /**
- * @generated
- */
- private boolean myUseLocalCoordinates = false;
-
- /**
- * @generated
- */
- protected boolean useLocalCoordinates()
- {
- return myUseLocalCoordinates;
- }
-
- /**
- * @generated
- */
- protected void setUseLocalCoordinates(boolean useLocalCoordinates)
- {
- myUseLocalCoordinates = useLocalCoordinates;
- }
-
- /**
- * @generated
- */
- public RectangleFigure getFigureClassAttributes()
- {
- return fFigureClassAttributes;
- }
-
- /**
- * @generated
- */
- public WrappingLabel getFigureAClassNameFigure()
- {
- return fFigureAClassNameFigure;
- }
-
- /**
- * @generated
- */
- public RectangleFigure getFigureClassOperations()
- {
- return fFigureClassOperations;
- }
-
- }
-
- /**
- * @generated
- */
- static final Color THIS_BACK = new Color(null, 230, 230, 255);
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+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.ShapeNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConstrainedToolbarLayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+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.swt.graphics.Color;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @generated
+ */
+public class AClassEditPart extends ShapeNodeEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 2002;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public AClassEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassItemSemanticEditPolicy());
+ 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)
+ {
+ if (child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE) == null)
+ {
+ if (child instanceof ITextAwareEditPart)
+ {
+ return new AcoreTextSelectionEditPolicy();
+ }
+ }
+ return super.createChildEditPolicy(child);
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createNodeShape()
+ {
+ AClassFigure figure = new AClassFigure();
+ return primaryShape = figure;
+ }
+
+ /**
+ * @generated
+ */
+ public AClassFigure getPrimaryShape()
+ {
+ return (AClassFigure)primaryShape;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean addFixedChild(EditPart childEditPart)
+ {
+ if (childEditPart instanceof AClassNameEditPart)
+ {
+ ((AClassNameEditPart)childEditPart).setLabel(getPrimaryShape().getFigureAClassNameFigure());
+ return true;
+ }
+ if (childEditPart instanceof AClassAAttributeCompartmentEditPart)
+ {
+ IFigure pane = getPrimaryShape().getFigureClassAttributes();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((AClassAAttributeCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if (childEditPart instanceof AClassAOperationClassCompartmentEditPart)
+ {
+ IFigure pane = getPrimaryShape().getFigureClassOperations();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((AClassAOperationClassCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart)
+ {
+ if (childEditPart instanceof AClassNameEditPart)
+ {
+ return true;
+ }
+ if (childEditPart instanceof AClassAAttributeCompartmentEditPart)
+ {
+ IFigure pane = getPrimaryShape().getFigureClassAttributes();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((AClassAAttributeCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if (childEditPart instanceof AClassAOperationClassCompartmentEditPart)
+ {
+ IFigure pane = getPrimaryShape().getFigureClassOperations();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((AClassAOperationClassCompartmentEditPart)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 AClassAAttributeCompartmentEditPart)
+ {
+ return getPrimaryShape().getFigureClassAttributes();
+ }
+ if (editPart instanceof AClassAOperationClassCompartmentEditPart)
+ {
+ return getPrimaryShape().getFigureClassOperations();
+ }
+ 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 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)
+ {
+ 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(AcoreVisualIDRegistry.getType(AClassNameEditPart.VISUAL_ID));
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> getMARelTypesOnSource()
+ {
+ ArrayList<IElementType> types = new ArrayList<IElementType>(5);
+ types.add(AcoreElementTypes.AClassSubClasses_4001);
+ types.add(AcoreElementTypes.AClassImplementedInterfaces_4002);
+ types.add(AcoreElementTypes.AClassAssociations_4003);
+ types.add(AcoreElementTypes.AClassAggregations_4004);
+ types.add(AcoreElementTypes.AClassCompositions_4005);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart)
+ {
+ LinkedList<IElementType> types = new LinkedList<IElementType>();
+ if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
+ {
+ types.add(AcoreElementTypes.AClassSubClasses_4001);
+ }
+ if (targetEditPart instanceof AInterfaceEditPart)
+ {
+ types.add(AcoreElementTypes.AClassImplementedInterfaces_4002);
+ }
+ if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
+ {
+ types.add(AcoreElementTypes.AClassAssociations_4003);
+ }
+ if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
+ {
+ types.add(AcoreElementTypes.AClassAggregations_4004);
+ }
+ if (targetEditPart instanceof org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassEditPart)
+ {
+ types.add(AcoreElementTypes.AClassCompositions_4005);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> getMATypesForTarget(IElementType relationshipType)
+ {
+ LinkedList<IElementType> types = new LinkedList<IElementType>();
+ if (relationshipType == AcoreElementTypes.AClassSubClasses_4001)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ else if (relationshipType == AcoreElementTypes.AClassImplementedInterfaces_4002)
+ {
+ types.add(AcoreElementTypes.AInterface_2001);
+ }
+ else if (relationshipType == AcoreElementTypes.AClassAssociations_4003)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ else if (relationshipType == AcoreElementTypes.AClassAggregations_4004)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ else if (relationshipType == AcoreElementTypes.AClassCompositions_4005)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> getMARelTypesOnTarget()
+ {
+ ArrayList<IElementType> types = new ArrayList<IElementType>(4);
+ types.add(AcoreElementTypes.AClassSubClasses_4001);
+ types.add(AcoreElementTypes.AClassAssociations_4003);
+ types.add(AcoreElementTypes.AClassAggregations_4004);
+ types.add(AcoreElementTypes.AClassCompositions_4005);
+ return types;
+ }
+
+ /**
+ * @generated
+ */
+ public List<IElementType> getMATypesForSource(IElementType relationshipType)
+ {
+ LinkedList<IElementType> types = new LinkedList<IElementType>();
+ if (relationshipType == AcoreElementTypes.AClassSubClasses_4001)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ else if (relationshipType == AcoreElementTypes.AClassAssociations_4003)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ else if (relationshipType == AcoreElementTypes.AClassAggregations_4004)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ else if (relationshipType == AcoreElementTypes.AClassCompositions_4005)
+ {
+ types.add(AcoreElementTypes.AClass_2002);
+ }
+ return types;
+ }
+
+ /**
+ * @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 == AcoreElementTypes.AAttribute_3003)
+ {
+ return getChildBySemanticHint(AcoreVisualIDRegistry.getType(AClassAAttributeCompartmentEditPart.VISUAL_ID));
+ }
+ if (type == AcoreElementTypes.AOperation_3004)
+ {
+ return getChildBySemanticHint(AcoreVisualIDRegistry.getType(AClassAOperationClassCompartmentEditPart.VISUAL_ID));
+ }
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ /**
+ * @generated
+ */
+ public class AClassFigure extends RectangleFigure
+ {
+
+ /**
+ * @generated
+ */
+ private RectangleFigure fFigureClassAttributes;
+
+ /**
+ * @generated
+ */
+ private WrappingLabel fFigureAClassNameFigure;
+
+ /**
+ * @generated
+ */
+ private RectangleFigure fFigureClassOperations;
+
+ /**
+ * @generated
+ */
+ public AClassFigure()
+ {
+
+ ToolbarLayout layoutThis = new ToolbarLayout();
+ layoutThis.setStretchMinorAxis(true);
+ layoutThis.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
+
+ layoutThis.setSpacing(0);
+ layoutThis.setVertical(true);
+
+ this.setLayoutManager(layoutThis);
+
+ this.setLineWidth(1);
+ this.setBackgroundColor(THIS_BACK);
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+ private void createContents()
+ {
+
+ fFigureAClassNameFigure = new WrappingLabel();
+ fFigureAClassNameFigure.setText("<...>");
+
+ this.add(fFigureAClassNameFigure);
+
+ fFigureClassAttributes = new RectangleFigure();
+ fFigureClassAttributes.setLineWidth(1);
+
+ this.add(fFigureClassAttributes);
+ fFigureClassAttributes.setLayoutManager(new StackLayout());
+
+ fFigureClassOperations = new RectangleFigure();
+ fFigureClassOperations.setLineWidth(1);
+
+ this.add(fFigureClassOperations);
+ fFigureClassOperations.setLayoutManager(new StackLayout());
+
+ }
+
+ /**
+ * @generated
+ */
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates()
+ {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates)
+ {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ public RectangleFigure getFigureClassAttributes()
+ {
+ return fFigureClassAttributes;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getFigureAClassNameFigure()
+ {
+ return fFigureAClassNameFigure;
+ }
+
+ /**
+ * @generated
+ */
+ public RectangleFigure getFigureClassOperations()
+ {
+ return fFigureClassOperations;
+ }
+
+ }
+
+ /**
+ * @generated
+ */
+ static final Color THIS_BACK = new Color(null, 230, 230, 255);
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassImplementedInterfacesEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassImplementedInterfacesEditPart.java
index a84dde0894..b06a705897 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassImplementedInterfacesEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassImplementedInterfacesEditPart.java
@@ -1,103 +1,103 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassImplementedInterfacesItemSemanticEditPolicy;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.PolylineDecoration;
-import org.eclipse.draw2d.RotatableDecoration;
-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;
-
-/**
- * @generated
- */
-public class AClassImplementedInterfacesEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4002;
-
- /**
- * @generated
- */
- public AClassImplementedInterfacesEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassImplementedInterfacesItemSemanticEditPolicy());
- }
-
- /**
- * 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 Connection createConnectionFigure()
- {
- return new AClassImplementedInterfacesFigure();
- }
-
- /**
- * @generated
- */
- public AClassImplementedInterfacesFigure getPrimaryShape()
- {
- return (AClassImplementedInterfacesFigure)getFigure();
- }
-
- /**
- * @generated
- */
- public class AClassImplementedInterfacesFigure extends PolylineConnectionEx
- {
-
- /**
- * @generated
- */
- public AClassImplementedInterfacesFigure()
- {
- this.setLineWidth(1);
- this.setLineStyle(Graphics.LINE_DASH);
-
- setTargetDecoration(createTargetDecoration());
- }
-
- /**
- * @generated
- */
- private RotatableDecoration createTargetDecoration()
- {
- PolylineDecoration df = new PolylineDecoration();
- df.setLineWidth(1);
- return df;
- }
-
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassImplementedInterfacesItemSemanticEditPolicy;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.PolylineDecoration;
+import org.eclipse.draw2d.RotatableDecoration;
+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;
+
+/**
+ * @generated
+ */
+public class AClassImplementedInterfacesEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4002;
+
+ /**
+ * @generated
+ */
+ public AClassImplementedInterfacesEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassImplementedInterfacesItemSemanticEditPolicy());
+ }
+
+ /**
+ * 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 Connection createConnectionFigure()
+ {
+ return new AClassImplementedInterfacesFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public AClassImplementedInterfacesFigure getPrimaryShape()
+ {
+ return (AClassImplementedInterfacesFigure)getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class AClassImplementedInterfacesFigure extends PolylineConnectionEx
+ {
+
+ /**
+ * @generated
+ */
+ public AClassImplementedInterfacesFigure()
+ {
+ this.setLineWidth(1);
+ this.setLineStyle(Graphics.LINE_DASH);
+
+ setTargetDecoration(createTargetDecoration());
+ }
+
+ /**
+ * @generated
+ */
+ private RotatableDecoration createTargetDecoration()
+ {
+ PolylineDecoration df = new PolylineDecoration();
+ df.setLineWidth(1);
+ return df;
+ }
+
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassNameEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassNameEditPart.java
index 4e6fe0771f..8c607a34ff 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassNameEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassNameEditPart.java
@@ -1,685 +1,685 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RunnableWithResult;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.NonResizableHandleKit;
-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.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.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;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @generated
- */
-public class AClassNameEditPart 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
- */
- public AClassNameEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new AcoreTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy()
- {
-
- protected List createSelectionHandles()
- {
- List handles = new ArrayList();
- NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
- ((MoveHandle)handles.get(0)).setBorder(null);
- return handles;
- }
-
- public Command getCommand(Request request)
- {
- return null;
- }
-
- public boolean understandsRequest(Request request)
- {
- return false;
- }
- });
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getText();
- }
- else
- {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setText(text);
- }
- else
- {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getIcon();
- }
- else
- {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setIcon(icon);
- }
- else
- {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure)
- {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- 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 AcoreElementTypes.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);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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()
- {
-
- 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 = AcoreParserProvider.getParser(AcoreElementTypes.AClass_2002, getParserElement(), AcoreVisualIDRegistry
- .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager()
- {
- if (manager == null)
- {
- setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
- AcoreEditPartFactory.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() == TextDirectEditManager.class)
- {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter)
- {
- if (getManager() instanceof TextDirectEditManager)
- {
- ((TextDirectEditManager)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());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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
- */
- 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
- */
- 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;
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RunnableWithResult;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+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.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.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;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @generated
+ */
+public class AClassNameEditPart 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
+ */
+ public AClassNameEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new AcoreTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy()
+ {
+
+ protected List createSelectionHandles()
+ {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request)
+ {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request)
+ {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getText();
+ }
+ else
+ {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setText(text);
+ }
+ else
+ {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getIcon();
+ }
+ else
+ {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setIcon(icon);
+ }
+ else
+ {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(WrappingLabel figure)
+ {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ 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 AcoreElementTypes.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);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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()
+ {
+
+ 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 = AcoreParserProvider.getParser(AcoreElementTypes.AClass_2002, getParserElement(), AcoreVisualIDRegistry
+ .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AClassNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager()
+ {
+ if (manager == null)
+ {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
+ AcoreEditPartFactory.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() == TextDirectEditManager.class)
+ {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter)
+ {
+ if (getManager() instanceof TextDirectEditManager)
+ {
+ ((TextDirectEditManager)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());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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
+ */
+ 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
+ */
+ 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassSubClassesEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassSubClassesEditPart.java
index 0f8cce2904..c12e510b9a 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassSubClassesEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AClassSubClassesEditPart.java
@@ -1,117 +1,117 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassSubClassesItemSemanticEditPolicy;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.RotatableDecoration;
-import org.eclipse.draw2d.geometry.PointList;
-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.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class AClassSubClassesEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4001;
-
- /**
- * @generated
- */
- public AClassSubClassesEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassSubClassesItemSemanticEditPolicy());
- }
-
- /**
- * 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 Connection createConnectionFigure()
- {
- return new AClassSubClassesFigure();
- }
-
- /**
- * @generated
- */
- public AClassSubClassesFigure getPrimaryShape()
- {
- return (AClassSubClassesFigure)getFigure();
- }
-
- /**
- * @generated
- */
- public class AClassSubClassesFigure extends PolylineConnectionEx
- {
-
- /**
- * @generated
- */
- public AClassSubClassesFigure()
- {
- this.setLineWidth(1);
-
- setTargetDecoration(createTargetDecoration());
- }
-
- /**
- * @generated
- */
- private RotatableDecoration createTargetDecoration()
- {
- PolygonDecoration df = new PolygonDecoration();
- df.setFill(true);
- df.setLineWidth(1);
- df.setBackgroundColor(DF_BACK);
- PointList pl = new PointList();
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
- pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
- pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
- df.setTemplate(pl);
- df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
- return df;
- }
-
- }
-
- /**
- * @generated
- */
- static final Color DF_BACK = new Color(null, 255, 255, 255);
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AClassSubClassesItemSemanticEditPolicy;
+
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+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.swt.graphics.Color;
+
+/**
+ * @generated
+ */
+public class AClassSubClassesEditPart extends ConnectionNodeEditPart implements ITreeBranchEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 4001;
+
+ /**
+ * @generated
+ */
+ public AClassSubClassesEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AClassSubClassesItemSemanticEditPolicy());
+ }
+
+ /**
+ * 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 Connection createConnectionFigure()
+ {
+ return new AClassSubClassesFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public AClassSubClassesFigure getPrimaryShape()
+ {
+ return (AClassSubClassesFigure)getFigure();
+ }
+
+ /**
+ * @generated
+ */
+ public class AClassSubClassesFigure extends PolylineConnectionEx
+ {
+
+ /**
+ * @generated
+ */
+ public AClassSubClassesFigure()
+ {
+ this.setLineWidth(1);
+
+ setTargetDecoration(createTargetDecoration());
+ }
+
+ /**
+ * @generated
+ */
+ private RotatableDecoration createTargetDecoration()
+ {
+ PolygonDecoration df = new PolygonDecoration();
+ df.setFill(true);
+ df.setLineWidth(1);
+ df.setBackgroundColor(DF_BACK);
+ PointList pl = new PointList();
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
+ pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
+ df.setTemplate(pl);
+ df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
+ return df;
+ }
+
+ }
+
+ /**
+ * @generated
+ */
+ static final Color DF_BACK = new Color(null, 255, 255, 255);
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/ACoreRootEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/ACoreRootEditPart.java
index 894fe7d2a4..3b36f7bf7c 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/ACoreRootEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/ACoreRootEditPart.java
@@ -1,56 +1,56 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.ACoreRootCanonicalEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.ACoreRootItemSemanticEditPolicy;
-
-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;
-
-/**
- * @generated
- */
-public class ACoreRootEditPart extends DiagramEditPart
-{
-
- /**
- * @generated
- */
- public final static String MODEL_ID = "Acore"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 1000;
-
- /**
- * @generated
- */
- public ACoreRootEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ACoreRootItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ACoreRootCanonicalEditPolicy());
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.ACoreRootCanonicalEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.ACoreRootItemSemanticEditPolicy;
+
+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;
+
+/**
+ * @generated
+ */
+public class ACoreRootEditPart extends DiagramEditPart
+{
+
+ /**
+ * @generated
+ */
+ public final static String MODEL_ID = "Acore"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 1000;
+
+ /**
+ * @generated
+ */
+ public ACoreRootEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ACoreRootItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ACoreRootCanonicalEditPolicy());
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAAttributeInterfaceCompartmentEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAAttributeInterfaceCompartmentEditPart.java
index e4f7c1f34f..f3fd856c6e 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAAttributeInterfaceCompartmentEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAAttributeInterfaceCompartmentEditPart.java
@@ -1,95 +1,95 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAAttributeInterfaceCompartmentItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class AInterfaceAAttributeInterfaceCompartmentEditPart extends ListCompartmentEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7001;
-
- /**
- * @generated
- */
- public AInterfaceAAttributeInterfaceCompartmentEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected boolean hasModelChildrenChanged(Notification evt)
- {
- return false;
- }
-
- /**
- * @generated
- */
- public String getCompartmentName()
- {
- return Messages.AInterfaceAAttributeInterfaceCompartmentEditPart_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 AInterfaceAAttributeInterfaceCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy());
- }
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio)
- {
- // nothing to do -- parent layout does not accept Double constraints as ratio
- // super.setRatio(ratio);
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAAttributeInterfaceCompartmentItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class AInterfaceAAttributeInterfaceCompartmentEditPart extends ListCompartmentEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 7001;
+
+ /**
+ * @generated
+ */
+ public AInterfaceAAttributeInterfaceCompartmentEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean hasModelChildrenChanged(Notification evt)
+ {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public String getCompartmentName()
+ {
+ return Messages.AInterfaceAAttributeInterfaceCompartmentEditPart_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 AInterfaceAAttributeInterfaceCompartmentItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+ installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AInterfaceAAttributeInterfaceCompartmentCanonicalEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected void setRatio(Double ratio)
+ {
+ // nothing to do -- parent layout does not accept Double constraints as ratio
+ // super.setRatio(ratio);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAOperationInterfaceCompartmentEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAOperationInterfaceCompartmentEditPart.java
index 88c34562f6..300676d832 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAOperationInterfaceCompartmentEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceAOperationInterfaceCompartmentEditPart.java
@@ -1,95 +1,95 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAOperationInterfaceCompartmentCanonicalEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAOperationInterfaceCompartmentItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class AInterfaceAOperationInterfaceCompartmentEditPart extends ListCompartmentEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 7002;
-
- /**
- * @generated
- */
- public AInterfaceAOperationInterfaceCompartmentEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected boolean hasModelChildrenChanged(Notification evt)
- {
- return false;
- }
-
- /**
- * @generated
- */
- public String getCompartmentName()
- {
- return Messages.AInterfaceAOperationInterfaceCompartmentEditPart_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 AInterfaceAOperationInterfaceCompartmentItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
- installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AInterfaceAOperationInterfaceCompartmentCanonicalEditPolicy());
- }
-
- /**
- * @generated
- */
- protected void setRatio(Double ratio)
- {
- // nothing to do -- parent layout does not accept Double constraints as ratio
- // super.setRatio(ratio);
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAOperationInterfaceCompartmentCanonicalEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AInterfaceAOperationInterfaceCompartmentItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.Messages;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class AInterfaceAOperationInterfaceCompartmentEditPart extends ListCompartmentEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 7002;
+
+ /**
+ * @generated
+ */
+ public AInterfaceAOperationInterfaceCompartmentEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean hasModelChildrenChanged(Notification evt)
+ {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public String getCompartmentName()
+ {
+ return Messages.AInterfaceAOperationInterfaceCompartmentEditPart_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 AInterfaceAOperationInterfaceCompartmentItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+ installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new AInterfaceAOperationInterfaceCompartmentCanonicalEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected void setRatio(Double ratio)
+ {
+ // nothing to do -- parent layout does not accept Double constraints as ratio
+ // super.setRatio(ratio);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceNameEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceNameEditPart.java
index 654df5b58e..99b0633216 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceNameEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AInterfaceNameEditPart.java
@@ -1,686 +1,686 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RunnableWithResult;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.NonResizableHandleKit;
-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.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.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;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @generated
- */
-public class AInterfaceNameEditPart 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
- */
- public AInterfaceNameEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new AcoreTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy()
- {
-
- protected List createSelectionHandles()
- {
- List handles = new ArrayList();
- NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
- ((MoveHandle)handles.get(0)).setBorder(null);
- return handles;
- }
-
- public Command getCommand(Request request)
- {
- return null;
- }
-
- public boolean understandsRequest(Request request)
- {
- return false;
- }
- });
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getText();
- }
- else
- {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setText(text);
- }
- else
- {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getIcon();
- }
- else
- {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setIcon(icon);
- }
- else
- {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure)
- {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- 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 AcoreElementTypes.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);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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()
- {
-
- 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 = AcoreParserProvider.getParser(AcoreElementTypes.AInterface_2001, getParserElement(),
- AcoreVisualIDRegistry
- .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AInterfaceNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager()
- {
- if (manager == null)
- {
- setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
- AcoreEditPartFactory.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() == TextDirectEditManager.class)
- {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter)
- {
- if (getManager() instanceof TextDirectEditManager)
- {
- ((TextDirectEditManager)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());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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
- */
- 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
- */
- 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;
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RunnableWithResult;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.handles.NonResizableHandleKit;
+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.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.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;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @generated
+ */
+public class AInterfaceNameEditPart 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
+ */
+ public AInterfaceNameEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new AcoreTextSelectionEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableEditPolicy()
+ {
+
+ protected List createSelectionHandles()
+ {
+ List handles = new ArrayList();
+ NonResizableHandleKit.addMoveHandle((GraphicalEditPart)getHost(), handles);
+ ((MoveHandle)handles.get(0)).setBorder(null);
+ return handles;
+ }
+
+ public Command getCommand(Request request)
+ {
+ return null;
+ }
+
+ public boolean understandsRequest(Request request)
+ {
+ return false;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getText();
+ }
+ else
+ {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setText(text);
+ }
+ else
+ {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getIcon();
+ }
+ else
+ {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setIcon(icon);
+ }
+ else
+ {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(WrappingLabel figure)
+ {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ 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 AcoreElementTypes.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);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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()
+ {
+
+ 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 = AcoreParserProvider.getParser(AcoreElementTypes.AInterface_2001, getParserElement(),
+ AcoreVisualIDRegistry
+ .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AInterfaceNameEditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager()
+ {
+ if (manager == null)
+ {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
+ AcoreEditPartFactory.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() == TextDirectEditManager.class)
+ {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter)
+ {
+ if (getManager() instanceof TextDirectEditManager)
+ {
+ ((TextDirectEditManager)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());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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
+ */
+ 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
+ */
+ 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/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperation2EditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperation2EditPart.java
index 0b5e1198e7..825351a549 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperation2EditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperation2EditPart.java
@@ -1,684 +1,684 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AOperation2ItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RunnableWithResult;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.SelectionRequest;
-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.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-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.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;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @generated
- */
-public class AOperation2EditPart extends CompartmentEditPart implements ITextAwareEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3004;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * @generated
- */
- public AOperation2EditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- public DragTracker getDragTracker(Request request)
- {
- if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
- {
- return null;
- }
- return new DragEditPartsTrackerEx(this);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AOperation2ItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getText();
- }
- else
- {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setText(text);
- }
- else
- {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getIcon();
- }
- else
- {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setIcon(icon);
- }
- else
- {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure)
- {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- 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()
- {
- return null;
- }
-
- /**
- * @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);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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()
- {
-
- 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 = AcoreParserProvider.getParser(AcoreElementTypes.AOperation_3004, getParserElement(),
- AcoreVisualIDRegistry
- .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AOperation2EditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager()
- {
- if (manager == null)
- {
- setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
- AcoreEditPartFactory.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() == TextDirectEditManager.class)
- {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter)
- {
- if (getManager() instanceof TextDirectEditManager)
- {
- ((TextDirectEditManager)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());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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
- */
- 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
- */
- 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()
- {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim()
- {
- return new WrappingLabel();
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AOperation2ItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RunnableWithResult;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+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.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+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.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;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @generated
+ */
+public class AOperation2EditPart extends CompartmentEditPart implements ITextAwareEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3004;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+ /**
+ * @generated
+ */
+ public AOperation2EditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ public DragTracker getDragTracker(Request request)
+ {
+ if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
+ {
+ return null;
+ }
+ return new DragEditPartsTrackerEx(this);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AOperation2ItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getText();
+ }
+ else
+ {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setText(text);
+ }
+ else
+ {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getIcon();
+ }
+ else
+ {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setIcon(icon);
+ }
+ else
+ {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure)
+ {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ 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()
+ {
+ return null;
+ }
+
+ /**
+ * @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);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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()
+ {
+
+ 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 = AcoreParserProvider.getParser(AcoreElementTypes.AOperation_3004, getParserElement(),
+ AcoreVisualIDRegistry
+ .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AOperation2EditPart.VISUAL_ID));
+ }
+ return parser;
+ }
+
+ /**
+ * @generated
+ */
+ protected DirectEditManager getManager()
+ {
+ if (manager == null)
+ {
+ setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
+ AcoreEditPartFactory.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() == TextDirectEditManager.class)
+ {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter)
+ {
+ if (getManager() instanceof TextDirectEditManager)
+ {
+ ((TextDirectEditManager)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());
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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
+ */
+ 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
+ */
+ 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()
+ {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFigurePrim()
+ {
+ return new WrappingLabel();
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperationEditPart.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperationEditPart.java
index ed434cb013..6fde23c2b2 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperationEditPart.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/edit/parts/AOperationEditPart.java
@@ -1,684 +1,684 @@
-/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- *
- */
-package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
-
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AOperationItemSemanticEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
-import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RunnableWithResult;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.SelectionRequest;
-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.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-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.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;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @generated
- */
-public class AOperationEditPart extends CompartmentEditPart implements ITextAwareEditPart
-{
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3002;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * @generated
- */
- public AOperationEditPart(View view)
- {
- super(view);
- }
-
- /**
- * @generated
- */
- public DragTracker getDragTracker(Request request)
- {
- if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
- {
- return null;
- }
- return new DragEditPartsTrackerEx(this);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies()
- {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AOperationItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getText();
- }
- else
- {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setText(text);
- }
- else
- {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure)
- {
- if (figure instanceof WrappingLabel)
- {
- return ((WrappingLabel)figure).getIcon();
- }
- else
- {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon)
- {
- if (figure instanceof WrappingLabel)
- {
- ((WrappingLabel)figure).setIcon(icon);
- }
- else
- {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure)
- {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- 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()
- {
- return null;
- }
-
- /**
- * @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);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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()
- {
-
- 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 = AcoreParserProvider.getParser(AcoreElementTypes.AOperation_3002, getParserElement(),
- AcoreVisualIDRegistry
- .getType(org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts.AOperationEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager()
- {
- if (manager == null)
- {
- setManager(new TextDirectEditManager(this, TextDirectEditManager.getTextCellEditorClass(this),
- AcoreEditPartFactory.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() == TextDirectEditManager.class)
- {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter)
- {
- if (getManager() instanceof TextDirectEditManager)
- {
- ((TextDirectEditManager)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());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
- {
- ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- /**
- * @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
- */
- 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
- */
- 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()
- {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- /**
- * @generated
- */
- protected IFigure createFigurePrim()
- {
- return new WrappingLabel();
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * 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
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ *
+ */
+package org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.parts;
+
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AOperationItemSemanticEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextNonResizableEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.edit.policies.AcoreTextSelectionEditPolicy;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.AcoreVisualIDRegistry;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreElementTypes;
+import org.eclipse.emf.cdo.dawn.examples.acore.diagram.providers.AcoreParserProvider;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RunnableWithResult;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+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.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+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.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;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @generated
+ */
+public class AOperationEditPart extends CompartmentEditPart implements ITextAwareEditPart
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3002;
+
+ /**
+ * @generated
+ */
+ private DirectEditManager manager;
+
+ /**
+ * @generated
+ */
+ private IParser parser;
+
+ /**
+ * @generated
+ */
+ private List parserElements;
+
+ /**
+ * @generated
+ */
+ private String defaultText;
+
+ /**
+ * @generated
+ */
+ public AOperationEditPart(View view)
+ {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ public DragTracker getDragTracker(Request request)
+ {
+ if (request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3)
+ {
+ return null;
+ }
+ return new DragEditPartsTrackerEx(this);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies()
+ {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new AOperationItemSemanticEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new AcoreTextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ }
+
+ /**
+ * @generated
+ */
+ protected String getLabelTextHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getText();
+ }
+ else
+ {
+ return ((Label)figure).getText();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelTextHelper(IFigure figure, String text)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setText(text);
+ }
+ else
+ {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Image getLabelIconHelper(IFigure figure)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ return ((WrappingLabel)figure).getIcon();
+ }
+ else
+ {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void setLabelIconHelper(IFigure figure, Image icon)
+ {
+ if (figure instanceof WrappingLabel)
+ {
+ ((WrappingLabel)figure).setIcon(icon);
+ }
+ else
+ {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void setLabel(IFigure figure)
+ {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ /**
+ * @generated
+ */
+ 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()
+ {
+ return null;
+ }
+
+ /**
+ * @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);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (pdEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if (sfEditPolicy instanceof AcoreTextSelectionEditPolicy)
+ {
+ ((AcoreTextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @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
+ */