Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorytanguy2010-06-21 10:11:19 +0000
committerytanguy2010-06-21 10:11:19 +0000
commit1b4511ae387ba9e84237e523f184ba2d9d186323 (patch)
tree1ab157ff3a7675f40c0b6a032c86bc0fb34a1eb3 /extraplugins/deprecated-plugins
parent14ea75385b59e5c950251e0fad0c4d7604881883 (diff)
downloadorg.eclipse.papyrus-1b4511ae387ba9e84237e523f184ba2d9d186323.tar.gz
org.eclipse.papyrus-1b4511ae387ba9e84237e523f184ba2d9d186323.tar.xz
org.eclipse.papyrus-1b4511ae387ba9e84237e523f184ba2d9d186323.zip
ASSIGNED - bug 310969: [SysML] Provide Bloc Definition and Internal Bloc Diagram based on GMF Runtime
https://bugs.eclipse.org/bugs/show_bug.cgi?id=310969
Diffstat (limited to 'extraplugins/deprecated-plugins')
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.classpath8
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.options7
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.project28
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/bdd.gmfgen.prefs7
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/META-INF/MANIFEST.MF54
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/about.html28
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/build.properties17
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDCreation.java87
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDDiagramForMultiEditor.java115
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDEditorFactory.java25
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/part/BlockNameEditPart.java41
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysMLViewComponentEditPolicy.java38
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SYSMLOCLFactory.java180
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SysmlAbstractExpression.java170
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/figures/BlockFigure.java92
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/BlockNameParser.java93
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/SysMLMessageFormatParser.java82
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/obj16/ResourceDiagramFile.gifbin0 -> 339 bytes
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/wizban/NewResourceWizard.gifbin0 -> 2466 bytes
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/messages.properties69
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgen276
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgraph4
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfmap68
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmftool76
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.trace21
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.properties41
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.xml1317
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/BlockCreateCommand.java150
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/OperationCreateCommand.java127
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/PropertyCreateCommand.java129
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/SysmlReorientConnectionViewCommand.java80
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/BlockEditHelper.java20
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/OperationEditHelper.java20
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/PropertyEditHelper.java28
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/ResourceEditHelper.java20
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/SysmlBaseEditHelper.java99
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockAttributeCompartmentEditPart.java143
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockConstraintCompartmentEditPart.java37
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockEditPart.java388
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockOperationCompartmentEditPart.java133
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockPartCompartmentEditPart.java38
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockReferenceCompartmentEditPart.java39
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockValueCompartmentEditPart.java39
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/OperationEditPart.java235
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/PropertyEditPart.java48
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/ResourceEditPart.java87
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/SysmlEditPartFactory.java226
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentCanonicalEditPolicy.java91
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentItemSemanticEditPolicy.java44
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockItemSemanticEditPolicy.java125
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentCanonicalEditPolicy.java85
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentItemSemanticEditPolicy.java43
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockPartCompartmentCanonicalEditPolicy.java85
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockReferenceCompartmentCanonicalEditPolicy.java85
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockValueCompartmentCanonicalEditPolicy.java85
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/OperationItemSemanticEditPolicy.java56
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/PropertyItemSemanticEditPolicy.java45
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceCanonicalEditPolicy.java152
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceItemSemanticEditPolicy.java77
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlBaseItemSemanticEditPolicy.java303
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextNonResizableEditPolicy.java236
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextSelectionEditPolicy.java220
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlAbstractNavigatorItem.java71
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorContentProvider.java230
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorItem.java119
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorLabelProvider.java107
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorActionProvider.java182
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorContentProvider.java405
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorGroup.java110
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorItem.java97
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLabelProvider.java255
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLinkHelper.java128
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorSorter.java40
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DeleteElementAction.java96
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DiagramEditorContextMenuProvider.java79
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/LoadResourceAction.java43
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/Messages.java356
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/ModelElementSelectionPage.java156
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizard.java167
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizardPage.java96
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramActionBarContributor.java51
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditor.java552
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorPlugin.java280
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorUtil.java389
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdateCommand.java91
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdater.java368
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDocumentProvider.java989
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlInitDiagramFileAction.java99
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlLinkDescriptor.java105
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlMatchingStrategy.java47
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNewDiagramFileWizard.java175
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNodeDescriptor.java55
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlPaletteFactory.java117
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlUriEditorInputTester.java35
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlVisualIDRegistry.java294
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/BlockPreferencePage.java52
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramAppearancePreferencePage.java30
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramConnectionsPreferencePage.java30
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramGeneralPreferencePage.java30
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPreferenceInitializer.java45
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPrintingPreferencePage.java30
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramRulersAndGridPreferencePage.java30
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/OperationPreferencePage.java52
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/PropertyPreferencePage.java52
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/providers/ElementInitializers.java75
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/providers/SysmlEditPartProvider.java154
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/providers/SysmlElementTypes.java242
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/providers/SysmlIconProvider.java44
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/providers/SysmlModelingAssistantProvider.java170
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/providers/SysmlParserProvider.java93
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/providers/SysmlViewProvider.java421
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/sheet/SysmlPropertySection.java123
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/sheet/SysmlSheetLabelProvider.java91
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/.classpath8
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/.options7
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/.project28
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/.settings/ibd.gmfgen.prefs7
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/.settings/org.eclipse.gmf.bridge.ui.dashboard.prefs7
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/.svnignore1
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/META-INF/MANIFEST.MF60
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/about.html28
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/build.properties11
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/IBDCondition.java38
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/IBDCreation.java93
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/IBDEditorFactory.java25
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/IBDProvider.java94
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/custom/figures/FlowPortFigure.java33
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/parts/FlowPortEditPart.java150
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policies/ClassItemSemanticEditPolicy.java57
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/custom-src/org/eclipse/papyrus/sysml/diagram/internalblock/tools/FlowPortAspectUnspecifiedTypeCreationTool.java43
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/icons/obj16/ResourceDiagramFile.gifbin0 -> 339 bytes
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/icons/wizban/NewResourceWizard.gifbin0 -> 2466 bytes
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/messages.properties146
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/model/ibd.gmfgen127
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/model/ibd.gmfgraph21
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/model/ibd.gmfmap30
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/model/ibd.gmftool23
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/model/ibd.trace8
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/plugin.properties62
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/plugin.xml858
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/commands/FlowPortCreateCommand.java121
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/commands/SysmlReorientConnectionViewCommand.java80
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/helpers/FlowPortEditHelper.java20
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/helpers/ResourceEditHelper.java20
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/helpers/SysmlBaseEditHelper.java100
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/parts/ResourceEditPart.java53
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/parts/SysmlEditPartFactory.java44
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policies/FlowPortItemSemanticEditPolicy.java62
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policies/ResourceCanonicalEditPolicy.java156
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policies/ResourceItemSemanticEditPolicy.java97
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policies/SysmlBaseItemSemanticEditPolicy.java240
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policies/SysmlTextNonResizableEditPolicy.java236
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/edit/policies/SysmlTextSelectionEditPolicy.java220
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlAbstractNavigatorItem.java72
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlDomainNavigatorContentProvider.java233
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlDomainNavigatorItem.java124
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlDomainNavigatorLabelProvider.java108
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlNavigatorActionProvider.java182
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlNavigatorContentProvider.java355
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlNavigatorGroup.java110
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlNavigatorItem.java104
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlNavigatorLabelProvider.java218
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlNavigatorLinkHelper.java129
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/navigator/SysmlNavigatorSorter.java40
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/DeleteElementAction.java96
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/DiagramEditorContextMenuProvider.java81
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/InternalBlockDiagramEditorPlugin.java275
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/LoadResourceAction.java44
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/Messages.java292
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/ModelElementSelectionPage.java158
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlCreationWizard.java172
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlCreationWizardPage.java96
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlDiagramActionBarContributor.java51
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlDiagramEditor.java293
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlDiagramEditorUtil.java399
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlDiagramUpdateCommand.java94
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlDiagramUpdater.java127
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlDocumentProvider.java1076
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlInitDiagramFileAction.java100
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlLinkDescriptor.java106
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlMatchingStrategy.java47
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlNewDiagramFileWizard.java185
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlNodeDescriptor.java55
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlPaletteFactory.java136
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlUriEditorInputTester.java35
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/part/SysmlVisualIDRegistry.java194
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/preferences/DiagramAppearancePreferencePage.java22
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/preferences/DiagramConnectionsPreferencePage.java30
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/preferences/DiagramGeneralPreferencePage.java22
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/preferences/DiagramPreferenceInitializer.java22
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/preferences/DiagramPrintingPreferencePage.java22
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/preferences/DiagramRulersAndGridPreferencePage.java21
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/providers/ElementInitializers.java21
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/providers/SysmlEditPartProvider.java154
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/providers/SysmlElementTypes.java220
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/providers/SysmlIconProvider.java44
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/providers/SysmlModelingAssistantProvider.java164
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/providers/SysmlViewProvider.java451
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/sheet/SysmlPropertySection.java123
-rw-r--r--extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.internalblock/src/org/eclipse/papyrus/sysml/diagram/internalblock/sheet/SysmlSheetLabelProvider.java92
201 files changed, 25527 insertions, 0 deletions
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.classpath b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.classpath
new file mode 100644
index 00000000000..f6326c88c74
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="custom-src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.options b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.options
new file mode 100644
index 00000000000..a34fb8efdb5
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.options
@@ -0,0 +1,7 @@
+# Tracing options for the org.eclipse.papyrus.sysml.diagram.blockdiagram plug-in
+
+# Common issues
+org.eclipse.papyrus.sysml.diagram.blockdiagram/debug=false
+
+# Visual IDs
+org.eclipse.papyrus.sysml.diagram.blockdiagram/debug/visualID=false
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.project b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.project
new file mode 100644
index 00000000000..98c5a3b6e53
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.diagram.blockdiagram</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/bdd.gmfgen.prefs b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/bdd.gmfgen.prefs
new file mode 100644
index 00000000000..26499e09596
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/bdd.gmfgen.prefs
@@ -0,0 +1,7 @@
+#Mon Feb 01 16:08:05 CET 2010
+eclipse.preferences.version=1
+generate_rcp=false
+ignore_gmfgen_validation=false
+ignore_mapmodel_validation=true
+use_map_mode=true
+use_runtime_figures=true
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/org.eclipse.jdt.core.prefs b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..97c380973c3
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon Jan 18 08:31:12 CET 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/META-INF/MANIFEST.MF b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..8c20978057e
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/META-INF/MANIFEST.MF
@@ -0,0 +1,54 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.blockdiagram; singleton:=true
+Bundle-Version: 0.7.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin
+Bundle-Localization: plugin
+Export-Package: org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts,
+ org.eclipse.papyrus.sysml.diagram.blockdiagram.part,
+ org.eclipse.papyrus.sysml.diagram.blockdiagram.providers
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.core.expressions,
+ org.eclipse.jface,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.views,
+ org.eclipse.ui.navigator,
+ org.eclipse.ui.navigator.resources,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.emf.edit.ui,
+ org.eclipse.gmf.runtime.emf.core,
+ org.eclipse.gmf.runtime.emf.commands.core,
+ org.eclipse.gmf.runtime.emf.ui.properties,
+ org.eclipse.gmf.runtime.diagram.ui,
+ org.eclipse.gmf.runtime.diagram.ui.properties,
+ org.eclipse.gmf.runtime.diagram.ui.providers,
+ org.eclipse.gmf.runtime.diagram.ui.providers.ide,
+ org.eclipse.gmf.runtime.diagram.ui.render,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
+ org.eclipse.draw2d;visibility:=reexport,
+ org.eclipse.papyrus.diagram.common;visibility:=reexport,
+ org.eclipse.papyrus.sysml;visibility:=reexport,
+ org.eclipse.papyrus.sysml.edit;visibility:=reexport,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.ecore.edit;visibility:=reexport,
+ org.eclipse.papyrus.uml.standard;visibility:=reexport,
+ org.eclipse.papyrus.uml.standard.edit;visibility:=reexport,
+ org.eclipse.uml2.uml;visibility:=reexport,
+ org.eclipse.uml2.uml.edit;visibility:=reexport,
+ org.eclipse.papyrus.resource;visibility:=reexport,
+ org.eclipse.papyrus.resource.edit;visibility:=reexport,
+ org.eclipse.gef,
+ org.eclipse.papyrus.preferences,
+ org.eclipse.papyrus.extensionpoints.editors,
+ org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.7.0",
+ org.eclipse.papyrus.diagram.clazz;bundle-version="0.7.0",
+ org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Eclipse-LazyStart: true
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/about.html b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/about.html
new file mode 100644
index 00000000000..50d9eae0154
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>December 15, 2009</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/build.properties b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/build.properties
new file mode 100644
index 00000000000..87ae357a7a5
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/build.properties
@@ -0,0 +1,17 @@
+source.. = src/,\
+ custom-src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ messages.properties,\
+ .options,\
+ bin/,\
+ icons/
+jars.compile.order = .
+src.includes = about.html,\
+ bin/,\
+ icons/,\
+ messages.properties,\
+ model/
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDCreation.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDCreation.java
new file mode 100644
index 00000000000..bbd657be279
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDCreation.java
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+import org.eclipse.papyrus.sysml.util.SysmlResource;
+import org.eclipse.papyrus.umlutils.PackageUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.UMLFactory;
+
+
+public class BDDCreation extends AbstractPapyrusGmfCreateDiagramCommandHandler {
+
+ /**
+ * Name of the Diagram
+ */
+ protected static final String CSD_DEFAULT_NAME = "BDD"; //$NON-NLS-1$
+
+ public static final String MODEL_ID = "BDD"; //$NON-NLS-1$
+
+ public BDDCreation() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getDefaultDiagramName() {
+ return openDiagramNameDialog(CSD_DEFAULT_NAME);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getDiagramNotationID() {
+ return MODEL_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected PreferencesHint getPreferenceHint() {
+ return SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected EObject createRootElement() {
+ return UMLFactory.eINSTANCE.createModel();
+ }
+
+ /**
+ * Overrides to add the SysML profile to the nearest containing package if it is not yet applied {@inheritDoc}
+ */
+ @Override
+ protected void initializeModel(EObject owner) {
+ if(owner instanceof Element) {
+ Element element = (Element)owner;
+ Package pack = element.getNearestPackage();
+
+ if((pack.getAppliedProfile("SysML::Blocks", true) == null) || (pack.getAppliedProfile("SysML::PortAndFlows", true) == null)) {
+ // Retrieve SysML profile and apply with sub-profiles
+ Profile sysml = (Profile)PackageUtil.loadPackage(URI.createURI(SysmlResource.SYSML_PROFILE_URI), pack.eResource().getResourceSet());
+ PackageUtil.applyProfile(pack, sysml, true);
+ }
+ }
+ super.initializeModel(owner);
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDDiagramForMultiEditor.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDDiagramForMultiEditor.java
new file mode 100644
index 00000000000..95f53a702ac
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDDiagramForMultiEditor.java
@@ -0,0 +1,115 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+
+
+public class BDDDiagramForMultiEditor extends SysmlDiagramEditor {
+
+ /**
+ * The location of diagram icon in the plug-in
+ */
+ private static final String DIAG_IMG_PATH = "icons/obj16/ResourceDiagramFile.gif";
+
+ /**
+ * The image descriptor of the diagram icon
+ */
+ private static final ImageDescriptor DIAG_IMG_DESC = SysmlDiagramEditorPlugin.getBundledImageDescriptor(BDDDiagramForMultiEditor.DIAG_IMG_PATH);
+
+ /** The editor splitter. */
+ private Composite splitter;
+
+ /**
+ * Constructor for SashSystem v2. Context and required objects are retrieved from the
+ * ServiceRegistry.
+ *
+ * @throws BackboneException
+ * @throws ServiceException
+ *
+ */
+ public BDDDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
+ super(servicesRegistry, diagram);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ super.init(site, input);
+ setPartName(getDiagram().getName());
+ setTitleImage(DIAG_IMG_DESC.createImage());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setInput(IEditorInput input) {
+ try {
+ // Provide an URI with fragment in order to reuse the same Resource
+ // and set the diagram to the fragment.
+ URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram()));
+ doSetInput(uriInput, true);
+ } catch (CoreException x) {
+ String title = "Problem opening";
+ String msg = "Cannot open input element:";
+ Shell shell = getSite().getShell();
+ ErrorDialog.openError(shell, title, msg, x.getStatus());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createGraphicalViewer(Composite parent) {
+ splitter = parent;
+ super.createGraphicalViewer(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+ splitter.setFocus();
+ super.setFocus();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getEditingDomainID() {
+ return "org.eclipse.papyrus.sysml.diagram.blockdiagram.EditingDomain";
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDEditorFactory.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDEditorFactory.java
new file mode 100644
index 00000000000..81332ad08b3
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/BDDEditorFactory.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram;
+
+import org.eclipse.papyrus.core.adaptor.gmf.GmfEditorFactory;
+
+
+public class BDDEditorFactory extends GmfEditorFactory {
+
+ public BDDEditorFactory() {
+ super(BDDDiagramForMultiEditor.class, BDDCreation.MODEL_ID);
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/part/BlockNameEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/part/BlockNameEditPart.java
new file mode 100644
index 00000000000..7f9b19ac44e
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/part/BlockNameEditPart.java
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.part;
+
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ClassNameEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlParserProvider;
+
+
+public class BlockNameEditPart extends ClassNameEditPart {
+
+ public static final int VISUAL_ID = 5129;
+
+ private IParser parser;
+
+ public BlockNameEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ public IParser getParser() {
+ if(parser == null) {
+ parser = SysmlParserProvider.getParser(SysmlElementTypes.Block_2001, getParserElement(), SysmlVisualIDRegistry.getType(VISUAL_ID));
+ }
+ return parser;
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysMLViewComponentEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysMLViewComponentEditPolicy.java
new file mode 100644
index 00000000000..fcac25ed86c
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysMLViewComponentEditPolicy.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.papyrus.diagram.clazz.custom.policies.CustomViewComponentEditPolicy;
+
+
+public class SysMLViewComponentEditPolicy extends CustomViewComponentEditPolicy {
+
+ /**
+ * Return a command to delete the host's view. The host's primary view is deleted if {@link GroupRequest#getEditParts()} returns a <tt>null</tt>
+ * or empty list; otherwise each
+ * editpart's view is deleted.
+ *
+ * @param deleteRequest
+ * the original delete request.
+ * @return Command
+ */
+ protected Command createDeleteViewCommand(GroupRequest deleteRequest) {
+ // TODO : refactor the deleteViewCommand
+ return UnexecutableCommand.INSTANCE;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SYSMLOCLFactory.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SYSMLOCLFactory.java
new file mode 100644
index 00000000000..c25991a91d6
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SYSMLOCLFactory.java
@@ -0,0 +1,180 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.expressions;
+
+import java.lang.ref.WeakReference;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.ocl.Environment;
+import org.eclipse.ocl.EvaluationEnvironment;
+import org.eclipse.ocl.ParserException;
+import org.eclipse.ocl.Query;
+import org.eclipse.ocl.ecore.EcoreFactory;
+import org.eclipse.ocl.expressions.OCLExpression;
+import org.eclipse.ocl.expressions.OperationCallExp;
+import org.eclipse.ocl.expressions.Variable;
+import org.eclipse.ocl.helper.OCLHelper;
+import org.eclipse.ocl.utilities.AbstractVisitor;
+import org.eclipse.ocl.utilities.PredefinedType;
+
+
+
+public class SYSMLOCLFactory {
+
+ /**
+ * @generated
+ */
+ private SYSMLOCLFactory() {
+ }
+
+ /**
+ * @generated
+ */
+ public static SysmlAbstractExpression getExpression(String body, EClassifier context, Map environment) {
+ return new Expression(body, context, environment);
+ }
+
+ /**
+ * @generated
+ */
+ public static SysmlAbstractExpression getExpression(String body, EClassifier context) {
+ return getExpression(body, context, Collections.EMPTY_MAP);
+ }
+
+ /**
+ * @generated
+ */
+ private static class Expression extends SysmlAbstractExpression {
+
+ /**
+ * @generated
+ */
+ private WeakReference queryRef;
+
+ /**
+ * @generated
+ */
+ private final org.eclipse.ocl.ecore.OCL oclInstance;
+
+ /**
+ * @generated
+ */
+ public Expression(String body, EClassifier context, Map environment) {
+ super(body, context);
+ oclInstance = org.eclipse.ocl.ecore.OCL.newInstance();
+ initCustomEnv(oclInstance.getEnvironment(), environment);
+ }
+
+ /**
+ * @generated
+ */
+ protected Query getQuery() {
+ Query oclQuery = null;
+ if(this.queryRef != null) {
+ oclQuery = (Query)this.queryRef.get();
+ }
+ if(oclQuery == null) {
+ OCLHelper oclHelper = oclInstance.createOCLHelper();
+ oclHelper.setContext(context());
+ try {
+ OCLExpression oclExpression = oclHelper.createQuery(body());
+ oclQuery = oclInstance.createQuery(oclExpression);
+ this.queryRef = new WeakReference(oclQuery);
+ setStatus(IStatus.OK, null, null);
+ } catch (ParserException e) {
+ setStatus(IStatus.ERROR, e.getMessage(), e);
+ }
+ }
+ return oclQuery;
+ }
+
+ /**
+ * @generated
+ */
+ protected Object doEvaluate(Object context, Map env) {
+ Query oclQuery = getQuery();
+ if(oclQuery == null) {
+ return null;
+ }
+ EvaluationEnvironment evalEnv = oclQuery.getEvaluationEnvironment();
+ // init environment
+ for(Iterator it = env.entrySet().iterator(); it.hasNext();) {
+ Map.Entry nextEntry = (Map.Entry)it.next();
+ evalEnv.replace((String)nextEntry.getKey(), nextEntry.getValue());
+ }
+ try {
+ initExtentMap(context);
+ Object result = oclQuery.evaluate(context);
+ return (result != oclInstance.getEnvironment().getOCLStandardLibrary().getOclInvalid()) ? result : null;
+ } finally {
+ evalEnv.clear();
+ oclQuery.getExtentMap().clear();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void initExtentMap(Object context) {
+ if(!getStatus().isOK() || context == null) {
+ return;
+ }
+ final Query queryToInit = getQuery();
+ final Object extentContext = context;
+ queryToInit.getExtentMap().clear();
+ if(queryToInit.queryText() != null && queryToInit.queryText().indexOf(PredefinedType.ALL_INSTANCES_NAME) >= 0) {
+ AbstractVisitor visitior = new AbstractVisitor() {
+
+ private boolean usesAllInstances = false;
+
+ public Object visitOperationCallExp(OperationCallExp oc) {
+ if(!usesAllInstances) {
+ usesAllInstances = PredefinedType.ALL_INSTANCES == oc.getOperationCode();
+ if(usesAllInstances) {
+ queryToInit.getExtentMap().putAll(oclInstance.getEvaluationEnvironment().createExtentMap(extentContext));
+ }
+ }
+ return super.visitOperationCallExp(oc);
+ }
+ };
+ queryToInit.getExpression().accept(visitior);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private static void initCustomEnv(Environment ecoreEnv, Map environment) {
+ for(Iterator it = environment.keySet().iterator(); it.hasNext();) {
+ String varName = (String)it.next();
+ EClassifier varType = (EClassifier)environment.get(varName);
+ ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, varType), false);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private static Variable createVar(Environment ecoreEnv, String name, EClassifier type) {
+ Variable var = EcoreFactory.eINSTANCE.createVariable();
+ var.setName(name);
+ var.setType(ecoreEnv.getUMLReflection().getOCLType(type));
+ return var;
+ }
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SysmlAbstractExpression.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SysmlAbstractExpression.java
new file mode 100644
index 00000000000..f11e30f2277
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/expressions/SysmlAbstractExpression.java
@@ -0,0 +1,170 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.expressions;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collections;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.papyrus.diagram.clazz.part.UMLDiagramEditorPlugin;
+
+
+public abstract class SysmlAbstractExpression {
+
+ /**
+ * @generated
+ */
+ private IStatus status = Status.OK_STATUS;
+
+ /**
+ * @generated
+ */
+ protected void setStatus(int severity, String message, Throwable throwable) {
+ String pluginID = UMLDiagramEditorPlugin.ID;
+ this.status = new Status(severity, pluginID, -1, (message != null) ? message : "", throwable); //$NON-NLS-1$
+ if(!this.status.isOK()) {
+ UMLDiagramEditorPlugin.getInstance().logError("Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public IStatus getStatus() {
+ return status;
+ }
+
+ /**
+ * @generated
+ */
+ private final String myBody;
+
+ /**
+ * @generated
+ */
+ public String body() {
+ return myBody;
+ }
+
+ /**
+ * @generated
+ */
+ private final EClassifier myContext;
+
+ /**
+ * @generated
+ */
+ public EClassifier context() {
+ return myContext;
+ }
+
+ /**
+ * @generated
+ */
+ protected SysmlAbstractExpression(String body, EClassifier context) {
+ myBody = body;
+ myContext = context;
+ }
+
+ /**
+ * @generated
+ */
+ protected abstract Object doEvaluate(Object context, Map env);
+
+ /**
+ * @generated
+ */
+ public Object evaluate(Object context) {
+ return evaluate(context, Collections.EMPTY_MAP);
+ }
+
+ /**
+ * @generated
+ */
+ public Object evaluate(Object context, Map env) {
+ if(context().isInstance(context)) {
+ try {
+ return doEvaluate(context, env);
+ } catch (Exception e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Expression evaluation failure: " + body(), e); //$NON-NLS-1$
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Expression may return number value which is not directly compatible with feature type (e.g.
+ * Double when Integer is expected), or EEnumLiteral meta-object when literal instance is
+ * expected
+ *
+ * @generated
+ */
+ public static Object performCast(Object value, EDataType targetType) {
+ if(targetType instanceof EEnum) {
+ if(value instanceof EEnumLiteral) {
+ EEnumLiteral literal = (EEnumLiteral)value;
+ return (literal.getInstance() != null) ? literal.getInstance() : literal;
+ }
+ }
+ if(false == value instanceof Number || targetType == null || targetType.getInstanceClass() == null) {
+ return value;
+ }
+ Class targetClass = targetType.getInstanceClass();
+ Number num = (Number)value;
+ Class valClass = value.getClass();
+ Class targetWrapperClass = targetClass;
+ if(targetClass.isPrimitive()) {
+ targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass);
+ }
+ if(valClass.equals(targetWrapperClass)) {
+ return value;
+ }
+ if(Number.class.isAssignableFrom(targetWrapperClass)) {
+ if(targetWrapperClass.equals(Byte.class)) {
+ return new Byte(num.byteValue());
+ }
+ if(targetWrapperClass.equals(Integer.class)) {
+ return new Integer(num.intValue());
+ }
+ if(targetWrapperClass.equals(Short.class)) {
+ return new Short(num.shortValue());
+ }
+ if(targetWrapperClass.equals(Long.class)) {
+ return new Long(num.longValue());
+ }
+ if(targetWrapperClass.equals(BigInteger.class)) {
+ return BigInteger.valueOf(num.longValue());
+ }
+ if(targetWrapperClass.equals(Float.class)) {
+ return new Float(num.floatValue());
+ }
+ if(targetWrapperClass.equals(Double.class)) {
+ return new Double(num.doubleValue());
+ }
+ if(targetWrapperClass.equals(BigDecimal.class)) {
+ return new BigDecimal(num.doubleValue());
+ }
+ }
+ return value;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/figures/BlockFigure.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/figures/BlockFigure.java
new file mode 100644
index 00000000000..533facc4533
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/figures/BlockFigure.java
@@ -0,0 +1,92 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.figures;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.papyrus.diagram.common.figure.node.ClassifierFigure;
+
+
+public class BlockFigure extends ClassifierFigure {
+
+ /** The Constraint Compartment */
+ private final static String CONSTRAINT_COMPARTMENT = "constraintCompartment";
+
+ /** The Reference Compartment */
+ private final static String REFERENCE_COMPARTMENT = "referenceCompartment";
+
+ /** The Value Compartment */
+ private final static String PART_COMPARTMENT = "partCompartment";
+
+ /** The Value Compartment */
+ private final static String VALUE_COMPARTMENT = "valueCompartment";
+
+ public BlockFigure() {
+ super();
+ }
+
+ /**
+ *
+ * @param compartmentFigure
+ */
+ protected void createContentPane(List<String> compartments) {
+ super.createContentPane(updateCompartment(compartments));
+
+ }
+
+ private List<String> updateCompartment(List<String> compartments) {
+ compartments.add(CONSTRAINT_COMPARTMENT);
+ compartments.add(REFERENCE_COMPARTMENT);
+ compartments.add(PART_COMPARTMENT);
+ compartments.add(VALUE_COMPARTMENT);
+ return compartments;
+ }
+
+ /**
+ * Get the constraint's compartment figure
+ *
+ * @return
+ */
+ public IFigure getConstraintCompartmentFigure() {
+ return getCompartment(CONSTRAINT_COMPARTMENT);
+ }
+
+ /**
+ * Get the Reference's compartment figure
+ *
+ * @return
+ */
+ public IFigure getReferenceCompartmentFigure() {
+ return getCompartment(REFERENCE_COMPARTMENT);
+ }
+
+ /**
+ * Get the Part's compartment figure
+ *
+ * @return
+ */
+ public IFigure getPartCompartmentFigure() {
+ return getCompartment(PART_COMPARTMENT);
+ }
+
+ /**
+ * Get the Value's compartment figure
+ *
+ * @return
+ */
+ public IFigure getValueCompartmentFigure() {
+ return getCompartment(VALUE_COMPARTMENT);
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/BlockNameParser.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/BlockNameParser.java
new file mode 100644
index 00000000000..2448233c93c
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/BlockNameParser.java
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.parsers;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.uml2.uml.UMLPackage;
+
+
+public class BlockNameParser extends SysMLMessageFormatParser {
+
+ public BlockNameParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ @Override
+ protected boolean isValidFeature(EStructuralFeature feature) {
+ return super.isValidFeature(feature) || BlocksPackage.eINSTANCE.getBlock_IsEncapsulated().equals(feature);
+ }
+
+ @Override
+ public String getPrintString(IAdaptable adapter, int flags) {
+ Object element = adapter.getAdapter(EObject.class);
+ StringBuffer sb = new StringBuffer();
+ if(element instanceof Block) {
+ Block block = (Block)element;
+ sb.append("<<Block>>\n");
+ if(block.getBase_Class() != null) {
+ // Set the name
+ sb.append(block.getBase_Class().getName());
+ }
+ if(block.isIsEncapsulated()) {
+ sb.append("\n").append("{encapsulated}");
+ }
+
+ }
+ return sb.toString();
+ }
+
+ @Override
+ protected Object getValue(EObject element, EAttribute feature) {
+ if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) && element instanceof Block) {
+ Block block = (Block)element;
+ return super.getValue(block.getBase_Class(), feature);
+ }
+ return super.getValue(element, feature);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getParseCommand(IAdaptable adapter, Object[] values, int flags) {
+ if(values == null || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ EObject element = (EObject)adapter.getAdapter(EObject.class);
+ if(element instanceof Block) {
+ element = ((Block)element).getBase_Class();
+ }
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
+ if(editingDomain == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
+ for(int i = 0; i < values.length; i++) {
+ command.compose(getModificationCommand(element, editableFeatures[i], values[i]));
+ }
+ return command;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/SysMLMessageFormatParser.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/SysMLMessageFormatParser.java
new file mode 100644
index 00000000000..30d0b624863
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/custom-src/org/eclipse/papyrus/sysml/diagram/blockdiagram/parsers/SysMLMessageFormatParser.java
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.parsers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.diagram.clazz.parsers.MessageFormatParser;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.uml2.uml.UMLPackage;
+
+
+public class SysMLMessageFormatParser extends MessageFormatParser implements ISemanticParser {
+
+ public SysMLMessageFormatParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public SysMLMessageFormatParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ /**
+ *
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /**
+ *
+ */
+ public List getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+ if(element instanceof Block) {
+ Block block = (Block)element;
+ semanticElementsBeingParsed.add(block);
+ semanticElementsBeingParsed.add(block.getBase_Class());
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if(notification instanceof Notification) {
+ Object feature = ((Notification)notification).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature)feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ protected boolean isValidFeature(EStructuralFeature feature) {
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature);
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/obj16/ResourceDiagramFile.gif b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/obj16/ResourceDiagramFile.gif
new file mode 100644
index 00000000000..135bfefa2e3
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/obj16/ResourceDiagramFile.gif
Binary files differ
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/wizban/NewResourceWizard.gif b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/wizban/NewResourceWizard.gif
new file mode 100644
index 00000000000..93641ae9d67
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/icons/wizban/NewResourceWizard.gif
Binary files differ
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/messages.properties b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/messages.properties
new file mode 100644
index 00000000000..8bca7b61559
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/messages.properties
@@ -0,0 +1,69 @@
+
+# TODO: manually put keys and values
+SysmlCreationWizardTitle=New Sysml Diagram
+SysmlCreationWizard_DiagramModelFilePageTitle=Create Sysml Diagram
+SysmlCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model.
+SysmlCreationWizard_DomainModelFilePageTitle=Create Sysml Domain Model
+SysmlCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model.
+SysmlCreationWizardOpenEditorError=Error opening diagram editor
+SysmlCreationWizardCreationError=Creation Problems
+SysmlCreationWizardPageExtensionError=File name should have {0} extension.
+SysmlDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
+SysmlDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
+SysmlDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
+SysmlDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
+SysmlDocumentProvider_isModifiable=Updating cache failed
+SysmlDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
+SysmlDocumentProvider_IncorrectInputError={1}
+SysmlDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
+SysmlDocumentProvider_DiagramLoadingError=Error loading diagram
+SysmlDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
+SysmlDocumentProvider_SaveDiagramTask=Saving diagram
+SysmlDocumentProvider_SaveNextResourceTask=Saving {0}
+SysmlDocumentProvider_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
+SysmlNewDiagramFileWizard_CreationPageName=Initialize new diagram file
+SysmlNewDiagramFileWizard_CreationPageTitle=Diagram file
+SysmlNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
+SysmlNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
+SysmlNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
+SysmlNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
+SysmlNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
+SysmlNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
+SysmlNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
+SysmlNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
+SysmlNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
+SysmlDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
+SysmlDiagramEditor_SaveAsErrorTitle=Problem During Save As...
+SysmlDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
+SysmlDiagramEditor_SaveErrorTitle=Save Problems
+SysmlDiagramEditor_SaveErrorMessage=Could not save file.
+SysmlElementChooserDialog_SelectModelElementTitle=Select model element
+ModelElementSelectionPageMessage=Select model element:
+ValidateActionMessage=Validate
+Element1Group_title=Element
+Element1Group_desc=
+Connector2Group_title=Connector
+Connector2Group_desc=
+Block1CreationTool_title=Block
+Block1CreationTool_desc=Create a block
+
+CommandName_OpenDiagram=Open Diagram
+NavigatorActionProvider_OpenDiagramActionName=Open Diagram
+SysmlModelingAssistantProviderTitle=Select domain model element
+SysmlModelingAssistantProviderMessage=Available domain model elements:
+Misreferencedtools3Group_title=-- Mis-referenced tools --
+Misreferencedtools3Group_desc=Mapping element referenced tools from palette other than one specified in Mapping instance
+Property1CreationTool_title=Property
+Property1CreationTool_desc=Create a new Property
+BlockAttributeCompartmentEditPart_title=properties
+Operation2CreationTool_title=Operation
+Operation2CreationTool_desc=Create an operation
+BlockOperationCompartmentEditPart_title=operations
+BlockConstraintCompartmentEditPart_title=constraints
+BlockPartsCompartmentEditPart_title=parts
+BlockReferencesCompartmentEditPart_title=references
+BlockValuesCompartmentEditPart_title=values \ No newline at end of file
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgen b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgen
new file mode 100644
index 00000000000..97388789483
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgen
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgen:GenEditorGenerator xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel" packageNamePrefix="org.eclipse.papyrus.sysml.diagram.blockdiagram"
+ modelID="BDD"
+ dynamicTemplates="true"
+ templateDirectory="/org.eclipse.papyrus.def/dynamic-templates3.5/codegen">
+ <diagram
+ visualID="1000"
+ editPartClassName="ResourceEditPart"
+ itemSemanticEditPolicyClassName="ResourceItemSemanticEditPolicy"
+ canonicalEditPolicyClassName="ResourceCanonicalEditPolicy"
+ iconProviderPriority="Low"
+ validationProviderPriority="Low">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="ResourceEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:FigureViewmap"
+ figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
+ <domainDiagramElement
+ href="../../../plugin/org.eclipse.papyrus.resource/model/resource.genmodel#//resource/Resource"/>
+ <childNodes
+ visualID="3001"
+ editPartClassName="PropertyEditPart"
+ itemSemanticEditPolicyClassName="PropertyItemSemanticEditPolicy"
+ notationViewFactoryClassName="PropertyViewFactory"
+ canonicalEditPolicyClassName="PropertyCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="PropertyGraphicalNodeEditPolicy"
+ createCommandClassName="PropertyCreateCommand"
+ containers="//@diagram/@compartments.0">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="PropertyEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="PropertyFigureDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PropertyFigureDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PropertyFigureDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#xA;this.setFont(THIS_FONT);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Font THIS_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), &quot;Arial&quot;, 10, org.eclipse.swt.SWT.NORMAL);&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedFont="true"/>
+ </viewmap>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Property"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedAttribute"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedAttribute"/>
+ </modelFacet>
+ </childNodes>
+ <childNodes
+ visualID="3102"
+ editPartClassName="OperationEditPart"
+ itemSemanticEditPolicyClassName="OperationItemSemanticEditPolicy"
+ notationViewFactoryClassName="OperationViewFactory"
+ canonicalEditPolicyClassName="OperationCanonicalEditPolicy"
+ graphicalNodeEditPolicyClassName="OperationGraphicalNodeEditPolicy"
+ createCommandClassName="OperationCreateCommand"
+ containers="//@diagram/@compartments.1">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="OperationEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="OperationFigureDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class OperationFigureDescriptor extends org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public OperationFigureDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;this.setText(&quot;&quot;);&#xA;&#xA;this.setFont(THIS_FONT);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Font THIS_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), &quot;Arial&quot;, 10, org.eclipse.swt.SWT.NORMAL);&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedFont="true"/>
+ </viewmap>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Operation"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class/ownedOperation"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class/ownedOperation"/>
+ </modelFacet>
+ </childNodes>
+ <topLevelNodes
+ visualID="2001"
+ editPartClassName="BlockEditPart"
+ itemSemanticEditPolicyClassName="BlockItemSemanticEditPolicy"
+ notationViewFactoryClassName="BlockViewFactory"
+ canonicalEditPolicyClassName="BlockCanonicalEditPolicy"
+ compartments="//@diagram/@compartments.0 //@diagram/@compartments.1"
+ graphicalNodeEditPolicyClassName="BlockGraphicalNodeEditPolicy"
+ createCommandClassName="BlockCreateCommand">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ editHelperClassName="BlockEditHelper"/>
+ <viewmap
+ xsi:type="gmfgen:InnerClassViewmap"
+ className="ClassifierDescriptor"
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ClassifierDescriptor extends org.eclipse.papyrus.diagram.common.figure.node.CClassifierFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fClassifierNameLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fAttributeCompartmentFigure; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fOperationCompartmentFigure; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fClassifierStereotypeLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fClassifierQualifiedNameLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.draw2d.RectangleFigure fNestedClassifierFigure; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ClassifierDescriptor() {&#xA;&#x9;&#x9;&#x9;&#x9;&#xA;&#xA;&#x9;this.setForegroundColor(THIS_FORE&#xA;);&#xA;&#x9;this.setBackgroundColor(THIS_BACK&#xA;);&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fClassifierStereotypeLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fClassifierStereotypeLabel.setText(&quot;&quot;);&#xA;&#xA;fClassifierStereotypeLabel.setFont(FCLASSIFIERSTEREOTYPELABEL_FONT);&#xA;&#xA;&#xA;&#xA;this.add(fClassifierStereotypeLabel);&#xA;&#xA;&#xA;&#xA;fClassifierNameLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fClassifierNameLabel.setText(&quot;&quot;);&#xA;&#xA;fClassifierNameLabel.setFont(FCLASSIFIERNAMELABEL_FONT);&#xA;&#xA;&#xA;&#xA;this.add(fClassifierNameLabel);&#xA;&#xA;&#xA;&#xA;fClassifierQualifiedNameLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fClassifierQualifiedNameLabel.setText(&quot;&quot;);&#xA;&#xA;fClassifierQualifiedNameLabel.setFont(FCLASSIFIERQUALIFIEDNAMELABEL_FONT);&#xA;&#xA;&#xA;&#xA;this.add(fClassifierQualifiedNameLabel);&#xA;&#xA;&#xA;&#xA;fAttributeCompartmentFigure = new org.eclipse.draw2d.RectangleFigure();&#xA;fAttributeCompartmentFigure.setFill(false);&#xA;fAttributeCompartmentFigure.setLineWidth(1);&#xA;&#xA;this.add(fAttributeCompartmentFigure);&#xA;fAttributeCompartmentFigure.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;fOperationCompartmentFigure = new org.eclipse.draw2d.RectangleFigure();&#xA;fOperationCompartmentFigure.setFill(false);&#xA;fOperationCompartmentFigure.setLineWidth(1);&#xA;&#xA;this.add(fOperationCompartmentFigure);&#xA;fOperationCompartmentFigure.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#xA;fNestedClassifierFigure = new org.eclipse.draw2d.RectangleFigure();&#xA;fNestedClassifierFigure.setFill(false);&#xA;fNestedClassifierFigure.setLineWidth(1);&#xA;&#xA;this.add(fNestedClassifierFigure);&#xA;fNestedClassifierFigure.setLayoutManager(new org.eclipse.draw2d.StackLayout());&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getClassifierNameLabel() {&#xA;&#x9;&#x9;return fClassifierNameLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getAttributeCompartmentFigure() {&#xA;&#x9;&#x9;return fAttributeCompartmentFigure;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getOperationCompartmentFigure() {&#xA;&#x9;&#x9;return fOperationCompartmentFigure;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getClassifierStereotypeLabel() {&#xA;&#x9;&#x9;return fClassifierStereotypeLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getClassifierQualifiedNameLabel() {&#xA;&#x9;&#x9;return fClassifierQualifiedNameLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.draw2d.RectangleFigure getNestedClassifierFigure() {&#xA;&#x9;&#x9;return fNestedClassifierFigure;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Color THIS_FORE = new org.eclipse.swt.graphics.Color(null, 177, 207, 229);&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 235, 248, 255);&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Font FCLASSIFIERSTEREOTYPELABEL_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), &quot;Arial&quot;, 8, org.eclipse.swt.SWT.NORMAL);&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Font FCLASSIFIERNAMELABEL_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), &quot;Arial&quot;, 10, org.eclipse.swt.SWT.BOLD);&#xA;&#xA;/**&#xA; * @generated&#xA; */&#xA;static final org.eclipse.swt.graphics.Font FCLASSIFIERQUALIFIEDNAMELABEL_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), &quot;Arial&quot;, 8, org.eclipse.swt.SWT.ITALIC);&#xA;&#xA;">
+ <attributes
+ xsi:type="gmfgen:StyleAttributes"
+ fixedForeground="true"
+ fixedBackground="true"/>
+ </viewmap>
+ <modelFacet>
+ <metaClass
+ href="../../org.eclipse.papyrus.sysml.converted/model/sysml.genmodel#//sysml/blocks/Block"/>
+ <containmentMetaFeature
+ href="../../../plugin/org.eclipse.papyrus.resource/model/resource.genmodel#//resource/Resource/eobjects"/>
+ <childMetaFeature
+ href="../../../plugin/org.eclipse.papyrus.resource/model/resource.genmodel#//resource/Resource/eobjects"/>
+ </modelFacet>
+ </topLevelNodes>
+ <compartments
+ visualID="7001"
+ editPartClassName="BlockAttributeCompartmentEditPart"
+ itemSemanticEditPolicyClassName="BlockAttributeCompartmentItemSemanticEditPolicy"
+ notationViewFactoryClassName="BlockAttributeCompartmentViewFactory"
+ canonicalEditPolicyClassName="BlockAttributeCompartmentCanonicalEditPolicy"
+ childNodes="//@diagram/@childNodes.0"
+ title="AttributeCompartment"
+ needsTitle="false"
+ node="//@diagram/@topLevelNodes.0">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getAttributeCompartmentFigure"
+ figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
+ </compartments>
+ <compartments
+ visualID="7002"
+ editPartClassName="BlockOperationCompartmentEditPart"
+ itemSemanticEditPolicyClassName="BlockOperationCompartmentItemSemanticEditPolicy"
+ notationViewFactoryClassName="BlockOperationCompartmentViewFactory"
+ canonicalEditPolicyClassName="BlockOperationCompartmentCanonicalEditPolicy"
+ childNodes="//@diagram/@childNodes.1"
+ title="OperationCompartment"
+ needsTitle="false"
+ node="//@diagram/@topLevelNodes.0">
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <viewmap
+ xsi:type="gmfgen:ParentAssignedViewmap"
+ getterName="getOperationCompartmentFigure"
+ figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"/>
+ </compartments>
+ <palette>
+ <groups
+ title="Element"
+ description=""
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ collapse="true">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Block"
+ description="Create a block"
+ largeIconPath="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/blocks/Block.gif"
+ smallIconPath="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/blocks/Block.gif"
+ genNodes="//@diagram/@topLevelNodes.0"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Package"
+ description="Create a Package"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"/>
+ </groups>
+ <groups
+ title="Connector"
+ description=""
+ largeIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ smallIconPath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Association"
+ description="Create an association"
+ largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"
+ smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"/>
+ </groups>
+ <groups
+ title="-- Mis-referenced tools --"
+ description="Mapping element referenced tools from palette other than one specified in Mapping instance">
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Property"
+ description="Create a new Property"
+ genNodes="//@diagram/@childNodes.0"/>
+ <entries
+ xsi:type="gmfgen:ToolEntry"
+ title="Operation"
+ description="Create an operation"
+ genNodes="//@diagram/@childNodes.1"/>
+ </groups>
+ </palette>
+ <preferencePages
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.papyrus.sysml.diagram.general"
+ name="Sysml Diagram">
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.papyrus.sysml.diagram.appearance"
+ name="Appearance"
+ kind="Appearance"/>
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.papyrus.sysml.diagram.connections"
+ name="Connections"
+ kind="Connections"/>
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.papyrus.sysml.diagram.printing"
+ name="Printing"
+ kind="Printing"/>
+ <children
+ xsi:type="gmfgen:GenStandardPreferencePage"
+ iD="org.eclipse.papyrus.sysml.diagram.rulersAndGrid"
+ name="Rulers And Grid"
+ kind="RulersAndGrid"/>
+ </preferencePages>
+ </diagram>
+ <plugin
+ iD="org.eclipse.papyrus.sysml.diagram.blockdiagram"
+ provider="Atos Origin"
+ version="0.7.0.qualifier">
+ <requiredPlugins>org.eclipse.draw2d</requiredPlugins>
+ <requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins>
+ </plugin>
+ <editor/>
+ <navigator>
+ <childReferences
+ child="//@diagram"/>
+ <childReferences
+ parent="//@diagram/@topLevelNodes.0"
+ child="//@diagram/@childNodes.0"/>
+ <childReferences
+ parent="//@diagram/@topLevelNodes.0"
+ child="//@diagram/@childNodes.1"/>
+ <childReferences
+ parent="//@diagram"
+ child="//@diagram/@topLevelNodes.0"/>
+ </navigator>
+ <diagramUpdater/>
+ <propertySheet>
+ <tabs
+ xsi:type="gmfgen:GenStandardPropertyTab"
+ iD="appearance"/>
+ <tabs
+ xsi:type="gmfgen:GenStandardPropertyTab"
+ iD="diagram"/>
+ <tabs
+ xsi:type="gmfgen:GenCustomPropertyTab"
+ iD="domain"
+ label="Core">
+ <filter
+ xsi:type="gmfgen:TypeTabFilter">
+ <types>org.eclipse.gmf.runtime.notation.View</types>
+ <types>org.eclipse.gef.EditPart</types>
+ <generatedTypes>abstractNavigatorItem</generatedTypes>
+ </filter>
+ </tabs>
+ </propertySheet>
+ <domainGenModel
+ href="../../org.eclipse.papyrus.sysml.converted/model/sysml.genmodel#/"/>
+ <contextMenus
+ context="//@diagram">
+ <items
+ xsi:type="gmfgen:LoadResourceAction"/>
+ </contextMenus>
+</gmfgen:GenEditorGenerator>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgraph b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgraph
new file mode 100644
index 00000000000..6c9db7a9664
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfgraph
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="bddCanvas"/>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfmap b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfmap
new file mode 100644
index 00000000000..129f8b056a2
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmfmap
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfmap:Mapping xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings"
+ xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
+ <nodes>
+ <containmentFeature
+ href="../../../plugin/org.eclipse.papyrus.resource/model/resource.ecore#//Resource/eobjects"/>
+ <ownedChild>
+ <domainMetaElement
+ href="../../org.eclipse.papyrus.sysml.converted/model/sysml.ecore#//blocks/Block"/>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="bdd.gmftool#//@palette/@tools.0/@tools.0"/>
+ <diagramNode
+ href="../../org.eclipse.papyrus.diagram.common/model/Classifier.gmfgraph#ClassifierNode"/>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.0">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//StructuredClassifier/ownedAttribute"/>
+ <ownedChild>
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Property"/>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="../../org.eclipse.papyrus.diagram.clazz/model/classdiagram.gmftool#//@palette/@tools.4/@tools.1"/>
+ <diagramNode
+ href="../../org.eclipse.papyrus.diagram.common/model/Classifier.gmfgraph#PropertyDiagramLabel"/>
+ </ownedChild>
+ </children>
+ <children
+ compartment="//@nodes.0/@ownedChild/@compartments.1">
+ <containmentFeature
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Class/ownedOperation"/>
+ <ownedChild>
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Operation"/>
+ <tool
+ xsi:type="gmftool:CreationTool"
+ href="../../org.eclipse.papyrus.diagram.clazz/model/classdiagram.gmftool#//@palette/@tools.4/@tools.2"/>
+ <diagramNode
+ href="../../org.eclipse.papyrus.diagram.common/model/Classifier.gmfgraph#OperationDiagramLabel"/>
+ </ownedChild>
+ </children>
+ <compartments
+ children="//@nodes.0/@ownedChild/@children.0">
+ <compartment
+ href="../../org.eclipse.papyrus.diagram.common/model/Classifier.gmfgraph#AttributeCompartment"/>
+ </compartments>
+ <compartments
+ children="//@nodes.0/@ownedChild/@children.1">
+ <compartment
+ href="../../org.eclipse.papyrus.diagram.common/model/Classifier.gmfgraph#OperationCompartment"/>
+ </compartments>
+ </ownedChild>
+ </nodes>
+ <diagram>
+ <diagramCanvas
+ href="bdd.gmfgraph#bddCanvas"/>
+ <domainModel
+ href="../../org.eclipse.papyrus.sysml.converted/model/sysml.ecore#/"/>
+ <domainMetaElement
+ href="../../../plugin/org.eclipse.papyrus.resource/model/resource.ecore#//Resource"/>
+ <palette
+ href="bdd.gmftool#//@palette"/>
+ </diagram>
+</gmfmap:Mapping>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmftool b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmftool
new file mode 100644
index 00000000000..d7d08f214de
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.gmftool
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gmftool:ToolRegistry xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
+ <palette
+ title="bddPalette"
+ description="Block Definition Diagram Palette">
+ <tools
+ xsi:type="gmftool:ToolGroup"
+ title="Element"
+ description=""
+ collapsible="true">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui"/>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Block"
+ description="Create a block">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/blocks/Block.gif"
+ bundle="platform:/plugin/org.eclipse.papyrus.sysml.edit"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/blocks/Block.gif"
+ bundle="platform:/plugin/org.eclipse.papyrus.sysml.edit"/>
+ </tools>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Package"
+ description="Create a Package">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/full/obj16/Package.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/full/obj16/Package.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit"/>
+ </tools>
+ </tools>
+ <tools
+ xsi:type="gmftool:ToolGroup"
+ title="Connector"
+ description="">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/group.gif"
+ bundle="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui"/>
+ <tools
+ xsi:type="gmftool:CreationTool"
+ title="Association"
+ description="Create an association">
+ <smallIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/full/obj16/Association.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit"/>
+ <largeIcon
+ xsi:type="gmftool:BundleImage"
+ path="/icons/full/obj16/Association.gif"
+ bundle="platform:/plugin/org.eclipse.uml2.uml.edit"/>
+ </tools>
+ </tools>
+ </palette>
+</gmftool:ToolRegistry>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.trace b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.trace
new file mode 100644
index 00000000000..ba763c2fcbe
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/model/bdd.trace
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<trace:TraceModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:trace="http://www.eclipse.org/gmf/2006/Trace">
+ <nodeTraces
+ visualID="2001"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/papyrus/0.7.0/SysML/Blocks' and _eClass_.name = 'Block') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/papyurs/0.7.0/Resource' and _eClass_.name = 'Resource') and _containmentMF_.name = 'eobjects')">
+ <compartmentTraces
+ visualID="7001"
+ queryText="true"/>
+ <compartmentTraces
+ visualID="7002"
+ queryText="true"/>
+ </nodeTraces>
+ <childNodeTraces
+ visualID="3001"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Property') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'StructuredClassifier') and _containmentMF_.name = 'ownedAttribute')"/>
+ <childNodeTraces
+ visualID="3102"
+ queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Operation') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Class') and _containmentMF_.name = 'ownedOperation')"/>
+</trace:TraceModel>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.properties b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.properties
new file mode 100644
index 00000000000..3d5154a2fb9
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.properties
@@ -0,0 +1,41 @@
+pluginName=Sysml Plugin
+providerName=Eclipse.org
+
+editorName=Sysml Diagram Editing
+context.description=Sysml Diagram Editing
+context.name=In Sysml Diagram Editor
+newWizardName=Sysml Diagram
+newWizardDesc=Creates Sysml diagram.
+
+initDiagramActionLabel=Initialize sysml_diagram diagram file
+
+
+navigatorContentName=*.sysml_diagram diagram contents
+domainNavigatorContentName=*.sysml model contents
+update.diagram.name=Update Sysml diagram
+update.diagram.description=Perform Sysml diagram update
+
+
+# Property Sheet
+tab.appearance=Appearance
+tab.diagram=Rulers & Grid
+tab.domain=Core
+
+# Preferences
+prefpage.org.eclipse.papyrus.sysml.diagram.general=Sysml Diagram
+prefpage.org.eclipse.papyrus.sysml.diagram.appearance=Appearance
+prefpage.org.eclipse.papyrus.sysml.diagram.connections=Connections
+prefpage.org.eclipse.papyrus.sysml.diagram.printing=Printing
+prefpage.org.eclipse.papyrus.sysml.diagram.rulersAndGrid=Rulers And Grid
+
+
+# Providers
+metatype.name.Resource_1000=Undefined
+metatype.name.Block_2001=Block
+
+# Commands and menu actions
+cmdcategory.name=Sysml Editor Commands
+cmdcategory.desc=Sysml Editor Commands
+
+metatype.name.Property_3001=Property
+metatype.name.Operation_3102=Operation
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.xml b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.xml
new file mode 100644
index 00000000000..648333c992d
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/plugin.xml
@@ -0,0 +1,1317 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension point="org.eclipse.team.core.fileTypes" id="repo-ftype">
+ <?gmfgen generated="true"?>
+ <fileTypes type="text" extension="sysml_diagram"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.extension_parser" id="resource-factory">
+ <?gmfgen generated="true"?>
+ <parser
+ type="sysml_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.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID"
+ name="%editorName"
+ icon="icons/obj16/ResourceDiagramFile.gif"
+ extensions="sysml_diagram"
+ default="true"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditor"
+ matchingStrategy="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlMatchingStrategy"
+ contributorClass="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.contexts" id="ui-context">
+ <?gmfgen generated="true"?>
+ <context
+ description="%context.description"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.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/ResourceDiagramFile.gif"
+ category="org.eclipse.ui.Examples"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlCreationWizard"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlCreationWizardID">
+ <description>%newWizardDesc</description>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.popupMenus" id="init-diagram-action">
+ <?gmfgen generated="false"?>
+ <!-- FIX Bug 314257-->
+ <!--objectContribution
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.InitDiagram"
+ nameFilter="*.sysml"
+ objectClass="org.eclipse.core.resources.IFile">
+ <action
+ label="%initDiagramActionLabel"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlInitDiagramFileAction"
+ menubarPath="additions"
+ enablesFor="1"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.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="BDDPresentation">
+ <Priority name="Lowest"/>
+ <ViewId id="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID">
+ <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="BDDPresentationIDE">
+ <Priority name="Lowest"/>
+ <ViewId id="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID">
+ <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="BDDRender">
+ <Priority name="Lowest"/>
+ <ViewId id="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID">
+ <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ <GlobalActionId actionId="cut"/>
+ <GlobalActionId actionId="copy"/>
+ <GlobalActionId actionId="paste"/>
+ </ElementType>
+ </ViewId>
+ </GlobalActionHandlerProvider>
+ </extension>
+
+
+
+ <?gmfgen generated="true"?>
+<!-- <extension
+ id="Sysml Plugin.palettedefinition"
+ name="Sysml Plugin Predefined Entries"
+ point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
+
+ <?gmfgen generated="true"?>
+ <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority name="Lowest"/>
+ <contribution
+ factoryClass="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlPaletteFactory">
+ <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
+ <entry
+ defineOnly="true"
+ description="Create a block"
+ id="createBlock1CreationTool"
+ kind="tool"
+ label="Block"
+ large_icon="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/blocks/Block.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/blocks/Block.gif">
+ </entry>
+
+ </contribution>
+ <editor id="org.eclipse.papyrus.sysml.diagram.blockdiagram"/>
+ </paletteProvider>
+
+ </extension>
+
+ <?gmfgen generated="true"?>
+ <extension
+ id="Sysml Plugin.standard"
+ name="Sysml Plugin Standard Palette"
+ point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
+
+ <?gmfgen generated="true"?>
+ <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority name="Low"/>
+ <contribution
+ factoryClass="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlPaletteFactory">
+ <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
+ <entry
+ description=""
+ id="createElement1Group"
+ kind="drawer"
+ label="Element"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="createBlock1CreationTool"
+ path="/createElement1Group">
+ </predefinedEntry>
+ <predefinedEntry
+ id="createPackage2CreationTool"
+ path="/createElement1Group">
+ </predefinedEntry>
+
+ <entry
+ description=""
+ id="createConnector2Group"
+ kind="drawer"
+ label="Connector"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="createAssociation1CreationTool"
+ path="/createConnector2Group">
+ </predefinedEntry>
+
+
+ </contribution>
+ <editor id="org.eclipse.papyrus.sysml.diagram.blockdiagram"/>
+ </paletteProvider>
+
+ </extension>-->
+
+ <extension point="org.eclipse.ui.preferencePages" id="prefpages">
+ <?gmfgen generated="true"?>
+ <page
+ id="org.eclipse.papyrus.preferences.diagrams.BDD"
+ name="BDD Diagram"
+ category="org.eclipse.papyrus.preferences.diagrams"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.DiagramGeneralPreferencePage">
+ </page>
+
+
+
+ <page
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.DiagramPrintingPreferencePage"
+ name="%prefpage.org.eclipse.papyrus.sysml.diagram.printing"
+ category="org.eclipse.papyrus.preferences.diagrams.BDD"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.DiagramPrintingPreferencePage">
+ </page>
+
+ <page
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.DiagramRulersAndGridPreferencePage"
+ name="%prefpage.org.eclipse.papyrus.sysml.diagram.rulersAndGrid"
+ category="org.eclipse.papyrus.preferences.diagrams.BDD"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.DiagramRulersAndGridPreferencePage">
+ </page>
+
+ </extension>
+
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
+ <?gmfgen generated="true"?>
+ <propertyContributor
+ contributorId="org.eclipse.papyrus.sysml.diagram.blockdiagram"
+ labelProvider="org.eclipse.papyrus.sysml.diagram.blockdiagram.sheet.SysmlSheetLabelProvider">
+ <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.papyrus.sysml.diagram.blockdiagram">
+ <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.papyrus.sysml.diagram.blockdiagram">
+ <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.papyrus.sysml.diagram.blockdiagram.sheet.SysmlPropertySection">
+ <input type="org.eclipse.gmf.runtime.notation.View"/>
+ <input type="org.eclipse.gef.EditPart"/>
+ <input type="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem"/>
+ </propertySection>
+ </propertySections>
+ </extension>
+
+
+<?gmfgen generated="true"?>
+<extension point="org.eclipse.ui.preferencePages">
+
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.BDD"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.OperationPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.OperationPreferencePage"
+ name="Operation" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.BDD"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.PropertyPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.PropertyPreferencePage"
+ name="Property" />
+
+
+ <?gmfgen generated="true"?>
+ <page category="org.eclipse.papyrus.preferences.diagrams.BDD"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.BlockPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.BlockPreferencePage"
+ name="Block" />
+
+
+
+
+</extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <?gmfgen generated="true"?>
+ <initializer class="org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences.DiagramPreferenceInitializer"/>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
+ <?gmfgen generated="true"?>
+ <viewProvider class="org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlViewProvider">
+ <Priority name="Low"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="BDD"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="3001,2001,3102,2014,2013,2015,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2016,3002,3003,3004,3015,3031,3016,3005,3006,3007,3008,3020,3021,3022,3023,3024,3025,3017,3009,3010,3011,3012,3013,3014,3026,3027,3018,3019,3028,3029,3030,3032"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4016,4017,4001,4019,4002,4003,4004,4005,4006,4007,4008,4018,4009,4010,4011,4012,4013,4014,4015,4020,4021,4022,4023"/>
+ </viewProvider>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
+ <?gmfgen generated="true"?>
+ <editpartProvider class="org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlEditPartProvider">
+ <Priority name="Lowest"/>
+ <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
+ <method name="getType()" value="BDD"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
+ <method name="getType()" value="2001,3001,3102"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
+ <method name="getType()" value=""/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
+ <method name="getType()" value="5129"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
+ <method name="getType()" value="7001,7002,7003, 7004, 7005, 7006"/>
+ </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.papyrus.sysml.diagram.blockdiagram.providers.SysmlModelingAssistantProvider">
+ <Priority name="Lowest"/>
+ <object class="org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart" id="Resource_1000"/>
+ <object class="org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockEditPart" id="Block_2001"/>
+ <context elements="Resource_1000,Block_2001"/>
+ </modelingAssistantProvider>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
+ <?gmfgen generated="true"?>
+ <IconProvider class="org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlIconProvider">
+ <Priority name="Low"/>
+ </IconProvider>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
+ <?gmfgen generated="true"?>
+ <metamodel nsURI="http://www.eclipse.org/papyurs/0.7.0/Resource">
+ <metamodelType
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.Resource_1000"
+ name="%metatype.name.Resource_1000"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Resource"
+ edithelper="org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers.ResourceEditHelper">
+ <param name="semanticHint" value="1000"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/papyrus/0.7.0/SysML/Blocks">
+ <metamodelType
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.Block_2001"
+ name="%metatype.name.Block_2001"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Block"
+ edithelper="org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers.BlockEditHelper">
+ <param name="semanticHint" value="2001"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.Property_3001"
+ name="%metatype.name.Property_3001"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Property"
+ edithelper="org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers.PropertyEditHelper">
+ <param name="semanticHint" value="3001"/>
+ </metamodelType>
+ </metamodel>
+ <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
+ <metamodelType
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.Operation_3102"
+ name="%metatype.name.Operation_3102"
+ kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+ eclass="Operation"
+ edithelper="org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers.OperationEditHelper">
+ <param name="semanticHint" value="3102"/>
+ </metamodelType>
+ </metamodel>
+ </extension>
+
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
+ <?gmfgen generated="true"?>
+ <clientContext id="org.eclipse.papyrus.sysml.diagram.blockdiagram.TypeContext">
+ <enablement>
+ <test
+ property="org.eclipse.gmf.runtime.emf.core.editingDomain"
+ value="org.eclipse.papyrus.sysml.diagram.blockdiagram.EditingDomain"/>
+ </enablement>
+ </clientContext>
+ <binding context="org.eclipse.papyrus.sysml.diagram.blockdiagram.TypeContext">
+ <elementType ref="org.eclipse.papyrus.sysml.diagram.blockdiagram.Resource_1000"/>
+ <elementType ref="org.eclipse.papyrus.sysml.diagram.blockdiagram.Block_2001"/>
+ <elementType ref="org.eclipse.papyrus.sysml.diagram.blockdiagram.Property_3001"/>
+ <elementType ref="org.eclipse.papyrus.sysml.diagram.blockdiagram.Operation_3102"/>
+ <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.papyrus.sysml.diagram.blockdiagram.URIEditorInputPropertyTester"
+ type="org.eclipse.emf.common.ui.URIEditorInput"
+ namespace="org.eclipse.papyrus.sysml.diagram.blockdiagram"
+ properties="isURIEditorInput"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlUriEditorInputTester">
+ </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.papyrus.sysml.diagram.blockdiagram.resourceContent"/>
+ <contentExtension pattern="org.eclipse.papyrus.sysml.diagram.blockdiagram.domainResourceContent"/>
+ <contentExtension pattern="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigatorLinkHelper"/>
+ </includes>
+ </viewerContentBinding>
+ <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
+ <includes>
+ <actionExtension pattern="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigatorActionProvider"/>
+ </includes>
+ </viewerActionBinding>
+ </extension>
+
+ <extension point="org.eclipse.ui.navigator.navigatorContent" id="navigator-content">
+ <?gmfgen generated="true"?>
+ <navigatorContent
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.resourceContent"
+ name="%navigatorContentName"
+ priority="normal"
+ contentProvider="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorContentProvider"
+ labelProvider="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorLabelProvider"
+ icon="icons/obj16/ResourceDiagramFile.gif"
+ activeByDefault="true">
+ <triggerPoints>
+ <or>
+ <and>
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ <test property="org.eclipse.core.resources.extension" value="sysml_diagram"/>
+ </and>
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem"/>
+ </or>
+ </triggerPoints>
+ <possibleChildren>
+ <or>
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem"/>
+ </or>
+ </possibleChildren>
+ <commonSorter
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigatorSorter"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorSorter">
+ <parentExpression>
+ <or>
+ <and>
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ <test property="org.eclipse.core.resources.extension" value="sysml_diagram"/>
+ </and>
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem"/>
+ </or>
+ </parentExpression>
+ </commonSorter>
+ </navigatorContent>
+ <navigatorContent
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.domainResourceContent"
+ name="%domainNavigatorContentName"
+ priority="normal"
+ contentProvider="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorContentProvider"
+ labelProvider="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorLabelProvider"
+ icon="icons/obj16/ResourceDiagramFile.gif"
+ activeByDefault="true">
+ <triggerPoints>
+ <or>
+ <and>
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ <test property="org.eclipse.core.resources.extension" value="sysml"/>
+ </and>
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem"/>
+ </or>
+ </triggerPoints>
+ <possibleChildren>
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem"/>
+ </possibleChildren>
+ </navigatorContent>
+ <actionProvider
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigatorActionProvider"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorActionProvider">
+ <enablement>
+ <or>
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem"/>
+ </or>
+ </enablement>
+ </actionProvider>
+ </extension>
+
+ <extension point="org.eclipse.ui.navigator.linkHelper" id="navigator-linkhelper">
+ <?gmfgen generated="true"?>
+ <linkHelper
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigatorLinkHelper"
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorLinkHelper">
+ <editorInputEnablement>
+ <and>
+ <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/>
+ <test property="org.eclipse.papyrus.sysml.diagram.blockdiagram.isURIEditorInput"/>
+ </and>
+ </editorInputEnablement>
+ <selectionEnablement>
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem"/>
+ </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.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramUpdateCommand"
+ description="%update.diagram.description"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.updateDiagram"
+ name="%update.diagram.name"/>
+ </extension>
+
+ <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
+ <?gmfgen generated="true"?>
+ <key
+ commandId="org.eclipse.papyrus.sysml.diagram.blockdiagram.updateDiagram"
+ contextId="org.eclipse.papyrus.sysml.diagram.blockdiagram.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.papyrus.sysml.diagram.blockdiagram.LoadResourceAction">
+ <visibleWhen>
+ <and>
+ <with variable="activePartId"><equals value="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID"/></with>
+ <with variable="selection"><iterate ifEmpty="false">
+ <instanceof value="org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart"/>
+ </iterate></with>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+ <extension point="org.eclipse.ui.commands" id="menu-commands">
+ <?gmfgen generated="true"?>
+ <category id="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
+ <command id="org.eclipse.papyrus.sysml.diagram.blockdiagram.LoadResourceAction"
+ name="Load Resource"
+ categoryId="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID"
+ defaultHandler="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.LoadResourceAction"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ description="Create a new Block Definition Diagram"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.creationCommand"
+ name="Create a new Block Definition Diagram">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.sysml.diagram.blockdiagram.BDDCreation"
+ commandId="org.eclipse.papyrus.sysml.diagram.blockdiagram.creationCommand">
+ <activeWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.core.papyrusEditor">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+ </extension>
+
+ <extension
+ point="org.eclipse.papyrus.core.papyrusDiagram">
+ <editorDiagram
+ actionBarContributorId="org.eclipse.papyrus.diagram.common.part.UMLDiagramActionBarContributor"
+ factoryClass="org.eclipse.papyrus.sysml.diagram.blockdiagram.BDDEditorFactory"
+ contextId="com.cea.papyrus.gmf.editor.context">
+ </editorDiagram>
+ <creationCommand
+ creationCommandClass="org.eclipse.papyrus.sysml.diagram.blockdiagram.BDDCreation"
+ id="org.eclipse.papyrus.sysml.diagram.blockdiagram.creationCommand"
+ language="sysml"
+ label="SysML Block Definition Diagram">
+ </creationCommand>
+ </extension>
+
+ <!-- optionally, specify keybindings -->
+ <extension
+ id="PapyrusBDDDiagram.palettedefinition"
+ name="PapyrusBDDDiagram Predefined Entries"
+ point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
+
+ <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority name="Lowest"/>
+ <contribution
+ factoryClass="org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlPaletteFactory">
+ <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
+ <entry
+ defineOnly="true"
+ description="Create a model"
+ id="clazz.tool.model"
+ kind="tool"
+ label="Model"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create new Package"
+ id="clazz.tool.package"
+ kind="tool"
+ label="Package"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a constraint"
+ id="clazz.tool.constraint"
+ kind="tool"
+ label="Constraint"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a constraint link"
+ id="clazz.tool.constraintLink"
+ kind="tool"
+ label="Constraint link"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a comment"
+ id="clazz.tool.comment"
+ kind="tool"
+ label="Comment"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a comment link"
+ id="clazz.tool.commentlink"
+ kind="tool"
+ label="Comment link"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif">
+ </entry>
+<!-- <entry
+ defineOnly="true"
+ description="Create a new Class"
+ id="clazz.tool.class"
+ kind="tool"
+ label="Class"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Class.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Class.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a component"
+ id="clazz.tool.component"
+ kind="tool"
+ label="Component"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Component.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Component.gif">
+ </entry>-->
+ <entry
+ defineOnly="true"
+ description="Create a new DataType"
+ id="clazz.tool.datatype"
+ kind="tool"
+ label="DataType"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DataType.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DataType.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an enumeration"
+ id="clazz.tool.enumeration"
+ kind="tool"
+ label="Enumeration"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Enumeration.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Enumeration.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an interface"
+ id="clazz.tool.interface"
+ kind="tool"
+ label="Interface"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Primitivetype"
+ id="clazz.tool.primitivetype"
+ kind="tool"
+ label="PrimitiveType"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PrimitiveType.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PrimitiveType.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a signal"
+ id="clazz.tool.signal"
+ kind="tool"
+ label="Signal"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Signal.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Signal.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an InstanceSpecification"
+ id="clazz.tool.instancespecification"
+ kind="tool"
+ label="InstanceSpecification"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InstanceSpecification.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InstanceSpecification.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Abstraction"
+ id="clazz.tool.abstraction"
+ kind="tool"
+ label="Abstraction"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an association"
+ id="clazz.tool.association"
+ kind="tool"
+ label="Association"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an association branch"
+ id="clazz.tool.associationbranch"
+ kind="tool"
+ label="AssociationBranch"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="AssociationClass"
+ id="clazz.tool.associationclass"
+ kind="tool"
+ label="AssociationClass"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/AssociationClass.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/AssociationClass.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a dependency"
+ id="clazz.tool.dependency"
+ kind="tool"
+ label="Dependency"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a dependency branch"
+ id="clazz.tool.dependencybranch"
+ kind="tool"
+ label="DependencyBranch"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a elementImport"
+ id="clazz.tool.elementimport"
+ kind="tool"
+ label="ElementImport"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ElementImport.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ElementImport.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description=" Create a generalization"
+ id="clazz.tool.generalization"
+ kind="tool"
+ label="Generalization"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an InterfaceRealization"
+ id="clazz.tool.interfacerealization"
+ kind="tool"
+ label="InterfaceRealization"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description=" Create a packageImport"
+ id="clazz.tool.packageimport"
+ kind="tool"
+ label="PackageImport"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PackageImport.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PackageImport.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a packageMerge"
+ id="clazz.tool.packagemerge"
+ kind="tool"
+ label="PackageMerge"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PackageMerge.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PackageMerge.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a profileApplication"
+ id="clazz.tool.profileapplication"
+ kind="tool"
+ label="ProfileApplication"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ProfileApplication.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ProfileApplication.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Realization"
+ id="clazz.tool.realization"
+ kind="tool"
+ label="Realization"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Realization.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Realization.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a substitution"
+ id="clazz.tool.substitution"
+ kind="tool"
+ label="Substitution"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Substitution.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Substitution.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an Usage"
+ id="clazz.tool.usage"
+ kind="tool"
+ label="Usage"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a TemplateBinding"
+ id="clazz.tool.templatebinding"
+ kind="tool"
+ label="TemplateBinding"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TemplateBinding.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TemplateBinding.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="GeneralizationSet"
+ id="clazz.tool.generalizationset"
+ kind="tool"
+ label="GeneralizationSet"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/GeneralizationSet.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/GeneralizationSet.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an InstanceSpecification"
+ id="clazz.tool.instancespecificationlink"
+ kind="tool"
+ label="InstanceSpecification"
+ large_icon="platform:/plugin/org.eclipse.papyrus.diagram.clazz/icons/obj16/InstanceLink.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.papyrus.diagram.clazz/icons/obj16/InstanceLink.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an ContainmentLink"
+ id="clazz.tool.containmentlink"
+ kind="tool"
+ label="ContainmentLink"
+ large_icon="platform:/plugin/org.eclipse.papyrus.diagram.clazz/icons/obj16/ContainmentConnection.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.papyrus.diagram.clazz/icons/obj16/ContainmentConnection.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a reception"
+ id="clazz.tool.reception"
+ kind="tool"
+ label="Reception"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a new Property"
+ id="clazz.tool.property"
+ kind="tool"
+ label="Property"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an operation"
+ id="clazz.tool.operation"
+ kind="tool"
+ label="Operation"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a Slot"
+ id="clazz.tool.slot"
+ kind="tool"
+ label="Slot"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Slot.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Slot.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create an enumeration literal"
+ id="clazz.tool.enumerationliteral"
+ kind="tool"
+ label="Enumeration literal"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/EnumerationLiteral.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/EnumerationLiteral.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a RedefinableTemplateSignature"
+ id="clazz.tool.redefinabletemplatesignature"
+ kind="tool"
+ label="RedefinableTemplateSignature"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/RedefinableTemplateSignature.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/RedefinableTemplateSignature.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a templateParameter"
+ id="clazz.tool.templateparameter"
+ kind="tool"
+ label="TemplateParameter"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TemplateParameter.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/TemplateParameter.gif">
+ </entry>
+ <entry
+ defineOnly="true"
+ description="Create a ClassifiertemplateParameter"
+ id="clazz.tool.classifiertemplateparameter"
+ kind="tool"
+ label="ClassifierTemplateParameter"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ClassifierTemplateParameter.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/ClassifierTemplateParameter.gif">
+ </entry>
+
+ <entry
+ defineOnly="true"
+ description="Create a block"
+ id="block.tool.block"
+ kind="tool"
+ label="Block"
+ large_icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif"
+ path=""
+ small_icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif">
+ </entry>
+ </contribution>
+ <editor id="org.eclipse.papyrus.sysml.diagram.blockdiagram"/>
+ </paletteProvider>
+
+ </extension>
+
+<extension
+ id="PapyrusUMLClassDiagram.standard"
+ name="PapyrusUMLClassDiagram Standard Palette"
+ point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
+
+ <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority name="Low"/>
+ <contribution
+ factoryClass="org.eclipse.papyrus.diagram.clazz.part.UMLPaletteFactory">
+ <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
+ <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
+ <entry
+ description="Packages and Constraints"
+ id="clazz.group.packages"
+ kind="drawer"
+ label="Packages"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="clazz.tool.model"
+ path="/clazz.group.packages">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.package"
+ path="/clazz.group.packages">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.constraint"
+ path="/clazz.group.packages">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.constraintLink"
+ path="/clazz.group.packages">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.comment"
+ path="/clazz.group.packages">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.commentlink"
+ path="/clazz.group.packages">
+ </predefinedEntry>
+
+ <entry
+ description="All Classifiers"
+ id="clazz.group.classifiers"
+ kind="drawer"
+ label="Classifiers"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="block.tool.block"
+ path="/clazz.group.classifiers">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.datatype"
+ path="/clazz.group.classifiers">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.enumeration"
+ path="/clazz.group.classifiers">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.interface"
+ path="/clazz.group.classifiers">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.primitivetype"
+ path="/clazz.group.classifiers">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.signal"
+ path="/clazz.group.classifiers">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.instancespecification"
+ path="/clazz.group.classifiers">
+ </predefinedEntry>
+
+ <entry
+ description="All Relationships"
+ id="clazz.group.relationships"
+ kind="drawer"
+ label="RelationShips"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="clazz.tool.abstraction"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.association"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.associationbranch"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.associationclass"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.dependency"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.dependencybranch"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.elementimport"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.generalization"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.interfacerealization"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.packageimport"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.packagemerge"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.profileapplication"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.realization"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.substitution"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.usage"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.templatebinding"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.generalizationset"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.instancespecificationlink"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.containmentlink"
+ path="/clazz.group.relationships">
+ </predefinedEntry>
+ <entry
+ description="All Features"
+ id="clazz.group.features"
+ kind="drawer"
+ label="Features"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="clazz.tool.reception"
+ path="/clazz.group.features">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.property"
+ path="/clazz.group.features">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.operation"
+ path="/clazz.group.features">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.slot"
+ path="/clazz.group.features">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.enumerationliteral"
+ path="/clazz.group.features">
+ </predefinedEntry>
+
+ <entry
+ description="Elements to add templates"
+ id="clazz.group.templates"
+ kind="drawer"
+ label="Template"
+ large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="/"
+ small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ </entry>
+
+ <predefinedEntry
+ id="clazz.tool.redefinabletemplatesignature"
+ path="/clazz.group.templates">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.templateparameter"
+ path="/clazz.group.templates">
+ </predefinedEntry>
+ <predefinedEntry
+ id="clazz.tool.classifiertemplateparameter"
+ path="/clazz.group.templates">
+ </predefinedEntry>
+
+ </contribution>
+ <editor id="org.eclipse.papyrus.sysml.diagram.blockdiagram"/>
+ </paletteProvider>
+
+ </extension>
+
+
+<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
+ <?gmfgen generated="true"?>
+ <ParserProvider class="org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlParserProvider">
+ <Priority name="Lowest"/>
+ </ParserProvider>
+ </extension>
+
+
+</plugin>
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/BlockCreateCommand.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/BlockCreateCommand.java
new file mode 100644
index 00000000000..9c6e287d1d9
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/BlockCreateCommand.java
@@ -0,0 +1,150 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.resource.Resource;
+import org.eclipse.papyrus.resource.util.ResourceUtil;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.blocks.BlocksFactory;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.ElementInitializers;
+
+/**
+ * @generated
+ */
+public class BlockCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public BlockCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static BlockCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new BlockCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public BlockCreateCommand(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();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+
+ return true;
+
+ }
+
+ /**
+ * @generated NOT
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Resource owner = ResourceUtil.getResource(getElementToEdit());
+
+ if(owner == null) {
+ return CommandResult.newErrorCommandResult("No resource found"); //$NON-NLS-1$
+ }
+
+ EObject eObject = getElementToEdit();
+ if(eObject instanceof org.eclipse.uml2.uml.Package) {
+ org.eclipse.uml2.uml.Package pack = (org.eclipse.uml2.uml.Package)eObject;
+
+ // Create the base class in the package
+ org.eclipse.uml2.uml.Class clazz = pack.createOwnedClass("", false);
+
+ // Create the block
+ Block block = BlocksFactory.eINSTANCE.createBlock();
+
+ // add the block to the resource
+ owner.getEobjects().add(block);
+
+ // Set the base class
+ block.setBase_Class(clazz);
+
+ doConfigure(block, monitor, info);
+
+ // Init the name
+ ElementInitializers.init_NamedElement(clazz, "block");
+
+ ((CreateElementRequest)getRequest()).setNewElement(block);
+ return CommandResult.newOKCommandResult(block);
+ }
+ return CommandResult.newErrorCommandResult("The container is not a package element"); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Block 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/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/OperationCreateCommand.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/OperationCreateCommand.java
new file mode 100644
index 00000000000..795f8ad0cac
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/OperationCreateCommand.java
@@ -0,0 +1,127 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class OperationCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public OperationCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static OperationCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new OperationCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public OperationCreateCommand(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();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+
+ return true;
+
+ }
+
+ /**
+ * @generated NOT
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Operation newElement = UMLFactory.eINSTANCE.createOperation();
+
+ Block block = (Block)getElementToEdit();
+ org.eclipse.uml2.uml.Class owner = block.getBase_Class();
+ owner.getOwnedOperations().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Operation 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/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/PropertyCreateCommand.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/PropertyCreateCommand.java
new file mode 100644
index 00000000000..830dbb53714
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/PropertyCreateCommand.java
@@ -0,0 +1,129 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.StructuredClassifier;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * @generated
+ */
+public class PropertyCreateCommand extends EditElementCommand {
+
+ /**
+ * @generated
+ */
+ private EClass eClass = null;
+
+ /**
+ * @generated
+ */
+ private EObject eObject = null;
+
+ /**
+ * @generated
+ */
+ public PropertyCreateCommand(CreateElementRequest req, EObject eObject) {
+ super(req.getLabel(), null, req);
+ this.eObject = eObject;
+ this.eClass = eObject != null ? eObject.eClass() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static PropertyCreateCommand create(CreateElementRequest req, EObject eObject) {
+ return new PropertyCreateCommand(req, eObject);
+ }
+
+ /**
+ * @generated
+ */
+ public PropertyCreateCommand(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();
+ }
+ if(container != null) {
+ return container;
+ }
+ return eObject;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean canExecute() {
+
+ return true;
+
+ }
+
+ /**
+ * @generated NOT
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Property newElement = UMLFactory.eINSTANCE.createProperty();
+
+ Block block = (Block)getElementToEdit();
+
+ StructuredClassifier owner = block.getBase_Class();
+ owner.getOwnedAttributes().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest)getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Property 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/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/SysmlReorientConnectionViewCommand.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/SysmlReorientConnectionViewCommand.java
new file mode 100644
index 00000000000..4bbbdaccfb4
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/commands/SysmlReorientConnectionViewCommand.java
@@ -0,0 +1,80 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.commands;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class SysmlReorientConnectionViewCommand extends AbstractTransactionalCommand {
+
+ /**
+ * @generated
+ */
+ private IAdaptable edgeAdaptor;
+
+ /**
+ * @generated
+ */
+ public SysmlReorientConnectionViewCommand(TransactionalEditingDomain editingDomain, String label) {
+ super(editingDomain, label, null);
+ }
+
+ /**
+ * @generated
+ */
+ public List getAffectedFiles() {
+ View view = (View)edgeAdaptor.getAdapter(View.class);
+ if(view != null) {
+ return getWorkspaceFiles(view);
+ }
+ return super.getAffectedFiles();
+ }
+
+ /**
+ * @generated
+ */
+ public IAdaptable getEdgeAdaptor() {
+ return edgeAdaptor;
+ }
+
+ /**
+ * @generated
+ */
+ public void setEdgeAdaptor(IAdaptable edgeAdaptor) {
+ this.edgeAdaptor = edgeAdaptor;
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) {
+ assert null != edgeAdaptor : "Null child in SysmlReorientConnectionViewCommand"; //$NON-NLS-1$
+ Edge edge = (Edge)getEdgeAdaptor().getAdapter(Edge.class);
+ assert null != edge : "Null edge in SysmlReorientConnectionViewCommand"; //$NON-NLS-1$
+ View tempView = edge.getSource();
+ edge.setSource(edge.getTarget());
+ edge.setTarget(tempView);
+ return CommandResult.newOKCommandResult();
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/BlockEditHelper.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/BlockEditHelper.java
new file mode 100644
index 00000000000..23ff0641b93
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/BlockEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class BlockEditHelper extends SysmlBaseEditHelper {
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/OperationEditHelper.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/OperationEditHelper.java
new file mode 100644
index 00000000000..04e3fb3051e
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/OperationEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class OperationEditHelper extends SysmlBaseEditHelper {
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/PropertyEditHelper.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/PropertyEditHelper.java
new file mode 100644
index 00000000000..30c1d7d8eba
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/PropertyEditHelper.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers;
+
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+
+/**
+ * @generated
+ */
+public class PropertyEditHelper extends SysmlBaseEditHelper {
+
+ @Override
+ protected boolean approveRequest(IEditCommandRequest request) {
+ // TODO Auto-generated method stub
+ return super.approveRequest(request);
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/ResourceEditHelper.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/ResourceEditHelper.java
new file mode 100644
index 00000000000..015af407c53
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/ResourceEditHelper.java
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers;
+
+/**
+ * @generated
+ */
+public class ResourceEditHelper extends SysmlBaseEditHelper {
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/SysmlBaseEditHelper.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/SysmlBaseEditHelper.java
new file mode 100644
index 00000000000..9c15d1dd145
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/helpers/SysmlBaseEditHelper.java
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.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 SysmlBaseEditHelper 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/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockAttributeCompartmentEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockAttributeCompartmentEditPart.java
new file mode 100644
index 00000000000..a2f933e5d72
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockAttributeCompartmentEditPart.java
@@ -0,0 +1,143 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+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.editpolicies.ResizableCompartmentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockAttributeCompartmentItemSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.Messages;
+
+/**
+ * @generated
+ */
+public class BlockAttributeCompartmentEditPart
+
+extends ListCompartmentEditPart
+
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 7001;
+
+ /**
+ * @generated
+ */
+ public BlockAttributeCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean hasModelChildrenChanged(Notification evt) {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public String getCompartmentName() {
+ return Messages.BlockAttributeCompartmentEditPart_title;
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure createFigure() {
+ ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
+ result.setTitleVisibility(false);
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new BlockAttributeCompartmentItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+
+ installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockAttributeCompartmentCanonicalEditPolicy());
+
+ }
+
+ /**
+ * @generated
+ */
+ protected void setRatio(Double ratio) {
+ if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ super.setRatio(ratio);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification notification) {
+ Object feature = notification.getFeature();
+ if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ refreshBounds();
+ }
+ super.handleNotificationEvent(notification);
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshBounds() {
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ Dimension size = new Dimension(width, height);
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ Point loc = new Point(x, y);
+ ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshBounds();
+ }
+
+ @Override
+ protected void addSemanticChildrenListeners() {
+ super.addSemanticChildrenListeners();
+ }
+
+ @Override
+ protected boolean modeAutomatic() {
+ return true;
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockConstraintCompartmentEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockConstraintCompartmentEditPart.java
new file mode 100644
index 00000000000..e40ae82e86f
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockConstraintCompartmentEditPart.java
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.Messages;
+
+
+
+public class BlockConstraintCompartmentEditPart extends BlockOperationCompartmentEditPart {
+
+
+ public static final int VISUAL_ID = 7003;
+
+ public BlockConstraintCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ public String getCompartmentName() {
+ return Messages.BlockConstraintCompartmentEditPart_title;
+ }
+
+
+
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockEditPart.java
new file mode 100644
index 00000000000..1d2cb6260b6
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockEditPart.java
@@ -0,0 +1,388 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+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.FigureUtilities;
+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.NodeFigure;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ClassEditPart;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ClassNameEditPart;
+import org.eclipse.papyrus.diagram.clazz.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.diagram.clazz.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.part.BlockNameEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockItemSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.SysMLViewComponentEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.figures.BlockFigure;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+import org.eclipse.uml2.uml.Element;
+
+public class BlockEditPart extends ClassEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 2001;
+
+ /**
+ * @generated
+ */
+ public BlockEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new BlockItemSemanticEditPolicy());
+ 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);
+
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new SysMLViewComponentEditPolicy());
+ removeEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY);
+ }
+
+ /**
+ * @generated
+ */
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ LayoutEditPolicy lep = new LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ /**
+ * @generated NOT
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+
+ if(childEditPart instanceof BlockNameEditPart) {
+ ((BlockNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ return true;
+ }
+
+ if(childEditPart instanceof BlockOperationCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getOperationCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((BlockOperationCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+
+ if(childEditPart instanceof BlockConstraintCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getConstraintCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((BlockConstraintCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockReferenceCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getReferenceCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((BlockReferenceCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockValueCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getValueCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((BlockValueCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockPartCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getPartCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((BlockPartCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockAttributeCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getAttributeCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.add(((BlockAttributeCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+
+
+
+ return false;
+ }
+
+ @Override
+ public Element getUMLElement() {
+ EObject eobject = resolveSemanticElement();
+ if(eobject instanceof Block) {
+ Block block = (Block)eobject;
+ return block.getBase_Class();
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof BlockNameEditPart) {
+ return true;
+ }
+ if(childEditPart instanceof BlockOperationCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getOperationCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((BlockOperationCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockConstraintCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getConstraintCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((BlockConstraintCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockReferenceCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getReferenceCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((BlockReferenceCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockValueCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getValueCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((BlockValueCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockPartCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getPartCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((BlockPartCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+
+ if(childEditPart instanceof BlockAttributeCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getAttributeCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((BlockAttributeCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof BlockOperationCompartmentEditPart) {
+ IFigure pane = getPrimaryShape().getOperationCompartmentFigure();
+ setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
+ pane.remove(((BlockOperationCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ * @generated
+ */
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if(editPart instanceof BlockOperationCompartmentEditPart) {
+ return getPrimaryShape().getOperationCompartmentFigure();
+ }
+ if(editPart instanceof BlockConstraintCompartmentEditPart) {
+ return getPrimaryShape().getConstraintCompartmentFigure();
+ }
+ if(editPart instanceof BlockReferenceCompartmentEditPart) {
+ return getPrimaryShape().getReferenceCompartmentFigure();
+ }
+ if(editPart instanceof BlockValueCompartmentEditPart) {
+ return getPrimaryShape().getValueCompartmentFigure();
+ }
+ if(editPart instanceof BlockPartCompartmentEditPart) {
+ return getPrimaryShape().getPartCompartmentFigure();
+ }
+ if(editPart instanceof BlockAttributeCompartmentEditPart) {
+ return getPrimaryShape().getAttributeCompartmentFigure();
+ }
+ return getContentPane();
+ }
+
+
+ /**
+ * 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 EditPart getTargetEditPart(Request request) {
+ if(request instanceof CreateViewAndElementRequest) {
+ CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest)request).getViewAndElementDescriptor().getCreateElementRequestAdapter();
+ IElementType type = (IElementType)adapter.getAdapter(IElementType.class);
+ if(type == SysmlElementTypes.Property_3001) {
+ return getChildBySemanticHint(SysmlVisualIDRegistry.getType(BlockAttributeCompartmentEditPart.VISUAL_ID));
+ }
+ if(type == SysmlElementTypes.Operation_3102) {
+ return getChildBySemanticHint(SysmlVisualIDRegistry.getType(BlockOperationCompartmentEditPart.VISUAL_ID));
+ }
+ if(type == UMLElementTypes.Constraint_2011) {
+ return getChildBySemanticHint(SysmlVisualIDRegistry.getType(BlockConstraintCompartmentEditPart.VISUAL_ID));
+ }
+ }
+ return super.getTargetEditPart(request);
+ }
+
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ Object result = null;
+
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ String prefColor = null;
+ if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Block", PreferenceConstantHelper.COLOR_LINE);
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Block", PreferenceConstantHelper.COLOR_FONT);
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant("Block", PreferenceConstantHelper.COLOR_FILL);
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor(preferenceStore, prefColor));
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ String prefGradient = PreferenceConstantHelper.getElementConstant("Block", PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ result = new Integer(gradientPreferenceConverter.getTransparency());
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ result = gradientPreferenceConverter.getGradientData();
+ }
+ }
+
+ if(result == null) {
+ result = getStructuralFeatureValue(feature);
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLVisualIDRegistry.getType(ClassNameEditPart.VISUAL_ID));
+ }
+
+ /**
+ * Overrides to add the UML element
+ */
+ @Override
+ protected void addSemanticListeners() {
+ super.addSemanticListeners();
+ addListenerFilter("SemanticUMLElement", this, getUMLElement());
+ }
+
+ /**
+ * Overrides to remove the UML element
+ */
+ @Override
+ protected void removeSemanticListeners() {
+ removeListenerFilter("SemanticUMLElement");
+ super.removeSemanticListeners();
+ }
+
+ /**
+ * Overrides to add text wrap and text justification
+ */
+ @Override
+ protected IFigure createNodeShape() {
+ BlockFigure blockfigure = new BlockFigure();
+ WrappingLabel wrappingLabel = blockfigure.getNameLabel();
+ wrappingLabel.setTextWrap(true);
+ wrappingLabel.setTextJustification(PositionConstants.CENTER);
+ return primaryShape = blockfigure;
+ }
+
+ /**
+ * @generated
+ */
+ public BlockFigure getPrimaryShape() {
+ return (BlockFigure)primaryShape;
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockOperationCompartmentEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockOperationCompartmentEditPart.java
new file mode 100644
index 00000000000..9cc079e28d6
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockOperationCompartmentEditPart.java
@@ -0,0 +1,133 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+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.editpolicies.ResizableCompartmentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockOperationCompartmentItemSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.Messages;
+
+/**
+ * @generated
+ */
+public class BlockOperationCompartmentEditPart
+
+extends ListCompartmentEditPart
+
+{
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 7002;
+
+ /**
+ * @generated
+ */
+ public BlockOperationCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean hasModelChildrenChanged(Notification evt) {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public String getCompartmentName() {
+ return Messages.BlockOperationCompartmentEditPart_title;
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure createFigure() {
+ ResizableCompartmentFigure result = (ResizableCompartmentFigure)super.createFigure();
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new BlockOperationCompartmentItemSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new DragDropEditPolicy());
+
+ //in Papyrus diagrams are not strongly synchronised
+ //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockOperationCompartmentCanonicalEditPolicy());
+
+ }
+
+ /**
+ * @generated
+ */
+ protected void setRatio(Double ratio) {
+ if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ super.setRatio(ratio);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification notification) {
+ Object feature = notification.getFeature();
+ if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ refreshBounds();
+ }
+ super.handleNotificationEvent(notification);
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshBounds() {
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ Dimension size = new Dimension(width, height);
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ Point loc = new Point(x, y);
+ ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshBounds();
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockPartCompartmentEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockPartCompartmentEditPart.java
new file mode 100644
index 00000000000..2090e289d84
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockPartCompartmentEditPart.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.Messages;
+
+
+public class BlockPartCompartmentEditPart extends BlockAttributeCompartmentEditPart {
+
+ public static final int VISUAL_ID = 7004;
+
+ public BlockPartCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ public String getCompartmentName() {
+ return Messages.BlockPartsCompartmentEditPart_title;
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockPartCompartmentCanonicalEditPolicy());
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockReferenceCompartmentEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockReferenceCompartmentEditPart.java
new file mode 100644
index 00000000000..820984234a0
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockReferenceCompartmentEditPart.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.Messages;
+
+
+public class BlockReferenceCompartmentEditPart extends BlockAttributeCompartmentEditPart {
+
+ public static final int VISUAL_ID = 7005;
+
+ public BlockReferenceCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ public String getCompartmentName() {
+ return Messages.BlockReferencesCompartmentEditPart_title;
+ }
+
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockReferenceCompartmentCanonicalEditPolicy());
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockValueCompartmentEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockValueCompartmentEditPart.java
new file mode 100644
index 00000000000..e07da684083
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/BlockValueCompartmentEditPart.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.Messages;
+
+
+public class BlockValueCompartmentEditPart extends BlockAttributeCompartmentEditPart {
+
+ public static final int VISUAL_ID = 7006;
+
+ public BlockValueCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ public String getCompartmentName() {
+ return Messages.BlockValuesCompartmentEditPart_title;
+ }
+
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.BlockValueCompartmentCanonicalEditPolicy());
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/OperationEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/OperationEditPart.java
new file mode 100644
index 00000000000..e95a58c57e3
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/OperationEditPart.java
@@ -0,0 +1,235 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.gmf.runtime.notation.View;
+
+
+/**
+ * @generated
+ */
+public class OperationEditPart extends
+
+org.eclipse.papyrus.diagram.clazz.edit.parts.OperationEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3102;
+
+ /**
+ * @generated
+ */
+ public OperationEditPart(View view) {
+ super(view);
+ }
+
+ // /**
+ // * @generated
+ // */
+ // protected IFigure contentPane;
+ //
+ // /**
+ // * @generated
+ // */
+ // protected IFigure primaryShape;
+ //
+ // /**
+ // * @generated
+ // */
+ // public OperationEditPart(View view) {
+ // super(view);
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // protected void createDefaultEditPolicies() {
+ // super.createDefaultEditPolicies();
+ // installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new OperationItemSemanticEditPolicy());
+ // 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() {
+ // LayoutEditPolicy lep = new LayoutEditPolicy() {
+ //
+ // protected EditPolicy createChildEditPolicy(EditPart child) {
+ // EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ // if(result == null) {
+ // result = new NonResizableEditPolicy();
+ // }
+ // return result;
+ // }
+ //
+ // protected Command getMoveChildrenCommand(Request request) {
+ // return null;
+ // }
+ //
+ // protected Command getCreateCommand(CreateRequest request) {
+ // return null;
+ // }
+ // };
+ // return lep;
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // protected IFigure createNodeShape() {
+ // OperationFigureDescriptor figure = new OperationFigureDescriptor();
+ // return primaryShape = figure;
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // public OperationFigureDescriptor getPrimaryShape() {
+ // return (OperationFigureDescriptor)primaryShape;
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // protected NodeFigure createNodePlate() {
+ // DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(40, 40);
+ // return result;
+ // }
+ //
+ // /**
+ // * Creates figure for this edit part.
+ // *
+ // * Body of this method does not depend on settings in generation model
+ // * so you may safely remove <i>generated</i> tag and modify it.
+ // *
+ // * @generated
+ // */
+ // protected NodeFigure createNodeFigure() {
+ // NodeFigure figure = createNodePlate();
+ // figure.setLayoutManager(new StackLayout());
+ // IFigure shape = createNodeShape();
+ // figure.add(shape);
+ // contentPane = setupContentPane(shape);
+ // return figure;
+ // }
+ //
+ // /**
+ // * Default implementation treats passed figure as content pane.
+ // * Respects layout one may have set for generated figure.
+ // *
+ // * @param nodeShape
+ // * instance of generated figure class
+ // * @generated
+ // */
+ // protected IFigure setupContentPane(IFigure nodeShape) {
+ // return nodeShape; // use nodeShape itself as contentPane
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // public IFigure getContentPane() {
+ // if(contentPane != null) {
+ // return contentPane;
+ // }
+ // return super.getContentPane();
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // protected void setForegroundColor(Color color) {
+ // if(primaryShape != null) {
+ // primaryShape.setForegroundColor(color);
+ // }
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // protected void setLineWidth(int width) {
+ // if(primaryShape instanceof Shape) {
+ // ((Shape)primaryShape).setLineWidth(width);
+ // }
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // protected void setLineType(int style) {
+ // if(primaryShape instanceof Shape) {
+ // ((Shape)primaryShape).setLineStyle(style);
+ // }
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // public class OperationFigureDescriptor extends WrappingLabel {
+ //
+ // /**
+ // * @generated
+ // */
+ // public OperationFigureDescriptor() {
+ // this.setText("");
+ //
+ // this.setFont(THIS_FONT);
+ //
+ // }
+ //
+ // }
+ //
+ // /**
+ // * @generated
+ // */
+ // static final Font THIS_FONT = new Font(Display.getCurrent(), "Arial", 10, SWT.NORMAL);
+ //
+ // /**
+ // * @generated
+ // */
+ // @Override
+ // public Object getPreferredValue(EStructuralFeature feature) {
+ // IPreferenceStore preferenceStore = (IPreferenceStore)getDiagramPreferencesHint().getPreferenceStore();
+ // Object result = null;
+ //
+ // if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor() || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor() || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ // String prefColor = null;
+ // if(feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
+ // prefColor = PreferenceConstantHelper.getElementConstant("Operation", PreferenceConstantHelper.COLOR_LINE);
+ // } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ // prefColor = PreferenceConstantHelper.getElementConstant("Operation", PreferenceConstantHelper.COLOR_FONT);
+ // } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ // prefColor = PreferenceConstantHelper.getElementConstant("Operation", PreferenceConstantHelper.COLOR_FILL);
+ // }
+ // result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)preferenceStore, prefColor));
+ // } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ // String prefGradient = PreferenceConstantHelper.getElementConstant("Operation", PreferenceConstantHelper.COLOR_GRADIENT);
+ // GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
+ // if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
+ // result = new Integer(gradientPreferenceConverter.getTransparency());
+ // } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+ // result = gradientPreferenceConverter.getGradientData();
+ // }
+ // }
+ //
+ // if(result == null) {
+ // result = getStructuralFeatureValue(feature);
+ // }
+ // return result;
+ // }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/PropertyEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/PropertyEditPart.java
new file mode 100644
index 00000000000..e70b4aa21a4
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/PropertyEditPart.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class PropertyEditPart extends
+
+org.eclipse.papyrus.diagram.clazz.edit.parts.PropertyEditPart {
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 3001;
+
+ /**
+ * @generated
+ */
+ protected IFigure contentPane;
+
+ /**
+ * @generated
+ */
+ protected IFigure primaryShape;
+
+ /**
+ * @generated
+ */
+ public PropertyEditPart(View view) {
+ super(view);
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/ResourceEditPart.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/ResourceEditPart.java
new file mode 100644
index 00000000000..73ba0287801
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/ResourceEditPart.java
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
+import org.eclipse.papyrus.diagram.common.util.MDTUtil;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.ResourceItemSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+
+/**
+ * @generated
+ */
+public class ResourceEditPart extends DiagramEditPart {
+
+ /**
+ * @generated
+ */
+ public final static String MODEL_ID = "BDD"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final int VISUAL_ID = 1000;
+
+ /**
+ * @generated
+ */
+ public ResourceEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ResourceItemSemanticEditPolicy());
+
+ //in Papyrus diagrams are not strongly synchronised
+ //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies.ResourceCanonicalEditPolicy());
+
+ // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ protected void handleNotificationEvent(Notification event) {
+
+ super.handleNotificationEvent(event);
+ if(event.getNotifier() instanceof EAnnotation) {
+ EAnnotation eAnnotation = (EAnnotation)event.getNotifier();
+ if(eAnnotation.getSource() != null && eAnnotation.getSource().equals(MDTUtil.FilterViewAndLabelsSource)) {
+ //modification form MOSKitt approach, canonical policies are not called
+ MDTUtil.filterDiagramViews(this.getDiagramView());
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public Object getAdapter(Class adapter) {
+
+ if(adapter != null && adapter.equals(ViewInfo.class)) {
+ return SysmlVisualIDRegistry.getDiagramViewInfo();
+ }
+ return super.getAdapter(adapter);
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/SysmlEditPartFactory.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/SysmlEditPartFactory.java
new file mode 100644
index 00000000000..d40a0a3b801
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/parts/SysmlEditPartFactory.java
@@ -0,0 +1,226 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts;
+
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.papyrus.diagram.common.figure.node.HTMLCornerBentFigure;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.part.BlockNameEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @generated
+ */
+public class SysmlEditPartFactory implements EditPartFactory {
+
+ /**
+ * @generated
+ */
+ public EditPart createEditPart(EditPart context, Object model) {
+ if(model instanceof View) {
+ View view = (View)model;
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+
+ case ResourceEditPart.VISUAL_ID:
+ return new ResourceEditPart(view);
+
+ case BlockEditPart.VISUAL_ID:
+ return new BlockEditPart(view);
+
+ case PropertyEditPart.VISUAL_ID:
+ return new PropertyEditPart(view);
+
+ case OperationEditPart.VISUAL_ID:
+ return new OperationEditPart(view);
+
+ case BlockAttributeCompartmentEditPart.VISUAL_ID:
+ return new BlockAttributeCompartmentEditPart(view);
+
+ case BlockOperationCompartmentEditPart.VISUAL_ID:
+ return new BlockOperationCompartmentEditPart(view);
+
+ case BlockNameEditPart.VISUAL_ID:
+ return new BlockNameEditPart(view);
+
+ case BlockConstraintCompartmentEditPart.VISUAL_ID:
+ return new BlockConstraintCompartmentEditPart(view);
+
+ case BlockValueCompartmentEditPart.VISUAL_ID:
+ return new BlockValueCompartmentEditPart(view);
+
+ case BlockReferenceCompartmentEditPart.VISUAL_ID:
+ return new BlockReferenceCompartmentEditPart(view);
+
+ case BlockPartCompartmentEditPart.VISUAL_ID:
+ return new BlockPartCompartmentEditPart(view);
+
+ }
+ }
+ return createUnrecognizedEditPart(context, model);
+ }
+
+ /**
+ * @generated
+ */
+ private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
+ // Handle creation of unrecognized child node EditParts here
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
+ if(source.getFigure() instanceof HTMLCornerBentFigure) {
+ return new CommentCellEditorLocator((HTMLCornerBentFigure)source.getFigure());
+ } else if(source.getFigure() instanceof WrappingLabel) {
+ return new TextCellEditorLocator((WrappingLabel)source.getFigure());
+ } else {
+ return new LabelCellEditorLocator((Label)source.getFigure());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ static private class CommentCellEditorLocator implements CellEditorLocator {
+
+ /**
+ * @generated
+ */
+ private HTMLCornerBentFigure commentFigure;
+
+ /**
+ * @generated
+ */
+ public CommentCellEditorLocator(HTMLCornerBentFigure commentFigure) {
+ this.commentFigure = commentFigure;
+ }
+
+ /**
+ * @generated
+ */
+ public HTMLCornerBentFigure getCommentFigure() {
+ return commentFigure;
+ }
+
+ /**
+ * @generated
+ */
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getCommentFigure().getBounds().getCopy();
+ getCommentFigure().translateToAbsolute(rect);
+ if(getCommentFigure().getText().length() > 0) {
+ rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
+ }
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ static private class TextCellEditorLocator implements CellEditorLocator {
+
+ /**
+ * @generated
+ */
+ private WrappingLabel wrapLabel;
+
+ /**
+ * @generated
+ */
+ public TextCellEditorLocator(WrappingLabel wrapLabel) {
+ this.wrapLabel = wrapLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getWrapLabel() {
+ return wrapLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getWrapLabel().getTextBounds().getCopy();
+ getWrapLabel().translateToAbsolute(rect);
+ if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
+ rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
+ } else {
+ int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
+ rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
+ }
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private static class LabelCellEditorLocator implements CellEditorLocator {
+
+ /**
+ * @generated
+ */
+ private Label label;
+
+ /**
+ * @generated
+ */
+ public LabelCellEditorLocator(Label label) {
+ this.label = label;
+ }
+
+ /**
+ * @generated
+ */
+ public Label getLabel() {
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getLabel().getTextBounds().getCopy();
+ getLabel().translateToAbsolute(rect);
+ int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
+ rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentCanonicalEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentCanonicalEditPolicy.java
new file mode 100644
index 00000000000..f890caea12b
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentCanonicalEditPolicy.java
@@ -0,0 +1,91 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramUpdater;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlNodeDescriptor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class BlockAttributeCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set<EStructuralFeature> myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = SysmlDiagramUpdater.getBlockAttributeCompartment_7001SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((SysmlNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = SysmlVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case PropertyEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set<EStructuralFeature> getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute());
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getTypedElement_Type());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+
+
+
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentItemSemanticEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..1f5a890e931
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockAttributeCompartmentItemSemanticEditPolicy.java
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.commands.PropertyCreateCommand;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+
+/**
+ * @generated
+ */
+public class BlockAttributeCompartmentItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public BlockAttributeCompartmentItemSemanticEditPolicy() {
+ super(SysmlElementTypes.Block_2001);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if(SysmlElementTypes.Property_3001 == req.getElementType()) {
+ return getGEFWrapper(new PropertyCreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockItemSemanticEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..ffa12e7f396
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockItemSemanticEditPolicy.java
@@ -0,0 +1,125 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.clazz.part.UMLVisualIDRegistry;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockAttributeCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockConstraintCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockOperationCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockPartCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockReferenceCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockValueCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.OperationEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+
+/**
+ * @generated
+ */
+public class BlockItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public BlockItemSemanticEditPolicy() {
+ super(SysmlElementTypes.Block_2001);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: true
+ addDestroyChildNodesCommand(cmd);
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+ /**
+ * @generated
+ */
+ private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
+ View view = (View)getHost().getModel();
+ for(Iterator nit = view.getChildren().iterator(); nit.hasNext();) {
+ Node node = (Node)nit.next();
+ switch(SysmlVisualIDRegistry.getVisualID(node)) {
+ case BlockAttributeCompartmentEditPart.VISUAL_ID:
+ case BlockReferenceCompartmentEditPart.VISUAL_ID:
+ case BlockValueCompartmentEditPart.VISUAL_ID:
+ case BlockPartCompartmentEditPart.VISUAL_ID:
+ for(Iterator cit = node.getChildren().iterator(); cit.hasNext();) {
+ Node cnode = (Node)cit.next();
+ switch(SysmlVisualIDRegistry.getVisualID(cnode)) {
+ case PropertyEditPart.VISUAL_ID:
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: false
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ }
+ }
+ break;
+ case BlockOperationCompartmentEditPart.VISUAL_ID:
+ for(Iterator cit = node.getChildren().iterator(); cit.hasNext();) {
+ Node cnode = (Node)cit.next();
+ switch(SysmlVisualIDRegistry.getVisualID(cnode)) {
+ case OperationEditPart.VISUAL_ID:
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: false
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ }
+ }
+ break;
+ case BlockConstraintCompartmentEditPart.VISUAL_ID:
+ for(Iterator cit = node.getChildren().iterator(); cit.hasNext();) {
+ Node cnode = (Node)cit.next();
+ switch(UMLVisualIDRegistry.getVisualID(cnode)) {
+ case ConstraintEditPart.VISUAL_ID:
+ cmd.add(new DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false))); // directlyOwned: false
+ // don't need explicit deletion of cnode as parent's view deletion would clean child views as well
+ // cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));
+ break;
+ }
+ }
+ break;
+ }
+
+
+ }
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentCanonicalEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentCanonicalEditPolicy.java
new file mode 100644
index 00000000000..e8edafd60c4
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentCanonicalEditPolicy.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.OperationEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramUpdater;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlNodeDescriptor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class BlockOperationCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = SysmlDiagramUpdater.getBlockOperationCompartment_7002SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((SysmlNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = SysmlVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case OperationEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getClass_OwnedOperation());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentItemSemanticEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..efbb20b1c02
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockOperationCompartmentItemSemanticEditPolicy.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.commands.OperationCreateCommand;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+
+/**
+ * @generated
+ */
+public class BlockOperationCompartmentItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public BlockOperationCompartmentItemSemanticEditPolicy() {
+ super(SysmlElementTypes.Block_2001);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if(SysmlElementTypes.Operation_3102 == req.getElementType()) {
+ return getGEFWrapper(new OperationCreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockPartCompartmentCanonicalEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockPartCompartmentCanonicalEditPolicy.java
new file mode 100644
index 00000000000..2f81ed3277b
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockPartCompartmentCanonicalEditPolicy.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramUpdater;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlNodeDescriptor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class BlockPartCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = SysmlDiagramUpdater.getBlockPartCompartment_7004SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((SysmlNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = SysmlVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case PropertyEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockReferenceCompartmentCanonicalEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockReferenceCompartmentCanonicalEditPolicy.java
new file mode 100644
index 00000000000..f80423f921c
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockReferenceCompartmentCanonicalEditPolicy.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramUpdater;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlNodeDescriptor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class BlockReferenceCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = SysmlDiagramUpdater.getBlockReferenceCompartment_7005SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((SysmlNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = SysmlVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case PropertyEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockValueCompartmentCanonicalEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockValueCompartmentCanonicalEditPolicy.java
new file mode 100644
index 00000000000..8902bee69ff
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/BlockValueCompartmentCanonicalEditPolicy.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramUpdater;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlNodeDescriptor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * @generated
+ */
+public class BlockValueCompartmentCanonicalEditPolicy extends CanonicalEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = SysmlDiagramUpdater.getBlockValueCompartment_7006SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((SysmlNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = SysmlVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case PropertyEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/OperationItemSemanticEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/OperationItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..ba3e430a79e
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/OperationItemSemanticEditPolicy.java
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+
+/**
+ * @generated
+ */
+public class OperationItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public OperationItemSemanticEditPolicy() {
+ super(SysmlElementTypes.Operation_3102);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ View view = (View)getHost().getModel();
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
+ cmd.setTransactionNestingEnabled(false);
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation == null) {
+ // there are indirectly referenced children, need extra commands: false
+ addDestroyShortcutsCommand(cmd, view);
+ // delete host element
+ cmd.add(new DestroyElementCommand(req));
+ } else {
+ cmd.add(new DeleteCommand(getEditingDomain(), view));
+ }
+ return getGEFWrapper(cmd.reduce());
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/PropertyItemSemanticEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/PropertyItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..d814ef77018
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/PropertyItemSemanticEditPolicy.java
@@ -0,0 +1,45 @@
+//package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+//
+//import org.eclipse.emf.ecore.EAnnotation;
+//import org.eclipse.gef.commands.Command;
+//import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+//import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+//import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+//import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+//import org.eclipse.gmf.runtime.notation.View;
+//import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+//
+///**
+// * @generated
+// */
+//public class PropertyItemSemanticEditPolicy extends
+// SysmlBaseItemSemanticEditPolicy {
+//
+// /**
+// * @generated
+// */
+// public PropertyItemSemanticEditPolicy() {
+// super(SysmlElementTypes.Property_3001);
+// }
+//
+// /**
+// * @generated
+// */
+// protected Command getDestroyElementCommand(DestroyElementRequest req) {
+// View view = (View) getHost().getModel();
+// CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
+// getEditingDomain(), null);
+// cmd.setTransactionNestingEnabled(false);
+// EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+// if (annotation == null) {
+// // there are indirectly referenced children, need extra commands: false
+// addDestroyShortcutsCommand(cmd, view);
+// // delete host element
+// cmd.add(new DestroyElementCommand(req));
+// } else {
+// cmd.add(new DeleteCommand(getEditingDomain(), view));
+// }
+// return getGEFWrapper(cmd.reduce());
+// }
+//
+//}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceCanonicalEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceCanonicalEditPolicy.java
new file mode 100644
index 00000000000..76c8879eeea
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceCanonicalEditPolicy.java
@@ -0,0 +1,152 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.resource.ResourcePackage;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramUpdater;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlNodeDescriptor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+
+/**
+ * @generated
+ */
+public class ResourceCanonicalEditPolicy extends CanonicalConnectionEditPolicy {
+
+ /**
+ * @generated
+ */
+ Set myFeaturesToSynchronize;
+
+ /**
+ * @generated
+ */
+ protected List getSemanticChildrenList() {
+ View viewObject = (View)getHost().getModel();
+ List result = new LinkedList();
+ for(Iterator it = SysmlDiagramUpdater.getResource_1000SemanticChildren(viewObject).iterator(); it.hasNext();) {
+ result.add(((SysmlNodeDescriptor)it.next()).getModelElement());
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean shouldDeleteView(View view) {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean isOrphaned(Collection semanticChildren, final View view) {
+ int visualID = SysmlVisualIDRegistry.getVisualID(view);
+ switch(visualID) {
+ case BlockEditPart.VISUAL_ID:
+ if(!semanticChildren.contains(view.getElement())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getDefaultFactoryHint() {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Set getFeaturesToSynchronize() {
+ if(myFeaturesToSynchronize == null) {
+ myFeaturesToSynchronize = new HashSet();
+ myFeaturesToSynchronize.add(ResourcePackage.eINSTANCE.getResource_Eobjects());
+ }
+ return myFeaturesToSynchronize;
+ }
+
+ /**
+ * @generated
+ */
+ protected List getSemanticConnectionsList() {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getSourceElement(EObject relationship) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected EObject getTargetElement(EObject relationship) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean shouldIncludeConnection(Edge connector, Collection children) {
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshSemantic() {
+ List createdViews = new LinkedList();
+ createdViews.addAll(refreshSemanticChildren());
+ List createdConnectionViews = new LinkedList();
+ createdConnectionViews.addAll(refreshSemanticConnections());
+
+ if(createdViews.size() > 1) {
+ // perform a layout of the container
+ DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
+ executeCommand(new ICommandProxy(layoutCmd));
+ }
+
+ createdViews.addAll(createdConnectionViews);
+ makeViewsImmutable(createdViews);
+ }
+
+ /**
+ * @generated
+ */
+ private Diagram getDiagram() {
+ return ((View)getHost().getModel()).getDiagram();
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceItemSemanticEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..f3503a405ab
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/ResourceItemSemanticEditPolicy.java
@@ -0,0 +1,77 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.diagram.clazz.edit.policies.ModelItemSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.commands.BlockCreateCommand;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+
+/**
+ * @generated
+ */
+public class ResourceItemSemanticEditPolicy extends ModelItemSemanticEditPolicy {
+
+ /**
+ * @generated
+ */
+ public ResourceItemSemanticEditPolicy() {
+ super();
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ if(SysmlElementTypes.Block_2001 == req.getElementType()) {
+ return getGEFWrapper(new BlockCreateCommand(req));
+ }
+ return super.getCreateCommand(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDuplicateCommand(DuplicateElementsRequest req) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ Diagram currentDiagram = null;
+ if(getHost() instanceof IGraphicalEditPart) {
+ currentDiagram = ((IGraphicalEditPart)getHost()).getNotationView().getDiagram();
+ }
+ return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req, currentDiagram));
+ }
+
+ /**
+ * @generated
+ */
+ private static class DuplicateAnythingCommand extends DuplicateEObjectsCommand {
+
+ private Diagram diagram;
+
+ /**
+ * @generated
+ */
+ public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req, Diagram currentDiagram) {
+ super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap());
+ this.diagram = currentDiagram;
+ }
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlBaseItemSemanticEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlBaseItemSemanticEditPolicy.java
new file mode 100644
index 00000000000..56020895514
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlBaseItemSemanticEditPolicy.java
@@ -0,0 +1,303 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.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.DestroyRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.helpers.SysmlBaseEditHelper;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+
+/**
+ * @generated
+ */
+public class SysmlBaseItemSemanticEditPolicy extends SemanticEditPolicy {
+
+ /**
+ * Extended request data key to hold editpart visual id.
+ *
+ * @generated
+ */
+ public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private final IElementType myElementType;
+
+ /**
+ * @generated
+ */
+ protected SysmlBaseItemSemanticEditPolicy(IElementType elementType) {
+ myElementType = elementType;
+ }
+
+ /**
+ * Extended request data key to hold editpart visual id.
+ * Add visual id of edited editpart to extended data of the request
+ * so command switch can decide what kind of diagram element is being edited.
+ * It is done in those cases when it's not possible to deduce diagram
+ * element kind from domain element.
+ *
+ * @generated
+ */
+ public Command getCommand(Request request) {
+ if(request instanceof ReconnectRequest) {
+ Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
+ if(view instanceof View) {
+ Integer id = new Integer(SysmlVisualIDRegistry.getVisualID((View)view));
+ request.getExtendedData().put(VISUAL_ID_KEY, id);
+ }
+ }
+ return super.getCommand(request);
+ }
+
+ /**
+ * Returns visual id from request parameters.
+ *
+ * @generated
+ */
+ protected int getVisualID(IEditCommandRequest request) {
+ Object id = request.getParameter(VISUAL_ID_KEY);
+ return id instanceof Integer ? ((Integer)id).intValue() : -1;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getSemanticCommand(IEditCommandRequest request) {
+ IEditCommandRequest completedRequest = completeRequest(request);
+ Command semanticCommand = getSemanticCommandSwitch(completedRequest);
+ semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
+ if(completedRequest instanceof DestroyRequest) {
+ DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
+ return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
+ }
+ return semanticCommand;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
+ return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
+ }
+
+ /**
+ * @generated
+ */
+ private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
+ if(editPolicyCommand != null) {
+ ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
+ request.setParameter(SysmlBaseEditHelper.EDIT_POLICY_COMMAND, command);
+ }
+ IElementType requestContextElementType = getContextElementType(request);
+ request.setParameter(SysmlBaseEditHelper.CONTEXT_ELEMENT_TYPE, requestContextElementType);
+ ICommand command = requestContextElementType.getEditCommand(request);
+ request.setParameter(SysmlBaseEditHelper.EDIT_POLICY_COMMAND, null);
+ request.setParameter(SysmlBaseEditHelper.CONTEXT_ELEMENT_TYPE, null);
+ if(command != null) {
+ if(!(command instanceof CompositeTransactionalCommand)) {
+ command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
+ }
+ return new ICommandProxy(command);
+ }
+ return editPolicyCommand;
+ }
+
+ /**
+ * @generated
+ */
+ private IElementType getContextElementType(IEditCommandRequest request) {
+ IElementType requestContextElementType = SysmlElementTypes.getElementType(getVisualID(request));
+ return requestContextElementType != null ? requestContextElementType : myElementType;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
+ if(req instanceof CreateRelationshipRequest) {
+ return getCreateRelationshipCommand((CreateRelationshipRequest)req);
+ } else if(req instanceof CreateElementRequest) {
+ return getCreateCommand((CreateElementRequest)req);
+ } else if(req instanceof ConfigureRequest) {
+ return getConfigureCommand((ConfigureRequest)req);
+ } else if(req instanceof DestroyElementRequest) {
+ return getDestroyElementCommand((DestroyElementRequest)req);
+ } else if(req instanceof DestroyReferenceRequest) {
+ return getDestroyReferenceCommand((DestroyReferenceRequest)req);
+ } else if(req instanceof DuplicateElementsRequest) {
+ return getDuplicateCommand((DuplicateElementsRequest)req);
+ } else if(req instanceof GetEditContextRequest) {
+ return getEditContextCommand((GetEditContextRequest)req);
+ } else if(req instanceof MoveRequest) {
+ return getMoveCommand((MoveRequest)req);
+ } else if(req instanceof ReorientReferenceRelationshipRequest) {
+ return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest)req);
+ } else if(req instanceof ReorientRelationshipRequest) {
+ return getReorientRelationshipCommand((ReorientRelationshipRequest)req);
+ } else if(req instanceof SetRequest) {
+ return getSetCommand((SetRequest)req);
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getConfigureCommand(ConfigureRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCreateCommand(CreateElementRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getSetCommand(SetRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getEditContextCommand(GetEditContextRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getDuplicateCommand(DuplicateElementsRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getMoveCommand(MoveRequest req) {
+
+ return getGEFWrapper(new MoveElementsCommand(req));
+
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * @generated
+ */
+ protected final Command getGEFWrapper(ICommand cmd) {
+ return new ICommandProxy(cmd);
+ }
+
+ /**
+ * Returns editing domain from the host edit part.
+ *
+ * @generated
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ }
+
+ /**
+ * Clean all shortcuts to the host element from the same diagram
+ *
+ * @generated
+ */
+ protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
+ assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
+ for(Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
+ View nextView = (View)it.next();
+ if(nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
+ continue;
+ }
+ cmd.add(new DeleteCommand(getEditingDomain(), nextView));
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static class LinkConstraints {
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextNonResizableEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextNonResizableEditPolicy.java
new file mode 100644
index 00000000000..6f062de2b82
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextNonResizableEditPolicy.java
@@ -0,0 +1,236 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * @generated
+ */
+public class SysmlTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
+
+ /**
+ * @generated
+ */
+ private IFigure selectionFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private IFigure focusFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
+ protected void showPrimarySelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ showSelection();
+ showFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(false);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if(getHostFigure() instanceof Label) {
+ bounds = ((Label)getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createSelectionFeedbackFigure() {
+ if(getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshSelectionFeedback() {
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFocusFeedback() {
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ /**
+ * @generated
+ */
+ private FigureListener getHostPositionListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+
+ /**
+ * @generated
+ */
+ protected List createSelectionHandles() {
+ MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
+ moveHandle.setBorder(null);
+ moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
+ return Collections.singletonList(moveHandle);
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextSelectionEditPolicy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextSelectionEditPolicy.java
new file mode 100644
index 00000000000..f69bda7ca53
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/edit/policies/SysmlTextSelectionEditPolicy.java
@@ -0,0 +1,220 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.policies;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.editpolicies.SelectionEditPolicy;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * @generated
+ */
+public class SysmlTextSelectionEditPolicy extends SelectionEditPolicy {
+
+ /**
+ * @generated
+ */
+ private IFigure selectionFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private IFigure focusFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
+ protected void showPrimarySelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ showSelection();
+ showFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(false);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if(getHostFigure() instanceof Label) {
+ bounds = ((Label)getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createSelectionFeedbackFigure() {
+ if(getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshSelectionFeedback() {
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFocusFeedback() {
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ /**
+ * @generated
+ */
+ private FigureListener getHostPositionListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlAbstractNavigatorItem.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlAbstractNavigatorItem.java
new file mode 100644
index 00000000000..1b8411c7156
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlAbstractNavigatorItem.java
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+
+/**
+ * @generated
+ */
+public abstract class SysmlAbstractNavigatorItem extends PlatformObject {
+
+ /**
+ * @generated
+ */
+ static {
+ final Class[] supportedTypes = new Class[]{ ITabbedPropertySheetPageContributor.class };
+ final ITabbedPropertySheetPageContributor propertySheetPageContributor = new ITabbedPropertySheetPageContributor() {
+
+ public String getContributorId() {
+ return "org.eclipse.papyrus.sysml.diagram.blockdiagram"; //$NON-NLS-1$
+ }
+ };
+ Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if(adaptableObject instanceof org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem && adapterType == ITabbedPropertySheetPageContributor.class) {
+ return propertySheetPageContributor;
+ }
+ return null;
+ }
+
+ public Class[] getAdapterList() {
+ return supportedTypes;
+ }
+ }, org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlAbstractNavigatorItem.class);
+ }
+
+ /**
+ * @generated
+ */
+ private Object myParent;
+
+ /**
+ * @generated
+ */
+ protected SysmlAbstractNavigatorItem(Object parent) {
+ myParent = parent;
+ }
+
+ /**
+ * @generated
+ */
+ public Object getParent() {
+ return myParent;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorContentProvider.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorContentProvider.java
new file mode 100644
index 00000000000..9969d33c3e2
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorContentProvider.java
@@ -0,0 +1,230 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonContentProvider;
+
+/**
+ * @generated
+ */
+public class SysmlDomainNavigatorContentProvider implements ICommonContentProvider {
+
+ /**
+ * @generated
+ */
+ private AdapterFactoryContentProvider myAdapterFctoryContentProvier;
+
+ /**
+ * @generated
+ */
+ private static final Object[] EMPTY_ARRAY = new Object[0];
+
+ /**
+ * @generated
+ */
+ private Viewer myViewer;
+
+ /**
+ * @generated
+ */
+ private AdapterFactoryEditingDomain myEditingDomain;
+
+ /**
+ * @generated
+ */
+ private WorkspaceSynchronizer myWorkspaceSynchronizer;
+
+ /**
+ * @generated
+ */
+ private Runnable myViewerRefreshRunnable;
+
+ /**
+ * @generated
+ */
+ public SysmlDomainNavigatorContentProvider() {
+ myAdapterFctoryContentProvier = new AdapterFactoryContentProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
+ TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+ myEditingDomain = (AdapterFactoryEditingDomain)editingDomain;
+ myEditingDomain.setResourceToReadOnlyMap(new HashMap() {
+
+ public Object get(Object key) {
+ if(!containsKey(key)) {
+ put(key, Boolean.TRUE);
+ }
+ return super.get(key);
+ }
+ });
+ myViewerRefreshRunnable = new Runnable() {
+
+ public void run() {
+ if(myViewer != null) {
+ myViewer.refresh();
+ }
+ }
+ };
+ myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
+
+ public void dispose() {
+ }
+
+ public boolean handleResourceChanged(final Resource resource) {
+ for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ nextResource.unload();
+ }
+ if(myViewer != null) {
+ myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
+ }
+ return true;
+ }
+
+ public boolean handleResourceDeleted(Resource resource) {
+ for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ nextResource.unload();
+ }
+ if(myViewer != null) {
+ myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
+ }
+ return true;
+ }
+
+ public boolean handleResourceMoved(Resource resource, final URI newURI) {
+ for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ nextResource.unload();
+ }
+ if(myViewer != null) {
+ myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
+ }
+ return true;
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ myWorkspaceSynchronizer.dispose();
+ myWorkspaceSynchronizer = null;
+ myViewerRefreshRunnable = null;
+ for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource resource = (Resource)it.next();
+ resource.unload();
+ }
+ ((TransactionalEditingDomain)myEditingDomain).dispose();
+ myEditingDomain = null;
+ }
+
+ /**
+ * @generated
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ myViewer = viewer;
+ }
+
+ /**
+ * @generated
+ */
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ /**
+ * @generated
+ */
+ public void restoreState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public void saveState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public void init(ICommonContentExtensionSite aConfig) {
+ }
+
+ /**
+ * @generated
+ */
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof IFile) {
+ IFile file = (IFile)parentElement;
+ URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+ Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
+ return wrapEObjects(myAdapterFctoryContentProvier.getChildren(resource), parentElement);
+ }
+
+ if(parentElement instanceof SysmlDomainNavigatorItem) {
+ return wrapEObjects(myAdapterFctoryContentProvier.getChildren(((SysmlDomainNavigatorItem)parentElement).getEObject()), parentElement);
+ }
+ return EMPTY_ARRAY;
+ }
+
+ /**
+ * @generated
+ */
+ public Object[] wrapEObjects(Object[] objects, Object parentElement) {
+ Collection result = new ArrayList();
+ for(int i = 0; i < objects.length; i++) {
+ if(objects[i] instanceof EObject) {
+ result.add(new SysmlDomainNavigatorItem((EObject)objects[i], parentElement, myAdapterFctoryContentProvier));
+ }
+ }
+ return result.toArray();
+ }
+
+ /**
+ * @generated
+ */
+ public Object getParent(Object element) {
+ if(element instanceof SysmlAbstractNavigatorItem) {
+ SysmlAbstractNavigatorItem abstractNavigatorItem = (SysmlAbstractNavigatorItem)element;
+ return abstractNavigatorItem.getParent();
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean hasChildren(Object element) {
+ return element instanceof IFile || getChildren(element).length > 0;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorItem.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorItem.java
new file mode 100644
index 00000000000..891102c213a
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorItem.java
@@ -0,0 +1,119 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.IPropertySourceProvider;
+
+/**
+ * @generated
+ */
+public class SysmlDomainNavigatorItem extends PlatformObject {
+
+ /**
+ * @generated
+ */
+ static {
+ final Class[] supportedTypes = new Class[]{ EObject.class, IPropertySource.class };
+ Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if(adaptableObject instanceof org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem) {
+ org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem domainNavigatorItem = (org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem)adaptableObject;
+ EObject eObject = domainNavigatorItem.getEObject();
+ if(adapterType == EObject.class) {
+ return eObject;
+ }
+ if(adapterType == IPropertySource.class) {
+ return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject);
+ }
+ }
+
+ return null;
+ }
+
+ public Class[] getAdapterList() {
+ return supportedTypes;
+ }
+ }, org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem.class);
+ }
+
+ /**
+ * @generated
+ */
+ private Object myParent;
+
+ /**
+ * @generated
+ */
+ private EObject myEObject;
+
+ /**
+ * @generated
+ */
+ private IPropertySourceProvider myPropertySourceProvider;
+
+ /**
+ * @generated
+ */
+ public SysmlDomainNavigatorItem(EObject eObject, Object parent, IPropertySourceProvider propertySourceProvider) {
+ myParent = parent;
+ myEObject = eObject;
+ myPropertySourceProvider = propertySourceProvider;
+ }
+
+ /**
+ * @generated
+ */
+ public Object getParent() {
+ return myParent;
+ }
+
+ /**
+ * @generated
+ */
+ public EObject getEObject() {
+ return myEObject;
+ }
+
+ /**
+ * @generated
+ */
+ public IPropertySourceProvider getPropertySourceProvider() {
+ return myPropertySourceProvider;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean equals(Object obj) {
+ if(obj instanceof org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem) {
+ return EcoreUtil.getURI(getEObject()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlDomainNavigatorItem)obj).getEObject()));
+ }
+ return super.equals(obj);
+ }
+
+ /**
+ * @generated
+ */
+ public int hashCode() {
+ return EcoreUtil.getURI(getEObject()).hashCode();
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorLabelProvider.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorLabelProvider.java
new file mode 100644
index 00000000000..f32671d1b0f
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlDomainNavigatorLabelProvider.java
@@ -0,0 +1,107 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonLabelProvider;
+
+/**
+ * @generated
+ */
+public class SysmlDomainNavigatorLabelProvider implements ICommonLabelProvider {
+
+ /**
+ * @generated
+ */
+ private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider = new AdapterFactoryLabelProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
+
+ /**
+ * @generated
+ */
+ public void init(ICommonContentExtensionSite aConfig) {
+ }
+
+ /**
+ * @generated
+ */
+ public Image getImage(Object element) {
+ if(element instanceof SysmlDomainNavigatorItem) {
+ return myAdapterFactoryLabelProvider.getImage(((SysmlDomainNavigatorItem)element).getEObject());
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public String getText(Object element) {
+ if(element instanceof SysmlDomainNavigatorItem) {
+ return myAdapterFactoryLabelProvider.getText(((SysmlDomainNavigatorItem)element).getEObject());
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public void addListener(ILabelProviderListener listener) {
+ myAdapterFactoryLabelProvider.addListener(listener);
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ myAdapterFactoryLabelProvider.dispose();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ return myAdapterFactoryLabelProvider.isLabelProperty(element, property);
+ }
+
+ /**
+ * @generated
+ */
+ public void removeListener(ILabelProviderListener listener) {
+ myAdapterFactoryLabelProvider.removeListener(listener);
+ }
+
+ /**
+ * @generated
+ */
+ public void restoreState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public void saveState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public String getDescription(Object anElement) {
+ return null;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorActionProvider.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorActionProvider.java
new file mode 100644
index 00000000000..3b4ccaae236
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorActionProvider.java
@@ -0,0 +1,182 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.Messages;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditor;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionConstants;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.ui.part.FileEditorInput;
+
+/**
+ * @generated
+ */
+public class SysmlNavigatorActionProvider extends CommonActionProvider {
+
+ /**
+ * @generated
+ */
+ private boolean myContribute;
+
+ /**
+ * @generated
+ */
+ private OpenDiagramAction myOpenDiagramAction;
+
+ /**
+ * @generated
+ */
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ if(aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
+ myContribute = true;
+ makeActions((ICommonViewerWorkbenchSite)aSite.getViewSite());
+ } else {
+ myContribute = false;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void makeActions(ICommonViewerWorkbenchSite viewerSite) {
+ myOpenDiagramAction = new OpenDiagramAction(viewerSite);
+ }
+
+ /**
+ * @generated
+ */
+ public void fillActionBars(IActionBars actionBars) {
+ if(!myContribute) {
+ return;
+ }
+ IStructuredSelection selection = (IStructuredSelection)getContext().getSelection();
+ myOpenDiagramAction.selectionChanged(selection);
+ if(myOpenDiagramAction.isEnabled()) {
+ actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction);
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void fillContextMenu(IMenuManager menu) {
+ }
+
+ /**
+ * @generated
+ */
+ private class OpenDiagramAction extends Action {
+
+ /**
+ * @generated
+ */
+ private Diagram myDiagram;
+
+ /**
+ * @generated
+ */
+ private ICommonViewerWorkbenchSite myViewerSite;
+
+ /**
+ * @generated
+ */
+ public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) {
+ super(Messages.NavigatorActionProvider_OpenDiagramActionName);
+ myViewerSite = viewerSite;
+ }
+
+ /**
+ * @generated
+ */
+ public final void selectionChanged(IStructuredSelection selection) {
+ myDiagram = null;
+ if(selection.size() == 1) {
+ Object selectedElement = selection.getFirstElement();
+ if(selectedElement instanceof SysmlNavigatorItem) {
+ selectedElement = ((SysmlNavigatorItem)selectedElement).getView();
+ } else if(selectedElement instanceof IAdaptable) {
+ selectedElement = ((IAdaptable)selectedElement).getAdapter(View.class);
+ }
+ if(selectedElement instanceof Diagram) {
+ Diagram diagram = (Diagram)selectedElement;
+ if(ResourceEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(diagram))) {
+ myDiagram = diagram;
+ }
+ }
+ }
+ setEnabled(myDiagram != null);
+ }
+
+ /**
+ * @generated
+ */
+ public void run() {
+ if(myDiagram == null || myDiagram.eResource() == null) {
+ return;
+ }
+
+ IEditorInput editorInput = getEditorInput();
+ IWorkbenchPage page = myViewerSite.getPage();
+ try {
+ page.openEditor(editorInput, SysmlDiagramEditor.ID);
+ } catch (PartInitException e) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Exception while openning diagram", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private IEditorInput getEditorInput() {
+ for(Iterator it = myDiagram.eResource().getContents().iterator(); it.hasNext();) {
+ EObject nextEObject = (EObject)it.next();
+ if(nextEObject == myDiagram) {
+ return new FileEditorInput(WorkspaceSynchronizer.getFile(myDiagram.eResource()));
+ }
+ if(nextEObject instanceof Diagram) {
+ break;
+ }
+ }
+ URI uri = EcoreUtil.getURI(myDiagram);
+ String editorName = uri.lastSegment() + "#" + myDiagram.eResource().getContents().indexOf(myDiagram); //$NON-NLS-1$
+ IEditorInput editorInput = new URIEditorInput(uri, editorName);
+ return editorInput;
+ }
+
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorContentProvider.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorContentProvider.java
new file mode 100644
index 00000000000..1fadc0efaac
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorContentProvider.java
@@ -0,0 +1,405 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockAttributeCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockConstraintCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockOperationCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.OperationEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonContentProvider;
+
+/**
+ * @generated
+ */
+public class SysmlNavigatorContentProvider implements ICommonContentProvider {
+
+ /**
+ * @generated
+ */
+ private static final Object[] EMPTY_ARRAY = new Object[0];
+
+ /**
+ * @generated
+ */
+ private Viewer myViewer;
+
+ /**
+ * @generated
+ */
+ private AdapterFactoryEditingDomain myEditingDomain;
+
+ /**
+ * @generated
+ */
+ private WorkspaceSynchronizer myWorkspaceSynchronizer;
+
+ /**
+ * @generated
+ */
+ private Runnable myViewerRefreshRunnable;
+
+ /**
+ * @generated
+ */
+ public SysmlNavigatorContentProvider() {
+ TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+ myEditingDomain = (AdapterFactoryEditingDomain)editingDomain;
+ myEditingDomain.setResourceToReadOnlyMap(new HashMap() {
+
+ public Object get(Object key) {
+ if(!containsKey(key)) {
+ put(key, Boolean.TRUE);
+ }
+ return super.get(key);
+ }
+ });
+ myViewerRefreshRunnable = new Runnable() {
+
+ public void run() {
+ if(myViewer != null) {
+ myViewer.refresh();
+ }
+ }
+ };
+ myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
+
+ public void dispose() {
+ }
+
+ public boolean handleResourceChanged(final Resource resource) {
+ for(Object element : myEditingDomain.getResourceSet().getResources()) {
+ Resource nextResource = (Resource)element;
+ nextResource.unload();
+ }
+ if(myViewer != null) {
+ myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
+ }
+ return true;
+ }
+
+ public boolean handleResourceDeleted(Resource resource) {
+ for(Object element : myEditingDomain.getResourceSet().getResources()) {
+ Resource nextResource = (Resource)element;
+ nextResource.unload();
+ }
+ if(myViewer != null) {
+ myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
+ }
+ return true;
+ }
+
+ public boolean handleResourceMoved(Resource resource, final URI newURI) {
+ for(Object element : myEditingDomain.getResourceSet().getResources()) {
+ Resource nextResource = (Resource)element;
+ nextResource.unload();
+ }
+ if(myViewer != null) {
+ myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
+ }
+ return true;
+ }
+ });
+ }
+
+ /**
+ *
+ * Papyrus Template
+ * this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ private Object[] getViewChildrenForResourceEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ Collection connectedViews = getChildrenByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(BlockEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ return result.toArray();
+ }
+
+ /**
+ *
+ * Papyrus Template
+ * this method is a modification of gmf code in order to avoid getViewChidreen() method becoming greater than 64kb.
+ *
+ * @generated
+ **/
+ @SuppressWarnings("unchecked")
+ private Object[] getViewChildrenForBlockEditPart(View view, Object parentElement) {
+ Collection result = new ArrayList();
+ Collection connectedViews = getChildrenByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(BlockAttributeCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, SysmlVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(BlockOperationCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, SysmlVisualIDRegistry.getType(OperationEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(BlockConstraintCompartmentEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, SysmlVisualIDRegistry.getType(ConstraintEditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ return result.toArray();
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ myWorkspaceSynchronizer.dispose();
+ myWorkspaceSynchronizer = null;
+ myViewerRefreshRunnable = null;
+ for(Object element : myEditingDomain.getResourceSet().getResources()) {
+ Resource resource = (Resource)element;
+ resource.unload();
+ }
+ ((TransactionalEditingDomain)myEditingDomain).dispose();
+ myEditingDomain = null;
+ }
+
+ /**
+ * @generated
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ myViewer = viewer;
+ }
+
+ /**
+ * @generated
+ */
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ /**
+ * @generated
+ */
+ public void restoreState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public void saveState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public void init(ICommonContentExtensionSite aConfig) {
+ }
+
+ /**
+ * @generated
+ */
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof IFile) {
+ IFile file = (IFile)parentElement;
+ URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+ Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
+ Collection result = new ArrayList();
+ result.addAll(createNavigatorItems(selectViewsByType(resource.getContents(), ResourceEditPart.MODEL_ID), file, false));
+ return result.toArray();
+ }
+
+ if(parentElement instanceof SysmlNavigatorGroup) {
+ SysmlNavigatorGroup group = (SysmlNavigatorGroup)parentElement;
+ return group.getChildren();
+ }
+
+ if(parentElement instanceof SysmlNavigatorItem) {
+ SysmlNavigatorItem navigatorItem = (SysmlNavigatorItem)parentElement;
+ if(navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
+ return EMPTY_ARRAY;
+ }
+ return getViewChildren(navigatorItem.getView(), parentElement);
+ }
+
+ return EMPTY_ARRAY;
+ }
+
+ /**
+ * @generated
+ */
+ private Object[] getViewChildren(View view, Object parentElement) {
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+
+ case ResourceEditPart.VISUAL_ID:
+ {
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForResourceEditPart(view, parentElement);
+
+ }
+
+ case BlockEditPart.VISUAL_ID:
+ {
+
+ //modification of the template to avoid mistake of 65kb.
+ return getViewChildrenForBlockEditPart(view, parentElement);
+
+ }
+
+ }
+ return EMPTY_ARRAY;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection getLinksSourceByType(Collection edges, String type) {
+ Collection result = new ArrayList();
+ for(Iterator it = edges.iterator(); it.hasNext();) {
+ Edge nextEdge = (Edge)it.next();
+ View nextEdgeSource = nextEdge.getSource();
+ if(type.equals(nextEdgeSource.getType()) && isOwnView(nextEdgeSource)) {
+ result.add(nextEdgeSource);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection getLinksTargetByType(Collection edges, String type) {
+ Collection result = new ArrayList();
+ for(Iterator it = edges.iterator(); it.hasNext();) {
+ Edge nextEdge = (Edge)it.next();
+ View nextEdgeTarget = nextEdge.getTarget();
+ if(type.equals(nextEdgeTarget.getType()) && isOwnView(nextEdgeTarget)) {
+ result.add(nextEdgeTarget);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection getOutgoingLinksByType(Collection nodes, String type) {
+ Collection result = new ArrayList();
+ for(Iterator it = nodes.iterator(); it.hasNext();) {
+ View nextNode = (View)it.next();
+ result.addAll(selectViewsByType(nextNode.getSourceEdges(), type));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection getIncomingLinksByType(Collection nodes, String type) {
+ Collection result = new ArrayList();
+ for(Iterator it = nodes.iterator(); it.hasNext();) {
+ View nextNode = (View)it.next();
+ result.addAll(selectViewsByType(nextNode.getTargetEdges(), type));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection getChildrenByType(Collection nodes, String type) {
+ Collection result = new ArrayList();
+ for(Iterator it = nodes.iterator(); it.hasNext();) {
+ View nextNode = (View)it.next();
+ result.addAll(selectViewsByType(nextNode.getChildren(), type));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection getDiagramLinksByType(Collection diagrams, String type) {
+ Collection result = new ArrayList();
+ for(Iterator it = diagrams.iterator(); it.hasNext();) {
+ Diagram nextDiagram = (Diagram)it.next();
+ result.addAll(selectViewsByType(nextDiagram.getEdges(), type));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private Collection selectViewsByType(Collection views, String type) {
+ Collection result = new ArrayList();
+ for(Iterator it = views.iterator(); it.hasNext();) {
+ View nextView = (View)it.next();
+ if(type.equals(nextView.getType()) && isOwnView(nextView)) {
+ result.add(nextView);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ private boolean isOwnView(View view) {
+ return ResourceEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(view));
+ }
+
+ /**
+ * @generated
+ */
+ private Collection createNavigatorItems(Collection views, Object parent, boolean isLeafs) {
+ Collection result = new ArrayList();
+ for(Iterator it = views.iterator(); it.hasNext();) {
+ result.add(new SysmlNavigatorItem((View)it.next(), parent, isLeafs));
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public Object getParent(Object element) {
+ if(element instanceof SysmlAbstractNavigatorItem) {
+ SysmlAbstractNavigatorItem abstractNavigatorItem = (SysmlAbstractNavigatorItem)element;
+ return abstractNavigatorItem.getParent();
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean hasChildren(Object element) {
+ return element instanceof IFile || getChildren(element).length > 0;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorGroup.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorGroup.java
new file mode 100644
index 00000000000..40264f754cd
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorGroup.java
@@ -0,0 +1,110 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+/**
+ * @generated
+ */
+public class SysmlNavigatorGroup extends SysmlAbstractNavigatorItem {
+
+ /**
+ * @generated
+ */
+ private String myGroupName;
+
+ /**
+ * @generated
+ */
+ private String myIcon;
+
+ /**
+ * @generated
+ */
+ private Collection myChildren = new LinkedList();
+
+ /**
+ * @generated
+ */
+ SysmlNavigatorGroup(String groupName, String icon, Object parent) {
+ super(parent);
+ myGroupName = groupName;
+ myIcon = icon;
+ }
+
+ /**
+ * @generated
+ */
+ public String getGroupName() {
+ return myGroupName;
+ }
+
+ /**
+ * @generated
+ */
+ public String getIcon() {
+ return myIcon;
+ }
+
+ /**
+ * @generated
+ */
+ public Object[] getChildren() {
+ return myChildren.toArray();
+ }
+
+ /**
+ * @generated
+ */
+ public void addChildren(Collection children) {
+ myChildren.addAll(children);
+ }
+
+ /**
+ * @generated
+ */
+ public void addChild(Object child) {
+ myChildren.add(child);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isEmpty() {
+ return myChildren.size() == 0;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean equals(Object obj) {
+ if(obj instanceof org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorGroup) {
+ org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorGroup anotherGroup = (org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorGroup)obj;
+ if(getGroupName().equals(anotherGroup.getGroupName())) {
+ return getParent().equals(anotherGroup.getParent());
+ }
+ }
+ return super.equals(obj);
+ }
+
+ /**
+ * @generated
+ */
+ public int hashCode() {
+ return getGroupName().hashCode();
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorItem.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorItem.java
new file mode 100644
index 00000000000..348e8fb77e0
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorItem.java
@@ -0,0 +1,97 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @generated
+ */
+public class SysmlNavigatorItem extends SysmlAbstractNavigatorItem {
+
+ /**
+ * @generated
+ */
+ static {
+ final Class[] supportedTypes = new Class[]{ View.class, EObject.class };
+ Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
+
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if(adaptableObject instanceof org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorItem && (adapterType == View.class || adapterType == EObject.class)) {
+ return ((org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorItem)adaptableObject).getView();
+ }
+ return null;
+ }
+
+ public Class[] getAdapterList() {
+ return supportedTypes;
+ }
+ }, org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorItem.class);
+ }
+
+ /**
+ * @generated
+ */
+ private View myView;
+
+ /**
+ * @generated
+ */
+ private boolean myLeaf = false;
+
+ /**
+ * @generated
+ */
+ public SysmlNavigatorItem(View view, Object parent, boolean isLeaf) {
+ super(parent);
+ myView = view;
+ myLeaf = isLeaf;
+ }
+
+ /**
+ * @generated
+ */
+ public View getView() {
+ return myView;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isLeaf() {
+ return myLeaf;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean equals(Object obj) {
+ if(obj instanceof org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorItem) {
+ return EcoreUtil.getURI(getView()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorItem)obj).getView()));
+ }
+ return super.equals(obj);
+ }
+
+ /**
+ * @generated
+ */
+ public int hashCode() {
+ return EcoreUtil.getURI(getView()).hashCode();
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLabelProvider.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLabelProvider.java
new file mode 100644
index 00000000000..cfc2f9a8565
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLabelProvider.java
@@ -0,0 +1,255 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.jface.viewers.ITreePathLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.ViewerLabel;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.WrappingLabelEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.OperationEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlParserProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonLabelProvider;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+
+/**
+ * @generated
+ */
+public class SysmlNavigatorLabelProvider extends LabelProvider implements ICommonLabelProvider, ITreePathLabelProvider {
+
+ /**
+ * @generated
+ */
+ static {
+ SysmlDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
+ SysmlDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ public void updateLabel(ViewerLabel label, TreePath elementPath) {
+ Object element = elementPath.getLastSegment();
+ if(element instanceof SysmlNavigatorItem && !isOwnView(((SysmlNavigatorItem)element).getView())) {
+ return;
+ }
+ label.setText(getText(element));
+ label.setImage(getImage(element));
+ }
+
+ /**
+ * @generated
+ */
+ public Image getImage(Object element) {
+ if(element instanceof SysmlNavigatorGroup) {
+ SysmlNavigatorGroup group = (SysmlNavigatorGroup)element;
+ return SysmlDiagramEditorPlugin.getInstance().getBundledImage(group.getIcon());
+ }
+
+ if(element instanceof SysmlNavigatorItem) {
+ SysmlNavigatorItem navigatorItem = (SysmlNavigatorItem)element;
+ if(!isOwnView(navigatorItem.getView())) {
+ return super.getImage(element);
+ }
+ return getImage(navigatorItem.getView());
+ }
+
+ return super.getImage(element);
+ }
+
+ /**
+ * @generated
+ */
+ public Image getImage(View view) {
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+ case ResourceEditPart.VISUAL_ID:
+ return getImage("Navigator?Diagram?http://www.eclipse.org/papyurs/0.7.0/Resource?Resource", SysmlElementTypes.Resource_1000); //$NON-NLS-1$
+ case BlockEditPart.VISUAL_ID:
+ return getImage("Navigator?TopLevelNode?http://www.eclipse.org/papyrus/0.7.0/SysML/Blocks?Block", SysmlElementTypes.Block_2001); //$NON-NLS-1$
+ case PropertyEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Property", SysmlElementTypes.Property_3001); //$NON-NLS-1$
+ case OperationEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Operation", SysmlElementTypes.Operation_3102); //$NON-NLS-1$
+ }
+ return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ private Image getImage(String key, IElementType elementType) {
+ ImageRegistry imageRegistry = SysmlDiagramEditorPlugin.getInstance().getImageRegistry();
+ Image image = imageRegistry.get(key);
+ if(image == null && elementType != null && SysmlElementTypes.isKnownElementType(elementType)) {
+ image = SysmlElementTypes.getImage(elementType);
+ imageRegistry.put(key, image);
+ }
+
+ if(image == null) {
+ image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
+ imageRegistry.put(key, image);
+ }
+ return image;
+ }
+
+ /**
+ * @generated
+ */
+ public String getText(Object element) {
+ if(element instanceof SysmlNavigatorGroup) {
+ SysmlNavigatorGroup group = (SysmlNavigatorGroup)element;
+ return group.getGroupName();
+ }
+
+ if(element instanceof SysmlNavigatorItem) {
+ SysmlNavigatorItem navigatorItem = (SysmlNavigatorItem)element;
+ if(!isOwnView(navigatorItem.getView())) {
+ return null;
+ }
+ return getText(navigatorItem.getView());
+ }
+
+ return super.getText(element);
+ }
+
+ /**
+ * @generated
+ */
+ public String getText(View view) {
+ if(view.getElement() != null && view.getElement().eIsProxy()) {
+ return getUnresolvedDomainElementProxyText(view);
+ }
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+ case ResourceEditPart.VISUAL_ID:
+ return getResource_1000Text(view);
+ case BlockEditPart.VISUAL_ID:
+ return getBlock_2001Text(view);
+ case PropertyEditPart.VISUAL_ID:
+ return getProperty_3001Text(view);
+ case OperationEditPart.VISUAL_ID:
+ return getOperation_3102Text(view);
+ }
+ return getUnknownElementText(view);
+ }
+
+ /**
+ * @generated
+ */
+ private String getResource_1000Text(View view) {
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ private String getBlock_2001Text(View view) {
+ IParser parser = SysmlParserProvider.getParser(SysmlElementTypes.Block_2001, view.getElement() != null ? view.getElement() : view, SysmlVisualIDRegistry.getType(WrappingLabelEditPart.VISUAL_ID));
+ if(parser != null) {
+ return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
+ } else {
+ SysmlDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5001); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getProperty_3001Text(View view) {
+ Property domainModelElement = (Property)view.getElement();
+ if(domainModelElement != null) {
+ return String.valueOf(domainModelElement.getName());
+ } else {
+ SysmlDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3001); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getOperation_3102Text(View view) {
+ Operation domainModelElement = (Operation)view.getElement();
+ if(domainModelElement != null) {
+ return String.valueOf(domainModelElement.getName());
+ } else {
+ SysmlDiagramEditorPlugin.getInstance().logError("No domain element for view with visualID = " + 3102); //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private String getUnknownElementText(View view) {
+ return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * @generated
+ */
+ private String getUnresolvedDomainElementProxyText(View view) {
+ return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * @generated
+ */
+ public void init(ICommonContentExtensionSite aConfig) {
+ }
+
+ /**
+ * @generated
+ */
+ public void restoreState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public void saveState(IMemento aMemento) {
+ }
+
+ /**
+ * @generated
+ */
+ public String getDescription(Object anElement) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ private boolean isOwnView(View view) {
+ return ResourceEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(view));
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLinkHelper.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLinkHelper.java
new file mode 100644
index 00000000000..0260101ea48
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorLinkHelper.java
@@ -0,0 +1,128 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.navigator.ILinkHelper;
+import org.eclipse.ui.part.FileEditorInput;
+
+/**
+ * @generated
+ */
+public class SysmlNavigatorLinkHelper implements ILinkHelper {
+
+ /**
+ * @generated
+ */
+ private static IEditorInput getEditorInput(Diagram diagram) {
+ Resource diagramResource = diagram.eResource();
+ for(Iterator it = diagramResource.getContents().iterator(); it.hasNext();) {
+ EObject nextEObject = (EObject)it.next();
+ if(nextEObject == diagram) {
+ return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource));
+ }
+ if(nextEObject instanceof Diagram) {
+ break;
+ }
+ }
+ URI uri = EcoreUtil.getURI(diagram);
+ String editorName = uri.lastSegment() + "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$
+ IEditorInput editorInput = new URIEditorInput(uri, editorName);
+ return editorInput;
+ }
+
+ /**
+ * @generated
+ */
+ public IStructuredSelection findSelection(IEditorInput anInput) {
+ IDiagramDocument document = SysmlDiagramEditorPlugin.getInstance().getDocumentProvider().getDiagramDocument(anInput);
+ if(document == null) {
+ return StructuredSelection.EMPTY;
+ }
+ Diagram diagram = document.getDiagram();
+ IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
+ if(file != null) {
+ SysmlNavigatorItem item = new SysmlNavigatorItem(diagram, file, false);
+ return new StructuredSelection(item);
+ }
+ return StructuredSelection.EMPTY;
+ }
+
+ /**
+ * @generated
+ */
+ public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
+ if(aSelection == null || aSelection.isEmpty()) {
+ return;
+ }
+ if(false == aSelection.getFirstElement() instanceof SysmlAbstractNavigatorItem) {
+ return;
+ }
+
+ SysmlAbstractNavigatorItem abstractNavigatorItem = (SysmlAbstractNavigatorItem)aSelection.getFirstElement();
+ View navigatorView = null;
+ if(abstractNavigatorItem instanceof SysmlNavigatorItem) {
+ navigatorView = ((SysmlNavigatorItem)abstractNavigatorItem).getView();
+ } else if(abstractNavigatorItem instanceof SysmlNavigatorGroup) {
+ SysmlNavigatorGroup navigatorGroup = (SysmlNavigatorGroup)abstractNavigatorItem;
+ if(navigatorGroup.getParent() instanceof SysmlNavigatorItem) {
+ navigatorView = ((SysmlNavigatorItem)navigatorGroup.getParent()).getView();
+ }
+ }
+ if(navigatorView == null) {
+ return;
+ }
+ IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
+ IEditorPart editor = aPage.findEditor(editorInput);
+ if(editor == null) {
+ return;
+ }
+ aPage.bringToTop(editor);
+ if(editor instanceof DiagramEditor) {
+ DiagramEditor diagramEditor = (DiagramEditor)editor;
+ ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
+ EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
+ if(selectedView == null) {
+ return;
+ }
+ GraphicalViewer graphicalViewer = (GraphicalViewer)diagramEditor.getAdapter(GraphicalViewer.class);
+ EditPart selectedEditPart = (EditPart)graphicalViewer.getEditPartRegistry().get(selectedView);
+ if(selectedEditPart != null) {
+ graphicalViewer.select(selectedEditPart);
+ }
+ }
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorSorter.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorSorter.java
new file mode 100644
index 00000000000..9e4e7f81721
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/navigator/SysmlNavigatorSorter.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator;
+
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry;
+
+/**
+ * @generated
+ */
+public class SysmlNavigatorSorter extends ViewerSorter {
+
+ /**
+ * @generated
+ */
+ private static final int GROUP_CATEGORY = 7004;
+
+ /**
+ * @generated
+ */
+ public int category(Object element) {
+ if(element instanceof SysmlNavigatorItem) {
+ SysmlNavigatorItem item = (SysmlNavigatorItem)element;
+ return SysmlVisualIDRegistry.getVisualID(item.getView());
+ }
+ return GROUP_CATEGORY;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DeleteElementAction.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DeleteElementAction.java
new file mode 100644
index 00000000000..b9a11a152bc
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DeleteElementAction.java
@@ -0,0 +1,96 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.actions.AbstractDeleteFromAction;
+import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @generated
+ */
+public class DeleteElementAction extends AbstractDeleteFromAction {
+
+ /**
+ * @generated
+ */
+ public DeleteElementAction(IWorkbenchPart part) {
+ super(part);
+ }
+
+ /**
+ * @generated
+ */
+ public DeleteElementAction(IWorkbenchPage workbenchPage) {
+ super(workbenchPage);
+ }
+
+ /**
+ * @generated
+ */
+ public void init() {
+ super.init();
+ setId(ActionIds.ACTION_DELETE_FROM_MODEL);
+ setText(DiagramUIMessages.DiagramEditor_Delete_from_Model);
+ setToolTipText(DiagramUIMessages.DiagramEditor_Delete_from_ModelToolTip);
+ ISharedImages workbenchImages = PlatformUI.getWorkbench().getSharedImages();
+ setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+ setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+ setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
+ }
+
+ /**
+ * @generated
+ */
+ protected String getCommandLabel() {
+ return DiagramUIMessages.DiagramEditor_Delete_from_Model;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command getCommand(Request request) {
+ List operationSet = getOperationSet();
+ if(operationSet.isEmpty()) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ Iterator editParts = operationSet.iterator();
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(getEditingDomain(), getCommandLabel());
+ while(editParts.hasNext()) {
+ EditPart editPart = (EditPart)editParts.next();
+ Command curCommand = editPart.getCommand(request);
+ if(curCommand != null) {
+ command.compose(new CommandProxy(curCommand));
+ }
+ }
+ if(command.isEmpty() || command.size() != operationSet.size()) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ return new ICommandProxy(command);
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DiagramEditorContextMenuProvider.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DiagramEditorContextMenuProvider.java
new file mode 100644
index 00000000000..e6f68190a07
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/DiagramEditorContextMenuProvider.java
@@ -0,0 +1,79 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService;
+import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
+import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @generated
+ */
+public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider {
+
+ /**
+ * @generated
+ */
+ private IWorkbenchPart part;
+
+ /**
+ * @generated
+ */
+ private DeleteElementAction deleteAction;
+
+ /**
+ * @generated
+ */
+ public DiagramEditorContextMenuProvider(IWorkbenchPart part, EditPartViewer viewer) {
+ super(part, viewer);
+ this.part = part;
+ deleteAction = new DeleteElementAction(part);
+ deleteAction.init();
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ if(deleteAction != null) {
+ deleteAction.dispose();
+ deleteAction = null;
+ }
+ super.dispose();
+ }
+
+ /**
+ * @generated
+ */
+ public void buildContextMenu(final IMenuManager menu) {
+ getViewer().flush();
+ try {
+ TransactionUtil.getEditingDomain((EObject)getViewer().getContents().getModel()).runExclusive(new Runnable() {
+
+ public void run() {
+ ContributionItemService.getInstance().contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
+ menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
+ menu.appendToGroup("editGroup", deleteAction);
+ }
+ });
+ } catch (Exception e) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
+ }
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/LoadResourceAction.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/LoadResourceAction.java
new file mode 100644
index 00000000000..162cdb9b9c8
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/LoadResourceAction.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * @generated
+ */
+public class LoadResourceAction extends AbstractHandler {
+
+ /**
+ * @generated
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
+ Shell shell = diagramEditor.getEditorSite().getShell();
+ assert diagramEditor instanceof DiagramEditor;
+ TransactionalEditingDomain editingDomain = ((DiagramEditor)diagramEditor).getEditingDomain();
+ org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
+ loadResourceDialog.open();
+ return null;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/Messages.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/Messages.java
new file mode 100644
index 00000000000..2b1cf33653e
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/Messages.java
@@ -0,0 +1,356 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @generated
+ */
+public class Messages extends NLS {
+
+ /**
+ * @generated
+ */
+ static {
+ NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ private Messages() {
+ }
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizardTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizard_DiagramModelFilePageTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizard_DiagramModelFilePageDescription;
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizard_DomainModelFilePageTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizard_DomainModelFilePageDescription;
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizardOpenEditorError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizardCreationError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlCreationWizardPageExtensionError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditorUtil_OpenModelResourceErrorDialogTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditorUtil_OpenModelResourceErrorDialogMessage;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditorUtil_CreateDiagramProgressTask;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditorUtil_CreateDiagramCommandLabel;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_isModifiable;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_handleElementContentChanged;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_IncorrectInputError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_NoDiagramInResourceError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_DiagramLoadingError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_UnsynchronizedFileSaveError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_SaveDiagramTask;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_SaveNextResourceTask;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDocumentProvider_SaveAsOperation;
+
+ /**
+ * @generated
+ */
+ public static String InitDiagramFile_ResourceErrorDialogTitle;
+
+ /**
+ * @generated
+ */
+ public static String InitDiagramFile_ResourceErrorDialogMessage;
+
+ /**
+ * @generated
+ */
+ public static String InitDiagramFile_WizardTitle;
+
+ /**
+ * @generated
+ */
+ public static String InitDiagramFile_OpenModelFileDialogTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_CreationPageName;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_CreationPageTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_CreationPageDescription;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_RootSelectionPageName;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_RootSelectionPageTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_RootSelectionPageDescription;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_RootSelectionPageSelectionTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_RootSelectionPageNoSelectionMessage;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_InitDiagramCommand;
+
+ /**
+ * @generated
+ */
+ public static String SysmlNewDiagramFileWizard_IncorrectRootError;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditor_SavingDeletedFile;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditor_SaveAsErrorTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditor_SaveAsErrorMessage;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditor_SaveErrorTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlDiagramEditor_SaveErrorMessage;
+
+ /**
+ * @generated
+ */
+ public static String SysmlElementChooserDialog_SelectModelElementTitle;
+
+ /**
+ * @generated
+ */
+ public static String ModelElementSelectionPageMessage;
+
+ /**
+ * @generated
+ */
+ public static String ValidateActionMessage;
+
+ /**
+ * @generated
+ */
+ public static String Element1Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Element1Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Connector2Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Connector2Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Misreferencedtools3Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Misreferencedtools3Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Block1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Block1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Property1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Property1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Operation2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Operation2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String BlockAttributeCompartmentEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String BlockOperationCompartmentEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String CommandName_OpenDiagram;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorActionProvider_OpenDiagramActionName;
+
+ /**
+ * @generated
+ */
+ public static String SysmlModelingAssistantProviderTitle;
+
+ /**
+ * @generated
+ */
+ public static String SysmlModelingAssistantProviderMessage;
+
+ //TODO: put accessor fields manually
+
+ public static String BlockConstraintCompartmentEditPart_title;
+
+ public static String BlockPartsCompartmentEditPart_title;
+
+ public static String BlockReferencesCompartmentEditPart_title;
+
+ public static String BlockValuesCompartmentEditPart_title;
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/ModelElementSelectionPage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/ModelElementSelectionPage.java
new file mode 100644
index 00000000000..f04c5f9a5f1
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/ModelElementSelectionPage.java
@@ -0,0 +1,156 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.edit.provider.IWrapperItemProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * Wizard page that allows to select element from model.
+ *
+ * @generated
+ */
+public class ModelElementSelectionPage extends WizardPage {
+
+ /**
+ * @generated
+ */
+ protected EObject selectedModelElement;
+
+ /**
+ * @generated
+ */
+ private TreeViewer modelViewer;
+
+ /**
+ * @generated
+ */
+ public ModelElementSelectionPage(String pageName) {
+ super(pageName);
+ }
+
+ /**
+ * @generated
+ */
+ public EObject getModelElement() {
+ return selectedModelElement;
+ }
+
+ /**
+ * @generated
+ */
+ public void setModelElement(EObject modelElement) {
+ selectedModelElement = modelElement;
+ if(modelViewer != null) {
+ if(selectedModelElement != null) {
+ modelViewer.setInput(selectedModelElement.eResource());
+ modelViewer.setSelection(new StructuredSelection(selectedModelElement));
+ } else {
+ modelViewer.setInput(null);
+ }
+ setPageComplete(validatePage());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+
+ Composite plate = new Composite(parent, SWT.NONE);
+ plate.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ plate.setLayout(layout);
+ setControl(plate);
+
+ Label label = new Label(plate, SWT.NONE);
+ label.setText(getSelectionTitle());
+ label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+
+ modelViewer = new TreeViewer(plate, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ GridData layoutData = new GridData(GridData.FILL_BOTH);
+ layoutData.heightHint = 300;
+ layoutData.widthHint = 300;
+ modelViewer.getTree().setLayoutData(layoutData);
+ modelViewer.setContentProvider(new AdapterFactoryContentProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
+ modelViewer.setLabelProvider(new AdapterFactoryLabelProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
+ if(selectedModelElement != null) {
+ modelViewer.setInput(selectedModelElement.eResource());
+ modelViewer.setSelection(new StructuredSelection(selectedModelElement));
+ }
+ modelViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ ModelElementSelectionPage.this.updateSelection((IStructuredSelection)event.getSelection());
+ }
+ });
+
+ setPageComplete(validatePage());
+ }
+
+ /**
+ * Override to provide custom model element description.
+ *
+ * @generated
+ */
+ protected String getSelectionTitle() {
+ return Messages.ModelElementSelectionPageMessage;
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateSelection(IStructuredSelection selection) {
+ selectedModelElement = null;
+ if(selection.size() == 1) {
+ Object selectedElement = selection.getFirstElement();
+ if(selectedElement instanceof IWrapperItemProvider) {
+ selectedElement = ((IWrapperItemProvider)selectedElement).getValue();
+ }
+ if(selectedElement instanceof FeatureMap.Entry) {
+ selectedElement = ((FeatureMap.Entry)selectedElement).getValue();
+ }
+ if(selectedElement instanceof EObject) {
+ selectedModelElement = (EObject)selectedElement;
+ }
+ }
+ setPageComplete(validatePage());
+ }
+
+ /**
+ * Override to provide specific validation of the selected model element.
+ *
+ * @generated
+ */
+ protected boolean validatePage() {
+ return true;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizard.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizard.java
new file mode 100644
index 00000000000..b23b6136a3a
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizard.java
@@ -0,0 +1,167 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+/**
+ * @generated
+ */
+public class SysmlCreationWizard extends Wizard implements INewWizard {
+
+ /**
+ * @generated
+ */
+ private IWorkbench workbench;
+
+ /**
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * @generated
+ */
+ protected SysmlCreationWizardPage diagramModelFilePage;
+
+ /**
+ * @generated
+ */
+ protected SysmlCreationWizardPage domainModelFilePage;
+
+ /**
+ * @generated
+ */
+ protected Resource diagram;
+
+ /**
+ * @generated
+ */
+ private boolean openNewlyCreatedDiagramEditor = true;
+
+ /**
+ * @generated
+ */
+ public IWorkbench getWorkbench() {
+ return workbench;
+ }
+
+ /**
+ * @generated
+ */
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ /**
+ * @generated
+ */
+ public final Resource getDiagram() {
+ return diagram;
+ }
+
+ /**
+ * @generated
+ */
+ public final boolean isOpenNewlyCreatedDiagramEditor() {
+ return openNewlyCreatedDiagramEditor;
+ }
+
+ /**
+ * @generated
+ */
+ public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
+ this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
+ }
+
+ /**
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(Messages.SysmlCreationWizardTitle);
+ setDefaultPageImageDescriptor(SysmlDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewResourceWizard.gif")); //$NON-NLS-1$
+ setNeedsProgressMonitor(true);
+ }
+
+ /**
+ * @generated
+ */
+ public void addPages() {
+ diagramModelFilePage = new SysmlCreationWizardPage("DiagramModelFile", getSelection(), "sysml_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
+ diagramModelFilePage.setTitle(Messages.SysmlCreationWizard_DiagramModelFilePageTitle);
+ diagramModelFilePage.setDescription(Messages.SysmlCreationWizard_DiagramModelFilePageDescription);
+ addPage(diagramModelFilePage);
+
+ domainModelFilePage = new SysmlCreationWizardPage("DomainModelFile", getSelection(), "sysml") { //$NON-NLS-1$ //$NON-NLS-2$
+
+ public void setVisible(boolean visible) {
+ if(visible) {
+ String fileName = diagramModelFilePage.getFileName();
+ fileName = fileName.substring(0, fileName.length() - ".sysml_diagram".length()); //$NON-NLS-1$
+ setFileName(SysmlDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName, "sysml")); //$NON-NLS-1$
+ }
+ super.setVisible(visible);
+ }
+ };
+ domainModelFilePage.setTitle(Messages.SysmlCreationWizard_DomainModelFilePageTitle);
+ domainModelFilePage.setDescription(Messages.SysmlCreationWizard_DomainModelFilePageDescription);
+ addPage(domainModelFilePage);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean performFinish() {
+ IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
+
+ protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
+ diagram = SysmlDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(), domainModelFilePage.getURI(), monitor);
+ if(isOpenNewlyCreatedDiagramEditor() && diagram != null) {
+ try {
+ SysmlDiagramEditorUtil.openDiagram(diagram);
+ } catch (PartInitException e) {
+ ErrorDialog.openError(getContainer().getShell(), Messages.SysmlCreationWizardOpenEditorError, null, e.getStatus());
+ }
+ }
+ }
+ };
+ try {
+ getContainer().run(false, true, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ if(e.getTargetException() instanceof CoreException) {
+ ErrorDialog.openError(getContainer().getShell(), Messages.SysmlCreationWizardCreationError, null, ((CoreException)e.getTargetException()).getStatus());
+ } else {
+ SysmlDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
+ }
+ return false;
+ }
+ return diagram != null;
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizardPage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizardPage.java
new file mode 100644
index 00000000000..30bd451f7d4
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlCreationWizardPage.java
@@ -0,0 +1,96 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+/**
+ * @generated
+ */
+public class SysmlCreationWizardPage extends WizardNewFileCreationPage {
+
+ /**
+ * @generated
+ */
+ private final String fileExtension;
+
+ /**
+ * @generated
+ */
+ public SysmlCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) {
+ super(pageName, selection);
+ this.fileExtension = fileExtension;
+ }
+
+ /**
+ * Override to create files with this extension.
+ *
+ * @generated
+ */
+ protected String getExtension() {
+ return fileExtension;
+ }
+
+ /**
+ * @generated
+ */
+ public URI getURI() {
+ return URI.createPlatformResourceURI(getFilePath().toString(), false);
+ }
+
+ /**
+ * @generated
+ */
+ protected IPath getFilePath() {
+ IPath path = getContainerFullPath();
+ if(path == null) {
+ path = new Path(""); //$NON-NLS-1$
+ }
+ String fileName = getFileName();
+ if(fileName != null) {
+ path = path.append(fileName);
+ }
+ return path;
+ }
+
+ /**
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ setFileName(SysmlDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
+ setPageComplete(validatePage());
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean validatePage() {
+ if(!super.validatePage()) {
+ return false;
+ }
+ String extension = getExtension();
+ if(extension != null && !getFilePath().toString().endsWith("." + extension)) {
+ setErrorMessage(NLS.bind(Messages.SysmlCreationWizardPageExtensionError, extension));
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramActionBarContributor.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramActionBarContributor.java
new file mode 100644
index 00000000000..f38aefb57b2
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramActionBarContributor.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * @generated
+ */
+public class SysmlDiagramActionBarContributor extends DiagramActionBarContributor {
+
+ /**
+ * @generated
+ */
+ protected Class getEditorClass() {
+ return SysmlDiagramEditor.class;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getEditorId() {
+ return SysmlDiagramEditor.ID;
+ }
+
+ /**
+ * @generated
+ */
+ public void init(IActionBars bars, IWorkbenchPage page) {
+ super.init(bars, page);
+ // print preview
+ IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
+ assert fileMenu != null;
+ fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditor.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditor.java
new file mode 100644
index 00000000000..5d74fba0e47
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditor.java
@@ -0,0 +1,552 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.util.EventObject;
+
+import org.eclipse.core.commands.operations.IUndoableOperation;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.KeyHandler;
+import org.eclipse.gef.Tool;
+import org.eclipse.gef.commands.CommandStackListener;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.ui.palette.PaletteViewer;
+import org.eclipse.gef.ui.palette.PaletteViewerProvider;
+import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
+import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent;
+import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
+import org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDragSourceListener;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.core.adaptor.gmf.GmfMultiDiagramDocumentProvider;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.diagram.clazz.part.UMLDiagramEditorPlugin;
+import org.eclipse.papyrus.diagram.common.listeners.DropTargetListener;
+import org.eclipse.papyrus.diagram.common.part.PapyrusPaletteContextMenuProvider;
+import org.eclipse.papyrus.diagram.common.part.PapyrusPaletteViewer;
+import org.eclipse.papyrus.diagram.common.service.PapyrusPaletteService;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.navigator.SysmlNavigatorItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.navigator.resources.ProjectExplorer;
+import org.eclipse.ui.part.IShowInTargetList;
+import org.eclipse.ui.part.ShowInContext;
+
+/**
+ * @generated
+ */
+public class SysmlDiagramEditor extends DiagramDocumentEditor implements IProviderChangeListener, IGotoMarker {
+
+ /**
+ * @generated
+ */
+ public static final String ID = "org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorID"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final String CONTEXT_ID = "org.eclipse.papyrus.sysml.diagram.blockdiagram.ui.diagramContext"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ private KeyHandler paletteKeyHandler = null;
+
+ /**
+ * @generated
+ */
+ private MouseListener paletteMouseListener = null;
+
+ /**
+ * @generated
+ */
+ private IUndoableOperation savedOperation = null;
+
+ /**
+ * @generated
+ */
+ private TransactionalEditingDomain editingDomain;
+
+ /**
+ * @generated
+ */
+ private IDocumentProvider documentProvider;
+
+ /**
+ * @generated
+ */
+ private Diagram diagram;
+
+ /**
+ * @generated
+ */
+ public SysmlDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
+ super(true);
+ this.diagram = diagram;
+
+ // adds a listener to the palette service, which reacts to palette customizations
+ PapyrusPaletteService.getInstance().addProviderChangeListener(this);
+
+ // Share the same editing provider
+ editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
+ documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
+
+ // overrides editing domain created by super constructor
+ setDocumentProvider(documentProvider);
+
+ }
+
+ /**
+ * @generated
+ */
+ protected String getContextID() {
+ return CONTEXT_ID;
+ }
+
+ /**
+ * @generated
+ */
+ protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
+ PaletteRoot paletteRoot;
+ if(existingPaletteRoot == null) {
+ paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
+ } else {
+ PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
+ paletteRoot = existingPaletteRoot;
+ }
+ applyCustomizationsToPalette(paletteRoot);
+ return paletteRoot;
+ }
+
+ /**
+ * @generated NOT
+ */
+ protected PreferencesHint getPreferencesHint() {
+ return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
+ }
+
+ /**
+ * @generated
+ */
+ public String getContributorId() {
+ return SysmlDiagramEditorPlugin.ID;
+ }
+
+ /**
+ * @generated
+ */
+ public Object getAdapter(Class type) {
+ if(type == IShowInTargetList.class) {
+ return new IShowInTargetList() {
+
+ public String[] getShowInTargetIds() {
+ return new String[]{ ProjectExplorer.VIEW_ID };
+ }
+ };
+ }
+ return super.getAdapter(type);
+ }
+
+ /**
+ * @generated
+ */
+ protected final IDocumentProvider getDocumentProvider(IEditorInput input) {
+ return documentProvider;
+ }
+
+ /**
+ * @generated
+ */
+ public TransactionalEditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * @generated
+ */
+ protected final void setDocumentProvider(IEditorInput input) {
+ // Already set in the constructor
+ }
+
+ /**
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ MarkerNavigationService.getInstance().gotoMarker(this, marker);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public void doSaveAs() {
+ performSaveAs(new NullProgressMonitor());
+ }
+
+ /**
+ * @generated
+ */
+ protected void performSaveAs(IProgressMonitor progressMonitor) {
+ // Nothing
+ }
+
+ /**
+ * @generated
+ */
+ public ShowInContext getShowInContext() {
+ return new ShowInContext(getEditorInput(), getNavigatorSelection());
+ }
+
+ /**
+ * @generated
+ */
+ private ISelection getNavigatorSelection() {
+ IDiagramDocument document = getDiagramDocument();
+ if(document == null) {
+ return StructuredSelection.EMPTY;
+ }
+ Diagram diagram = document.getDiagram();
+ IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
+ if(file != null) {
+ SysmlNavigatorItem item = new SysmlNavigatorItem(diagram, file, false);
+ return new StructuredSelection(item);
+ }
+ return StructuredSelection.EMPTY;
+ }
+
+ /**
+ * @generated
+ */
+ protected void configureGraphicalViewer() {
+ super.configureGraphicalViewer();
+ DiagramEditorContextMenuProvider provider = new DiagramEditorContextMenuProvider(this, getDiagramGraphicalViewer());
+ getDiagramGraphicalViewer().setContextMenu(provider);
+ getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
+ }
+
+ /**
+ * @generated
+ */
+ protected TransactionalEditingDomain createEditingDomain() {
+ // Already configured
+ return editingDomain;
+ }
+
+ /**
+ * @generated
+ */
+ protected void configureDiagramEditDomain() {
+ super.configureDiagramEditDomain();
+ getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new CommandStackListener() {
+
+ public void commandStackChanged(EventObject event) {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ });
+ }
+
+ /**
+ * @generated
+ */
+ public void doSave(IProgressMonitor progressMonitor) {
+ // The saving of the resource is done by the CoreMultiDiagramEditor
+ savedOperation = getOperationHistory().getUndoOperation(getUndoContext());
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isDirty() {
+ IUndoableOperation op = getOperationHistory().getUndoOperation(getUndoContext());
+ return savedOperation != op;
+ }
+
+ /**
+ * @generated
+ */
+ public void providerChanged(ProviderChangeEvent event) {
+ // update the palette if the palette service has changed
+ if(PapyrusPaletteService.getInstance().equals(event.getSource())) {
+ PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this, getDefaultPaletteContent());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ // remove palette service listener
+ // remove preference listener
+ PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
+
+ super.dispose();
+ }
+
+ /**
+ * @generated
+ */
+ protected PaletteViewer getPaletteViewer() {
+ return getEditDomain().getPaletteViewer();
+ }
+
+ /**
+ * @generated
+ */
+ protected PaletteViewer constructPaletteViewer() {
+ return new PapyrusPaletteViewer();
+ }
+
+ /**
+ * @generated
+ */
+ protected PaletteViewerProvider createPaletteViewerProvider() {
+ getEditDomain().setPaletteRoot(createPaletteRoot(null));
+ return new PaletteViewerProvider(getEditDomain()) {
+
+ /**
+ * Override to provide the additional behavior for the tools. Will intialize with a
+ * PaletteEditPartFactory that has a TrackDragger that understand how to handle the
+ * mouseDoubleClick event for shape creation tools. Also will initialize the palette
+ * with a defaultTool that is the SelectToolEx that undestands how to handle the enter
+ * key which will result in the creation of the shape also.
+ */
+ protected void configurePaletteViewer(PaletteViewer viewer) {
+ super.configurePaletteViewer(viewer);
+
+ // customize menu...
+ viewer.setContextMenu(new PapyrusPaletteContextMenuProvider(viewer));
+
+ viewer.getKeyHandler().setParent(getPaletteKeyHandler());
+ viewer.getControl().addMouseListener(getPaletteMouseListener());
+
+ // Add a transfer drag target listener that is supported on
+ // palette template entries whose template is a creation tool.
+ // This will enable drag and drop of the palette shape creation
+ // tools.
+ viewer.addDragSourceListener(new PaletteToolTransferDragSourceListener(viewer));
+ viewer.setCustomizer(createPaletteCustomizer());
+ }
+
+ public PaletteViewer createPaletteViewer(Composite parent) {
+ PaletteViewer pViewer = constructPaletteViewer();
+ pViewer.createControl(parent);
+ configurePaletteViewer(pViewer);
+ hookPaletteViewer(pViewer);
+ return pViewer;
+ }
+
+ /**
+ * @return Palette Key Handler for the palette
+ */
+ private KeyHandler getPaletteKeyHandler() {
+
+ if(paletteKeyHandler == null) {
+
+ paletteKeyHandler = new KeyHandler() {
+
+ /**
+ * Processes a <i>key released </i> event. This method is called by the Tool
+ * whenever a key is released, and the Tool is in the proper state. Override
+ * to support pressing the enter key to create a shape or connection
+ * (between two selected shapes)
+ *
+ * @param event
+ * the KeyEvent
+ * @return <code>true</code> if KeyEvent was handled in some way
+ */
+ public boolean keyReleased(KeyEvent event) {
+
+ if(event.keyCode == SWT.Selection) {
+
+ Tool tool = getPaletteViewer().getActiveTool().createTool();
+
+ if(toolSupportsAccessibility(tool)) {
+
+ tool.keyUp(event, getDiagramGraphicalViewer());
+
+ // deactivate current selection
+ getPaletteViewer().setActiveTool(null);
+
+ return true;
+ }
+
+ }
+ return super.keyReleased(event);
+ }
+
+ };
+
+ }
+ return paletteKeyHandler;
+ }
+
+ /**
+ * @return Palette Mouse listener for the palette
+ */
+ private MouseListener getPaletteMouseListener() {
+
+ if(paletteMouseListener == null) {
+
+ paletteMouseListener = new MouseListener() {
+
+ /**
+ * Flag to indicate that the current active tool should be cleared after a
+ * mouse double-click event.
+ */
+ private boolean clearActiveTool = false;
+
+ /**
+ * Override to support double-clicking a palette tool entry to create a
+ * shape or connection (between two selected shapes).
+ *
+ * @see MouseListener#mouseDoubleClick(MouseEvent)
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+ Tool tool = getPaletteViewer().getActiveTool().createTool();
+
+ if(toolSupportsAccessibility(tool)) {
+
+ tool.setViewer(getDiagramGraphicalViewer());
+ tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
+ tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
+
+ // Current active tool should be deactivated,
+ // but if it is down here it will get
+ // reactivated deep in GEF palette code after
+ // receiving mouse up events.
+ clearActiveTool = true;
+ }
+ }
+
+ public void mouseDown(MouseEvent e) {
+ // do nothing
+ }
+
+ public void mouseUp(MouseEvent e) {
+ // Deactivate current active tool here if a
+ // double-click was handled.
+ if(clearActiveTool) {
+ getPaletteViewer().setActiveTool(null);
+ clearActiveTool = false;
+ }
+
+ }
+ };
+
+ }
+ return paletteMouseListener;
+ }
+
+ };
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public GraphicalViewer getGraphicalViewer() {
+ return super.getGraphicalViewer();
+ }
+
+ /**
+ * @generated
+ */
+ public Diagram getDiagram() {
+ return diagram;
+ }
+
+ /**
+ * @generated
+ */
+ public void setDiagram(Diagram diagram) {
+ this.diagram = diagram;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void initializeGraphicalViewer() {
+ super.initializeGraphicalViewer();
+
+ // Enable Drop
+ getDiagramGraphicalViewer().addDropTargetListener(new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
+
+ @Override
+ protected Object getJavaObject(TransferData data) {
+ return LocalSelectionTransfer.getTransfer().nativeToJava(data);
+ }
+
+ @Override
+ protected TransactionalEditingDomain getTransactionalEditingDomain() {
+ return getEditingDomain();
+ }
+ });
+
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if(getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
+ IMultiDiagramEditor editor = (IMultiDiagramEditor)getSite().getPage().getActiveEditor();
+ // If not the active editor, ignore selection changed.
+ if(this.equals(editor.getActiveEditor())) {
+ updateActions(getSelectionActions());
+ super.selectionChanged(part, selection);
+ } else {
+ super.selectionChanged(part, selection);
+ }
+ } else {
+ super.selectionChanged(part, selection);
+ }
+ // from
+ // org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
+ // ISelection)
+ if(part == this) {
+ rebuildStatusLine();
+ }
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorPlugin.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorPlugin.java
new file mode 100644
index 00000000000..f4ad4dfa707
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorPlugin.java
@@ -0,0 +1,280 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.resource.provider.ResourceItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.activities.provider.ActivitiesItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.allocations.provider.AllocationsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.blocks.provider.BlocksItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.constraints.provider.ConstraintsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.modelelements.provider.ModelelementsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.portandflows.provider.PortandflowsItemProviderAdapterFactory;
+import org.eclipse.papyrus.sysml.requirements.provider.RequirementsItemProviderAdapterFactory;
+import org.eclipse.papyrus.uml.standard.provider.StandardItemProviderAdapterFactory;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @generated
+ */
+public class SysmlDiagramEditorPlugin extends AbstractUIPlugin {
+
+ /**
+ * @generated
+ */
+ public static final String ID = "org.eclipse.papyrus.sysml.diagram.blockdiagram"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
+
+ /**
+ * @generated
+ */
+ private static SysmlDiagramEditorPlugin instance;
+
+ /**
+ * @generated
+ */
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * @generated
+ */
+ private SysmlDocumentProvider documentProvider;
+
+ /**
+ * @generated
+ */
+ public SysmlDiagramEditorPlugin() {
+ }
+
+ /**
+ * @generated
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ instance = this;
+ PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
+ adapterFactory = createAdapterFactory();
+ }
+
+ /**
+ * @generated
+ */
+ public void stop(BundleContext context) throws Exception {
+ adapterFactory.dispose();
+ adapterFactory = null;
+ instance = null;
+ super.stop(context);
+ }
+
+ /**
+ * @generated
+ */
+ public static SysmlDiagramEditorPlugin getInstance() {
+ return instance;
+ }
+
+ /**
+ * @generated
+ */
+ protected ComposedAdapterFactory createAdapterFactory() {
+ List factories = new ArrayList();
+ fillItemProviderFactories(factories);
+ return new ComposedAdapterFactory(factories);
+ }
+
+ /**
+ * Comment fake generated provider.
+ *
+ * @generated NOT
+ */
+ protected void fillItemProviderFactories(List factories) {
+ // factories.add(new SysmlItemProviderAdapterFactory());
+ factories.add(new ModelelementsItemProviderAdapterFactory());
+ factories.add(new BlocksItemProviderAdapterFactory());
+ factories.add(new PortandflowsItemProviderAdapterFactory());
+ factories.add(new ConstraintsItemProviderAdapterFactory());
+ factories.add(new ActivitiesItemProviderAdapterFactory());
+ factories.add(new AllocationsItemProviderAdapterFactory());
+ factories.add(new RequirementsItemProviderAdapterFactory());
+ // factories.add(new InteractionsItemProviderAdapterFactory());
+ // factories.add(new StatemachinesItemProviderAdapterFactory());
+ // factories.add(new UsecasesItemProviderAdapterFactory());
+ factories.add(new EcoreItemProviderAdapterFactory());
+ factories.add(new StandardItemProviderAdapterFactory());
+ factories.add(new UMLItemProviderAdapterFactory());
+ factories.add(new ResourceItemProviderAdapterFactory());
+ factories.add(new org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory());
+ factories.add(new ReflectiveItemProviderAdapterFactory());
+ }
+
+ /**
+ * @generated
+ */
+ public AdapterFactory getItemProvidersAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * @generated
+ */
+ public ImageDescriptor getItemImageDescriptor(Object item) {
+ IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
+ if(labelProvider != null) {
+ return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
+ }
+ return null;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @generated
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getBundledImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
+ }
+
+ /**
+ * Respects images residing in any plug-in. If path is relative,
+ * then this bundle is looked up for the image, otherwise, for absolute
+ * path, first segment is taken as id of plug-in with image
+ *
+ * @generated
+ * @param path
+ * the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
+ * @return the image descriptor
+ */
+ public static ImageDescriptor findImageDescriptor(String path) {
+ final IPath p = new Path(path);
+ if(p.isAbsolute() && p.segmentCount() > 1) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
+ } else {
+ return getBundledImageDescriptor(p.makeAbsolute().toString());
+ }
+ }
+
+ /**
+ * Returns an image for the image file at the given plug-in relative path.
+ * Client do not need to dispose this image. Images will be disposed automatically.
+ *
+ * @generated
+ * @param path
+ * the path
+ * @return image instance
+ */
+ public Image getBundledImage(String path) {
+ Image image = getImageRegistry().get(path);
+ if(image == null) {
+ getImageRegistry().put(path, getBundledImageDescriptor(path));
+ image = getImageRegistry().get(path);
+ }
+ return image;
+ }
+
+ /**
+ * Returns string from plug-in's resource bundle
+ *
+ * @generated
+ */
+ public static String getString(String key) {
+ return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ public SysmlDocumentProvider getDocumentProvider() {
+ if(documentProvider == null) {
+ documentProvider = new SysmlDocumentProvider();
+ }
+ return documentProvider;
+ }
+
+ /**
+ * @generated
+ */
+ public void logError(String error) {
+ logError(error, null);
+ }
+
+ /**
+ * @generated
+ */
+ public void logError(String error, Throwable throwable) {
+ if(error == null && throwable != null) {
+ error = throwable.getMessage();
+ }
+ getLog().log(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, IStatus.OK, error, throwable));
+ debug(error, throwable);
+ }
+
+ /**
+ * @generated
+ */
+ public void logInfo(String message) {
+ logInfo(message, null);
+ }
+
+ /**
+ * @generated
+ */
+ public void logInfo(String message, Throwable throwable) {
+ if(message == null && throwable != null) {
+ message = throwable.getMessage();
+ }
+ getLog().log(new Status(IStatus.INFO, SysmlDiagramEditorPlugin.ID, IStatus.OK, message, throwable));
+ debug(message, throwable);
+ }
+
+ /**
+ * @generated
+ */
+ private void debug(String message, Throwable throwable) {
+ if(!isDebugging()) {
+ return;
+ }
+ if(message != null) {
+ System.err.println(message);
+ }
+ if(throwable != null) {
+ throwable.printStackTrace();
+ }
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorUtil.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorUtil.java
new file mode 100644
index 00000000000..1f219bfe670
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramEditorUtil.java
@@ -0,0 +1,389 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
+import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.papyrus.resource.ResourceFactory;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+
+/**
+ * @generated
+ */
+public class SysmlDiagramEditorUtil {
+
+ /**
+ * @generated
+ */
+ public static Map getSaveOptions() {
+ Map saveOptions = new HashMap();
+ saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ return saveOptions;
+ }
+
+ /**
+ * @generated
+ */
+ public static boolean openDiagram(Resource diagram) throws PartInitException {
+ String path = diagram.getURI().toPlatformString(true);
+ IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
+ if(workspaceResource instanceof IFile) {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ return null != page.openEditor(new FileEditorInput((IFile)workspaceResource), SysmlDiagramEditor.ID);
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public static void setCharset(IFile file) {
+ if(file == null) {
+ return;
+ }
+ try {
+ file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$
+ } catch (CoreException e) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) {
+ if(containerFullPath == null) {
+ containerFullPath = new Path(""); //$NON-NLS-1$
+ }
+ if(fileName == null || fileName.trim().length() == 0) {
+ fileName = "default"; //$NON-NLS-1$
+ }
+ IPath filePath = containerFullPath.append(fileName);
+ if(extension != null && !extension.equals(filePath.getFileExtension())) {
+ filePath = filePath.addFileExtension(extension);
+ }
+ extension = filePath.getFileExtension();
+ fileName = filePath.removeFileExtension().lastSegment();
+ int i = 1;
+ while(ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
+ i++;
+ filePath = containerFullPath.append(fileName + i);
+ if(extension != null) {
+ filePath = filePath.addFileExtension(extension);
+ }
+ }
+ return filePath.lastSegment();
+ }
+
+ /**
+ * Runs the wizard in a dialog.
+ *
+ * @generated
+ */
+ public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
+ IDialogSettings pluginDialogSettings = SysmlDiagramEditorPlugin.getInstance().getDialogSettings();
+ IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
+ if(wizardDialogSettings == null) {
+ wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
+ }
+ wizard.setDialogSettings(wizardDialogSettings);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
+ dialog.open();
+ }
+
+ /**
+ * This method should be called within a workspace modify operation since it creates resources.
+ *
+ * @generated
+ */
+ public static Resource createDiagram(URI diagramURI, URI modelURI, IProgressMonitor progressMonitor) {
+ TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+ progressMonitor.beginTask(Messages.SysmlDiagramEditorUtil_CreateDiagramProgressTask, 3);
+ final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
+ final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
+ final String diagramName = diagramURI.lastSegment();
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.SysmlDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ org.eclipse.papyrus.resource.Resource model = createInitialModel();
+ attachModelToResource(model, modelResource);
+
+ Diagram diagram = ViewService.createDiagram(model, ResourceEditPart.MODEL_ID, SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ if(diagram != null) {
+ diagramResource.getContents().add(diagram);
+ diagram.setName(diagramName);
+ diagram.setElement(model);
+ }
+
+ try {
+ modelResource.save(org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorUtil.getSaveOptions());
+ diagramResource.save(org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorUtil.getSaveOptions());
+ } catch (IOException e) {
+
+ SysmlDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null);
+ } catch (ExecutionException e) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
+ }
+ setCharset(WorkspaceSynchronizer.getFile(modelResource));
+ setCharset(WorkspaceSynchronizer.getFile(diagramResource));
+ return diagramResource;
+ }
+
+ /**
+ * Create a new instance of domain element associated with canvas.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static org.eclipse.papyrus.resource.Resource createInitialModel() {
+ return ResourceFactory.eINSTANCE.createResource();
+ }
+
+ /**
+ * Store model element in the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static void attachModelToResource(org.eclipse.papyrus.resource.Resource model, Resource resource) {
+ resource.getContents().add(model);
+ }
+
+ /**
+ * @generated
+ */
+ public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List/* EditPart */editParts) {
+ diagramPart.getDiagramGraphicalViewer().deselectAll();
+
+ EditPart firstPrimary = null;
+ for(Iterator it = editParts.iterator(); it.hasNext();) {
+ EditPart nextPart = (EditPart)it.next();
+ diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
+ if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
+ firstPrimary = nextPart;
+ }
+ }
+
+ if(!editParts.isEmpty()) {
+ diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element, List editPartCollector) {
+ IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer)diagramPart.getViewer();
+ final int intialNumOfEditParts = editPartCollector.size();
+
+ if(element instanceof View) { // support notation element lookup
+ EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(element);
+ if(editPart != null) {
+ editPartCollector.add(editPart);
+ return 1;
+ }
+ }
+
+ String elementID = EMFCoreUtil.getProxyID(element);
+ List associatedParts = viewer.findEditPartsForElement(elementID, IGraphicalEditPart.class);
+ // perform the possible hierarchy disjoint -> take the top-most parts only
+ for(Iterator editPartIt = associatedParts.iterator(); editPartIt.hasNext();) {
+ EditPart nextPart = (EditPart)editPartIt.next();
+ EditPart parentPart = nextPart.getParent();
+ while(parentPart != null && !associatedParts.contains(parentPart)) {
+ parentPart = parentPart.getParent();
+ }
+ if(parentPart == null) {
+ editPartCollector.add(nextPart);
+ }
+ }
+
+ if(intialNumOfEditParts == editPartCollector.size()) {
+ if(!associatedParts.isEmpty()) {
+ editPartCollector.add(associatedParts.iterator().next());
+ } else {
+ if(element.eContainer() != null) {
+ return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector);
+ }
+ }
+ }
+ return editPartCollector.size() - intialNumOfEditParts;
+ }
+
+ /**
+ * @generated
+ */
+ public static View findView(DiagramEditPart diagramEditPart, EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) {
+ boolean hasStructuralURI = false;
+ if(targetElement.eResource() instanceof XMLResource) {
+ hasStructuralURI = ((XMLResource)targetElement.eResource()).getID(targetElement) == null;
+ }
+
+ View view = null;
+ if(hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
+ view = (View)lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
+ } else if(findElementsInDiagramByID(diagramEditPart, targetElement, lazyElement2ViewMap.editPartTmpHolder) > 0) {
+ EditPart editPart = (EditPart)lazyElement2ViewMap.editPartTmpHolder.get(0);
+ lazyElement2ViewMap.editPartTmpHolder.clear();
+ view = editPart.getModel() instanceof View ? (View)editPart.getModel() : null;
+ }
+
+ return (view == null) ? diagramEditPart.getDiagramView() : view;
+ }
+
+ /**
+ * @generated
+ */
+ public static class LazyElement2ViewMap {
+
+ /**
+ * @generated
+ */
+ private Map element2ViewMap;
+
+ /**
+ * @generated
+ */
+ private View scope;
+
+ /**
+ * @generated
+ */
+ private Set elementSet;
+
+ /**
+ * @generated
+ */
+ public final List editPartTmpHolder = new ArrayList();
+
+ /**
+ * @generated
+ */
+ public LazyElement2ViewMap(View scope, Set elements) {
+ this.scope = scope;
+ this.elementSet = elements;
+ }
+
+ /**
+ * @generated
+ */
+ public final Map getElement2ViewMap() {
+ if(element2ViewMap == null) {
+ element2ViewMap = new HashMap();
+ // map possible notation elements to itself as these can't be found by view.getElement()
+ for(Iterator it = elementSet.iterator(); it.hasNext();) {
+ EObject element = (EObject)it.next();
+ if(element instanceof View) {
+ View view = (View)element;
+ if(view.getDiagram() == scope.getDiagram()) {
+ element2ViewMap.put(element, element); // take only those that part of our diagram
+ }
+ }
+ }
+
+ buildElement2ViewMap(scope, element2ViewMap, elementSet);
+ }
+ return element2ViewMap;
+ }
+
+ /**
+ * @generated
+ */
+ static Map buildElement2ViewMap(View parentView, Map element2ViewMap, Set elements) {
+ if(elements.size() == element2ViewMap.size())
+ return element2ViewMap;
+
+ if(parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
+ element2ViewMap.put(parentView.getElement(), parentView);
+ if(elements.size() == element2ViewMap.size())
+ return element2ViewMap;
+ }
+
+ for(Iterator it = parentView.getChildren().iterator(); it.hasNext();) {
+ buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
+ if(elements.size() == element2ViewMap.size())
+ return element2ViewMap;
+ }
+ for(Iterator it = parentView.getSourceEdges().iterator(); it.hasNext();) {
+ buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
+ if(elements.size() == element2ViewMap.size())
+ return element2ViewMap;
+ }
+ for(Iterator it = parentView.getSourceEdges().iterator(); it.hasNext();) {
+ buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
+ if(elements.size() == element2ViewMap.size())
+ return element2ViewMap;
+ }
+ return element2ViewMap;
+ }
+ } //LazyElement2ViewMap
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdateCommand.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdateCommand.java
new file mode 100644
index 00000000000..2dded04e7f0
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdateCommand.java
@@ -0,0 +1,91 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @generated
+ */
+public class SysmlDiagramUpdateCommand implements IHandler {
+
+ /**
+ * @generated
+ */
+ public void addHandlerListener(IHandlerListener handlerListener) {
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ }
+
+ /**
+ * @generated
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ if(structuredSelection.size() != 1) {
+ return null;
+ }
+ if(structuredSelection.getFirstElement() instanceof EditPart && ((EditPart)structuredSelection.getFirstElement()).getModel() instanceof View) {
+ EObject modelElement = ((View)((EditPart)structuredSelection.getFirstElement()).getModel()).getElement();
+ List editPolicies = CanonicalEditPolicy.getRegisteredEditPolicies(modelElement);
+ for(Iterator it = editPolicies.iterator(); it.hasNext();) {
+ CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy)it.next();
+ nextEditPolicy.refresh();
+ }
+
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isEnabled() {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isHandled() {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public void removeHandlerListener(IHandlerListener handlerListener) {
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdater.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdater.java
new file mode 100644
index 00000000000..631a7d215bb
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDiagramUpdater.java
@@ -0,0 +1,368 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.resource.Resource;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockAttributeCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockConstraintCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockOperationCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockPartCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockReferenceCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockValueCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.OperationEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+
+/**
+ * @generated
+ */
+public class SysmlDiagramUpdater {
+
+ /**
+ * @generated
+ */
+ public static List getSemanticChildren(View view) {
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+ case BlockValueCompartmentEditPart.VISUAL_ID:
+ return getBlockValueCompartment_7006SemanticChildren(view);
+ case BlockPartCompartmentEditPart.VISUAL_ID:
+ return getBlockPartCompartment_7004SemanticChildren(view);
+ case BlockReferenceCompartmentEditPart.VISUAL_ID:
+ return getBlockReferenceCompartment_7005SemanticChildren(view);
+ case BlockAttributeCompartmentEditPart.VISUAL_ID:
+ return getBlockAttributeCompartment_7001SemanticChildren(view);
+ case BlockOperationCompartmentEditPart.VISUAL_ID:
+ return getBlockOperationCompartment_7002SemanticChildren(view);
+ case BlockConstraintCompartmentEditPart.VISUAL_ID:
+ return getBlockConstraintCompartment_7003SemanticChildren(view);
+ case ResourceEditPart.VISUAL_ID:
+ return getResource_1000SemanticChildren(view);
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ private static List getBlockConstraintCompartment_7003SemanticChildren(View view) {
+ if(false == view.eContainer() instanceof View) {
+ return Collections.EMPTY_LIST;
+ }
+ View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ Block modelElement = (Block)containerView.getElement();
+ List result = new LinkedList();
+
+
+
+ for(Object element : modelElement.getBase_Class().getOwnedRules()) {
+ Constraint childElement = (Constraint)element;
+ int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == ConstraintEditPart.VISUAL_ID) {
+ result.add(new SysmlNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getBlockAttributeCompartment_7001SemanticChildren(View view) {
+ if(false == view.eContainer() instanceof View) {
+ return Collections.EMPTY_LIST;
+ }
+ View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ Block modelElement = (Block)containerView.getElement();
+ List result = new LinkedList();
+
+
+
+ for(Object element : modelElement.getBase_Class().getOwnedAttributes()) {
+ Property childElement = (Property)element;
+ if(childElement.getType() == null) {
+ int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == PropertyEditPart.VISUAL_ID) {
+ result.add(new SysmlNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ *
+ * @param view
+ * @return
+ */
+ public static List getBlockPartCompartment_7004SemanticChildren(View view) {
+ if(false == view.eContainer() instanceof View) {
+ return Collections.EMPTY_LIST;
+ }
+ View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ Block modelElement = (Block)containerView.getElement();
+ List result = new LinkedList();
+
+
+
+ for(Object element : modelElement.getBase_Class().getOwnedAttributes()) {
+ Property childElement = (Property)element;
+ if(childElement.getType() instanceof org.eclipse.uml2.uml.Class && childElement.isComposite()) {
+ int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == PropertyEditPart.VISUAL_ID) {
+ result.add(new SysmlNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ *
+ */
+ public static List getBlockReferenceCompartment_7005SemanticChildren(View view) {
+ if(false == view.eContainer() instanceof View) {
+ return Collections.EMPTY_LIST;
+ }
+ View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ Block modelElement = (Block)containerView.getElement();
+ List result = new LinkedList();
+
+ for(Object element : modelElement.getBase_Class().getOwnedAttributes()) {
+ Property childElement = (Property)element;
+ if(childElement.getType() instanceof org.eclipse.uml2.uml.Class && !childElement.isComposite()) {
+ int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == PropertyEditPart.VISUAL_ID) {
+ result.add(new SysmlNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ *
+ */
+ public static List getBlockValueCompartment_7006SemanticChildren(View view) {
+ if(false == view.eContainer() instanceof View) {
+ return Collections.EMPTY_LIST;
+ }
+ View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ Block modelElement = (Block)containerView.getElement();
+ List result = new LinkedList();
+
+ for(Object element : modelElement.getBase_Class().getOwnedAttributes()) {
+ Property childElement = (Property)element;
+ if(childElement.getType() instanceof org.eclipse.uml2.uml.DataType) {
+ int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == PropertyEditPart.VISUAL_ID) {
+ result.add(new SysmlNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ }
+ return result;
+ }
+
+
+
+ /**
+ * @generated NOT
+ */
+ public static List getBlockOperationCompartment_7002SemanticChildren(View view) {
+ if(false == view.eContainer() instanceof View) {
+ return Collections.EMPTY_LIST;
+ }
+ View containerView = (View)view.eContainer();
+ if(!containerView.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ Block modelElement = (Block)containerView.getElement();
+ List result = new LinkedList();
+ for(Object element : modelElement.getBase_Class().getOwnedOperations()) {
+ Operation childElement = (Operation)element;
+ int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == OperationEditPart.VISUAL_ID) {
+ result.add(new SysmlNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated NOT
+ */
+ public static List getResource_1000SemanticChildren(View view) {
+ if(!view.isSetElement()) {
+ return Collections.EMPTY_LIST;
+ }
+ Resource modelElement = (Resource)view.getElement();
+ List result = new LinkedList();
+ for(Object element : modelElement.getEobjects()) {
+ EObject childElement = (EObject)element;
+ int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
+ if(visualID == BlockEditPart.VISUAL_ID) {
+ result.add(new SysmlNodeDescriptor(childElement, visualID));
+ continue;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getContainedLinks(View view) {
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+ case ResourceEditPart.VISUAL_ID:
+ return getResource_1000ContainedLinks(view);
+ case BlockEditPart.VISUAL_ID:
+ return getBlock_2001ContainedLinks(view);
+ case PropertyEditPart.VISUAL_ID:
+ return getProperty_3001ContainedLinks(view);
+ case OperationEditPart.VISUAL_ID:
+ return getOperation_3102ContainedLinks(view);
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getIncomingLinks(View view) {
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+ case BlockEditPart.VISUAL_ID:
+ return getBlock_2001IncomingLinks(view);
+ case PropertyEditPart.VISUAL_ID:
+ return getProperty_3001IncomingLinks(view);
+ case OperationEditPart.VISUAL_ID:
+ return getOperation_3102IncomingLinks(view);
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOutgoingLinks(View view) {
+ switch(SysmlVisualIDRegistry.getVisualID(view)) {
+ case BlockEditPart.VISUAL_ID:
+ return getBlock_2001OutgoingLinks(view);
+ case PropertyEditPart.VISUAL_ID:
+ return getProperty_3001OutgoingLinks(view);
+ case OperationEditPart.VISUAL_ID:
+ return getOperation_3102OutgoingLinks(view);
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getResource_1000ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getBlock_2001ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getProperty_3001ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOperation_3102ContainedLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getBlock_2001IncomingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getProperty_3001IncomingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOperation_3102IncomingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getBlock_2001OutgoingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getProperty_3001OutgoingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * @generated
+ */
+ public static List getOperation_3102OutgoingLinks(View view) {
+ return Collections.EMPTY_LIST;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDocumentProvider.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDocumentProvider.java
new file mode 100644
index 00000000000..2d14f4acdf0
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlDocumentProvider.java
@@ -0,0 +1,989 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.MultiRule;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+
+/**
+ * @generated
+ */
+public class SysmlDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider {
+
+ /**
+ * @generated
+ */
+ protected ElementInfo createElementInfo(Object element) throws CoreException {
+ if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ IEditorInput editorInput = (IEditorInput)element;
+ IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
+
+ ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
+ info.setModificationStamp(computeModificationStamp(info));
+ info.fStatus = null;
+ return info;
+ }
+
+ /**
+ * @generated
+ */
+ protected IDocument createDocument(Object element) throws CoreException {
+ if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ IDocument document = createEmptyDocument();
+ setDocumentContent(document, (IEditorInput)element);
+ setupDocument(element, document);
+ return document;
+ }
+
+ /**
+ * Sets up the given document as it would be provided for the given element. The
+ * content of the document is not changed. This default implementation is empty.
+ * Subclasses may reimplement.
+ *
+ * @param element
+ * the blue-print element
+ * @param document
+ * the document to set up
+ * @generated
+ */
+ protected void setupDocument(Object element, IDocument document) {
+ // for subclasses
+ }
+
+ /**
+ * @generated
+ */
+ private long computeModificationStamp(ResourceSetInfo info) {
+ int result = 0;
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ if(file.getLocation() != null) {
+ result += file.getLocation().toFile().lastModified();
+ } else {
+ result += file.getModificationStamp();
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @generated
+ */
+ protected IDocument createEmptyDocument() {
+ DiagramDocument document = new DiagramDocument();
+ document.setEditingDomain(createEditingDomain());
+ return document;
+ }
+
+ /**
+ * @generated
+ */
+ private TransactionalEditingDomain createEditingDomain() {
+ TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
+ editingDomain.setID("org.eclipse.papyrus.sysml.diagram.blockdiagram.EditingDomain"); //$NON-NLS-1$
+ final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD)).and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES));
+ editingDomain.getResourceSet().eAdapters().add(new Adapter() {
+
+ private Notifier myTarger;
+
+ public Notifier getTarget() {
+ return myTarger;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return false;
+ }
+
+ public void notifyChanged(Notification notification) {
+ if(diagramResourceModifiedFilter.matches(notification)) {
+ Object value = notification.getNewValue();
+ if(value instanceof Resource) {
+ ((Resource)value).setTrackingModification(true);
+ }
+ }
+ }
+
+ public void setTarget(Notifier newTarget) {
+ myTarger = newTarget;
+ }
+
+ });
+
+ return editingDomain;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
+ IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
+ if(element instanceof FileEditorInput) {
+ IStorage storage = ((FileEditorInput)element).getStorage();
+ Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
+ document.setContent(diagram);
+ } else if(element instanceof URIEditorInput) {
+ URI uri = ((URIEditorInput)element).getURI();
+ Resource resource = null;
+ try {
+ resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
+ if(resource == null) {
+ resource = domain.getResourceSet().createResource(uri.trimFragment());
+ }
+ if(!resource.isLoaded()) {
+ try {
+ Map options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
+ // @see 171060
+ // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
+ resource.load(options);
+ } catch (IOException e) {
+ resource.unload();
+ throw e;
+ }
+ }
+ if(uri.fragment() != null) {
+ EObject rootElement = resource.getEObject(uri.fragment());
+ if(rootElement instanceof Diagram) {
+ document.setContent((Diagram)rootElement);
+ return;
+ }
+ } else {
+ for(Iterator it = resource.getContents().iterator(); it.hasNext();) {
+ Object rootElement = it.next();
+ if(rootElement instanceof Diagram) {
+ document.setContent((Diagram)rootElement);
+ return;
+ }
+ }
+ }
+ throw new RuntimeException(Messages.SysmlDocumentProvider_NoDiagramInResourceError);
+ } catch (Exception e) {
+ CoreException thrownExcp = null;
+ if(e instanceof CoreException) {
+ thrownExcp = (CoreException)e;
+ } else {
+ String msg = e.getLocalizedMessage();
+ thrownExcp = new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, msg != null ? msg : Messages.SysmlDocumentProvider_DiagramLoadingError, e));
+ }
+ throw thrownExcp;
+ }
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public long getModificationStamp(Object element) {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ return computeModificationStamp(info);
+ }
+ return super.getModificationStamp(element);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isDeleted(Object element) {
+ IDiagramDocument document = getDiagramDocument(element);
+ if(document != null) {
+ Resource diagramResource = document.getDiagram().eResource();
+ if(diagramResource != null) {
+ IFile file = WorkspaceSynchronizer.getFile(diagramResource);
+ return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
+ }
+ }
+ return super.isDeleted(element);
+ }
+
+ /**
+ * @generated
+ */
+ public ResourceSetInfo getResourceSetInfo(Object editorInput) {
+ return (ResourceSetInfo)super.getElementInfo(editorInput);
+ }
+
+ /**
+ * @generated
+ */
+ protected void disposeElementInfo(Object element, ElementInfo info) {
+ if(info instanceof ResourceSetInfo) {
+ ResourceSetInfo resourceSetInfo = (ResourceSetInfo)info;
+ resourceSetInfo.dispose();
+ }
+ super.disposeElementInfo(element, info);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doValidateState(Object element, Object computationContext) throws CoreException {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection/* <org.eclipse.core.resources.IFile> */files2Validate = new ArrayList/* <org.eclipse.core.resources.IFile> */();
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null && file.isReadOnly()) {
+ files2Validate.add(file);
+ }
+ }
+ ResourcesPlugin.getWorkspace().validateEdit((IFile[])files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
+ }
+
+ super.doValidateState(element, computationContext);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isReadOnly(Object element) {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ if(info.isUpdateCache()) {
+ try {
+ updateCache(element);
+ } catch (CoreException ex) {
+ SysmlDiagramEditorPlugin.getInstance().logError(Messages.SysmlDocumentProvider_isModifiable, ex);
+ // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
+ }
+ }
+ return info.isReadOnly();
+ }
+ return super.isReadOnly(element);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isModifiable(Object element) {
+ if(!isStateValidated(element)) {
+ if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
+ return true;
+ }
+ }
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ if(info.isUpdateCache()) {
+ try {
+ updateCache(element);
+ } catch (CoreException ex) {
+ SysmlDiagramEditorPlugin.getInstance().logError(Messages.SysmlDocumentProvider_isModifiable, ex);
+ // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
+ }
+ }
+ return info.isModifiable();
+ }
+ return super.isModifiable(element);
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateCache(Object element) throws CoreException {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null && file.isReadOnly()) {
+ info.setReadOnly(true);
+ info.setModifiable(false);
+ return;
+ }
+ }
+ info.setReadOnly(false);
+ info.setModifiable(true);
+ return;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void doUpdateStateCache(Object element) throws CoreException {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ info.setUpdateCache(true);
+ }
+ super.doUpdateStateCache(element);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isSynchronized(Object element) {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ return info.isSynchronized();
+ }
+ return super.isSynchronized(element);
+ }
+
+ /**
+ * @generated
+ */
+ protected ISchedulingRule getResetRule(Object element) {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */rules = new ArrayList/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */();
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
+ }
+ }
+ return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ISchedulingRule getSaveRule(Object element) {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */rules = new ArrayList/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */();
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ rules.add(computeSchedulingRule(file));
+ }
+ }
+ return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ISchedulingRule getSynchronizeRule(Object element) {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */rules = new ArrayList/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */();
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
+ }
+ }
+ return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ISchedulingRule getValidateStateRule(Object element) {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */files = new ArrayList/* <org.eclipse.core.runtime.jobs.ISchedulingRule> */();
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ files.add(file);
+ }
+ }
+ return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule((IFile[])files.toArray(new IFile[files.size()]));
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
+ if(toCreateOrModify.exists())
+ return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
+
+ IResource parent = toCreateOrModify;
+ do {
+ /*
+ * XXX This is a workaround for
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601
+ * IResourceRuleFactory.createRule should iterate the hierarchy
+ * itself.
+ */
+ toCreateOrModify = parent;
+ parent = toCreateOrModify.getParent();
+ } while(parent != null && !parent.exists());
+
+ return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ handleElementChanged(info, nextResource, monitor);
+ }
+ return;
+ }
+ super.doSynchronize(element, monitor);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
+ ResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ if(!overwrite && !info.isSynchronized()) {
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, Messages.SysmlDocumentProvider_UnsynchronizedFileSaveError, null));
+ }
+ info.stopResourceListening();
+ fireElementStateChanging(element);
+ try {
+ monitor.beginTask(Messages.SysmlDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); //"Saving diagram"
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ monitor.setTaskName(NLS.bind(Messages.SysmlDocumentProvider_SaveNextResourceTask, nextResource.getURI()));
+ if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
+ try {
+ nextResource.save(SysmlDiagramEditorUtil.getSaveOptions());
+ } catch (IOException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null));
+ }
+ }
+ monitor.worked(1);
+ }
+ monitor.done();
+ info.setModificationStamp(computeModificationStamp(info));
+ } catch (RuntimeException x) {
+ fireElementStateChangeFailed(element);
+ throw x;
+ } finally {
+ info.startResourceListening();
+ }
+ } else {
+ URI newResoruceURI;
+ List affectedFiles = null;
+ if(element instanceof FileEditorInput) {
+ IFile newFile = ((FileEditorInput)element).getFile();
+ affectedFiles = Collections.singletonList(newFile);
+ newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
+ } else if(element instanceof URIEditorInput) {
+ newResoruceURI = ((URIEditorInput)element).getURI();
+ } else {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ if(false == document instanceof IDiagramDocument) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
+ final Diagram diagramCopy = (Diagram)EcoreUtil.copy(diagramDocument.getDiagram());
+ try {
+ new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind(Messages.SysmlDocumentProvider_SaveAsOperation, diagramCopy.getName()), affectedFiles) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ newResource.getContents().add(diagramCopy);
+ return CommandResult.newOKCommandResult();
+ }
+ }.execute(monitor, null);
+ newResource.save(SysmlDiagramEditorUtil.getSaveOptions());
+ } catch (ExecutionException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
+ } catch (IOException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
+ }
+ newResource.unload();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
+ IFile file = WorkspaceSynchronizer.getFile(changedResource);
+ if(file != null) {
+ try {
+ file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ } catch (CoreException ex) {
+ SysmlDiagramEditorPlugin.getInstance().logError(Messages.SysmlDocumentProvider_handleElementContentChanged, ex);
+ // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.FileDocumentProvider_handleElementContentChanged
+ }
+ }
+ changedResource.unload();
+
+ fireElementContentAboutToBeReplaced(info.getEditorInput());
+ removeUnchangedElementListeners(info.getEditorInput(), info);
+ info.fStatus = null;
+ try {
+ setDocumentContent(info.fDocument, info.getEditorInput());
+ } catch (CoreException e) {
+ info.fStatus = e.getStatus();
+ }
+ if(!info.fCanBeSaved) {
+ info.setModificationStamp(computeModificationStamp(info));
+ }
+ addUnchangedElementListeners(info.getEditorInput(), info);
+ fireElementContentReplaced(info.getEditorInput());
+ }
+
+ /**
+ * @generated
+ */
+ protected void handleElementMoved(IEditorInput input, URI uri) {
+ if(input instanceof FileEditorInput) {
+ IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
+ fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
+ return;
+ }
+ // TODO: append suffix to the URI! (use diagram as a parameter)
+ fireElementMoved(input, new URIEditorInput(uri));
+ }
+
+ /**
+ * @generated
+ */
+ public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
+ return editorInput;
+ }
+
+ /**
+ * @generated
+ */
+ public IDiagramDocument getDiagramDocument(Object element) {
+ IDocument doc = getDocument(element);
+ if(doc instanceof IDiagramDocument) {
+ return (IDiagramDocument)doc;
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected class ResourceSetInfo extends ElementInfo {
+
+ /**
+ * @generated
+ */
+ private long myModificationStamp = IResource.NULL_STAMP;
+
+ /**
+ * @generated
+ */
+ private WorkspaceSynchronizer mySynchronizer;
+
+ /**
+ * @generated
+ */
+ private Collection myUnSynchronizedResources = new ArrayList();
+
+ /**
+ * @generated
+ */
+ private IDiagramDocument myDocument;
+
+ /**
+ * @generated
+ */
+ private IEditorInput myEditorInput;
+
+ /**
+ * @generated
+ */
+ private boolean myUpdateCache = true;
+
+ /**
+ * @generated
+ */
+ private boolean myModifiable = false;
+
+ /**
+ * @generated
+ */
+ private boolean myReadOnly = true;
+
+ /**
+ * @generated
+ */
+ private ResourceSetModificationListener myResourceSetListener;
+
+ /**
+ * @generated
+ */
+ public ResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) {
+ super(document);
+ myDocument = document;
+ myEditorInput = editorInput;
+ startResourceListening();
+ myResourceSetListener = new ResourceSetModificationListener(this);
+ getResourceSet().eAdapters().add(myResourceSetListener);
+ }
+
+ /**
+ * @generated
+ */
+ public long getModificationStamp() {
+ return myModificationStamp;
+ }
+
+ /**
+ * @generated
+ */
+ public void setModificationStamp(long modificationStamp) {
+ myModificationStamp = modificationStamp;
+ }
+
+ /**
+ * @generated
+ */
+ public TransactionalEditingDomain getEditingDomain() {
+ return myDocument.getEditingDomain();
+ }
+
+ /**
+ * @generated
+ */
+ public ResourceSet getResourceSet() {
+ return getEditingDomain().getResourceSet();
+ }
+
+ /**
+ * @generated
+ */
+ public Iterator/* <org.eclipse.emf.ecore.resource.Resource> */getLoadedResourcesIterator() {
+ return new ArrayList/* <org.eclipse.emf.ecore.resource.Resource> */(getResourceSet().getResources()).iterator();
+ }
+
+ /**
+ * @generated
+ */
+ public IEditorInput getEditorInput() {
+ return myEditorInput;
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ stopResourceListening();
+ getResourceSet().eAdapters().remove(myResourceSetListener);
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = getLoadedResourcesIterator(); it.hasNext();) {
+ Resource resource = (Resource)it.next();
+ resource.unload();
+ }
+ getEditingDomain().dispose();
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isSynchronized() {
+ return myUnSynchronizedResources.size() == 0;
+ }
+
+ /**
+ * @generated
+ */
+ public void setUnSynchronized(Resource resource) {
+ myUnSynchronizedResources.add(resource);
+ }
+
+ /**
+ * @generated
+ */
+ public void setSynchronized(Resource resource) {
+ myUnSynchronizedResources.remove(resource);
+ }
+
+ /**
+ * @generated
+ */
+ public final void stopResourceListening() {
+ mySynchronizer.dispose();
+ mySynchronizer = null;
+ }
+
+ /**
+ * @generated
+ */
+ public final void startResourceListening() {
+ mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate());
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isUpdateCache() {
+ return myUpdateCache;
+ }
+
+ /**
+ * @generated
+ */
+ public void setUpdateCache(boolean update) {
+ myUpdateCache = update;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isModifiable() {
+ return myModifiable;
+ }
+
+ /**
+ * @generated
+ */
+ public void setModifiable(boolean modifiable) {
+ myModifiable = modifiable;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isReadOnly() {
+ return myReadOnly;
+ }
+
+ /**
+ * @generated
+ */
+ public void setReadOnly(boolean readOnly) {
+ myReadOnly = readOnly;
+ }
+
+ /**
+ * @generated
+ */
+ private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ }
+
+ /**
+ * @generated
+ */
+ public boolean handleResourceChanged(final Resource resource) {
+ synchronized(ResourceSetInfo.this) {
+ if(ResourceSetInfo.this.fCanBeSaved) {
+ ResourceSetInfo.this.setUnSynchronized(resource);
+ return true;
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ handleElementChanged(ResourceSetInfo.this, resource, null);
+ }
+ });
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean handleResourceDeleted(Resource resource) {
+ synchronized(ResourceSetInfo.this) {
+ if(ResourceSetInfo.this.fCanBeSaved) {
+ ResourceSetInfo.this.setUnSynchronized(resource);
+ return true;
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ fireElementDeleted(ResourceSetInfo.this.getEditorInput());
+ }
+ });
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public boolean handleResourceMoved(Resource resource, final URI newURI) {
+ synchronized(ResourceSetInfo.this) {
+ if(ResourceSetInfo.this.fCanBeSaved) {
+ ResourceSetInfo.this.setUnSynchronized(resource);
+ return true;
+ }
+ }
+ if(myDocument.getDiagram().eResource() == resource) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
+ }
+ });
+ } else {
+ handleResourceDeleted(resource);
+ }
+ return true;
+ }
+
+ }
+
+ }
+
+ /**
+ * @generated
+ */
+ private class ResourceSetModificationListener extends EContentAdapter {
+
+ /**
+ * @generated
+ */
+ private NotificationFilter myModifiedFilter;
+
+ /**
+ * @generated
+ */
+ private ResourceSetInfo myInfo;
+
+ /**
+ * @generated
+ */
+ public ResourceSetModificationListener(ResourceSetInfo info) {
+ myInfo = info;
+ myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED));
+ }
+
+ /**
+ * @generated
+ */
+ public void notifyChanged(Notification notification) {
+ if(notification.getNotifier() instanceof ResourceSet) {
+ super.notifyChanged(notification);
+ }
+ if(!notification.isTouch() && myModifiedFilter.matches(notification)) {
+ if(notification.getNotifier() instanceof Resource) {
+ Resource resource = (Resource)notification.getNotifier();
+ if(resource.isLoaded()) {
+ boolean modified = false;
+ for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
+ Resource nextResource = (Resource)it.next();
+ if(nextResource.isLoaded()) {
+ modified = nextResource.isModified();
+ }
+ }
+ boolean dirtyStateChanged = false;
+ synchronized(myInfo) {
+ if(modified != myInfo.fCanBeSaved) {
+ myInfo.fCanBeSaved = modified;
+ dirtyStateChanged = true;
+ }
+ if(!resource.isModified()) {
+ myInfo.setSynchronized(resource);
+ }
+ }
+ if(dirtyStateChanged) {
+ fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
+
+ if(!modified) {
+ myInfo.setModificationStamp(computeModificationStamp(myInfo));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlInitDiagramFileAction.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlInitDiagramFileAction.java
new file mode 100644
index 00000000000..5653c410fa9
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlInitDiagramFileAction.java
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @generated
+ */
+public class SysmlInitDiagramFileAction implements IObjectActionDelegate {
+
+ /**
+ * @generated
+ */
+ private IWorkbenchPart targetPart;
+
+ /**
+ * @generated
+ */
+ private URI domainModelURI;
+
+ /**
+ * @generated
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ this.targetPart = targetPart;
+ }
+
+ /**
+ * @generated
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ domainModelURI = null;
+ action.setEnabled(false);
+ if(selection instanceof IStructuredSelection == false || selection.isEmpty()) {
+ return;
+ }
+ IFile file = (IFile)((IStructuredSelection)selection).getFirstElement();
+ domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+ action.setEnabled(true);
+ }
+
+ /**
+ * @generated
+ */
+ private Shell getShell() {
+ return targetPart.getSite().getShell();
+ }
+
+ /**
+ * @generated
+ */
+ public void run(IAction action) {
+ TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
+ ResourceSet resourceSet = editingDomain.getResourceSet();
+ EObject diagramRoot = null;
+ try {
+ Resource resource = resourceSet.getResource(domainModelURI, true);
+ diagramRoot = (EObject)resource.getContents().get(0);
+ } catch (WrappedException ex) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
+ }
+ if(diagramRoot == null) {
+ MessageDialog.openError(getShell(), Messages.InitDiagramFile_ResourceErrorDialogTitle, Messages.InitDiagramFile_ResourceErrorDialogMessage);
+ return;
+ }
+ Wizard wizard = new SysmlNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
+ wizard.setWindowTitle(NLS.bind(Messages.InitDiagramFile_WizardTitle, ResourceEditPart.MODEL_ID));
+ SysmlDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlLinkDescriptor.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlLinkDescriptor.java
new file mode 100644
index 00000000000..6b4d3bc22ca
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlLinkDescriptor.java
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+
+/**
+ * @generated
+ */
+public class SysmlLinkDescriptor extends SysmlNodeDescriptor {
+
+ /**
+ * @generated
+ */
+ private EObject mySource;
+
+ /**
+ * @generated
+ */
+ private EObject myDestination;
+
+ /**
+ * @generated
+ */
+ private IAdaptable mySemanticAdapter;
+
+ /**
+ * @generated
+ */
+ private SysmlLinkDescriptor(EObject source, EObject destination, EObject linkElement, int linkVID) {
+ super(linkElement, linkVID);
+ mySource = source;
+ myDestination = destination;
+ }
+
+ /**
+ * @generated
+ */
+ public SysmlLinkDescriptor(EObject source, EObject destination, IElementType elementType, int linkVID) {
+ this(source, destination, (EObject)null, linkVID);
+ final IElementType elementTypeCopy = elementType;
+ mySemanticAdapter = new IAdaptable() {
+
+ public Object getAdapter(Class adapter) {
+ if(IElementType.class.equals(adapter)) {
+ return elementTypeCopy;
+ }
+ return null;
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public SysmlLinkDescriptor(EObject source, EObject destination, EObject linkElement, IElementType elementType, int linkVID) {
+ this(source, destination, linkElement, linkVID);
+ final IElementType elementTypeCopy = elementType;
+ mySemanticAdapter = new EObjectAdapter(linkElement) {
+
+ public Object getAdapter(Class adapter) {
+ if(IElementType.class.equals(adapter)) {
+ return elementTypeCopy;
+ }
+ return super.getAdapter(adapter);
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ public EObject getSource() {
+ return mySource;
+ }
+
+ /**
+ * @generated
+ */
+ public EObject getDestination() {
+ return myDestination;
+ }
+
+ /**
+ * @generated
+ */
+ public IAdaptable getSemanticAdapter() {
+ return mySemanticAdapter;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlMatchingStrategy.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlMatchingStrategy.java
new file mode 100644
index 00000000000..0a11e942931
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlMatchingStrategy.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorMatchingStrategy;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * @generated
+ */
+public class SysmlMatchingStrategy implements IEditorMatchingStrategy {
+
+ /**
+ * @generated
+ */
+ public boolean matches(IEditorReference editorRef, IEditorInput input) {
+ IEditorInput editorInput;
+ try {
+ editorInput = editorRef.getEditorInput();
+ } catch (PartInitException e) {
+ return false;
+ }
+
+ if(editorInput.equals(input)) {
+ return true;
+ }
+ if(editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
+ return ((URIEditorInput)editorInput).getURI().equals(((URIEditorInput)input).getURI());
+ }
+ return false;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNewDiagramFileWizard.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNewDiagramFileWizard.java
new file mode 100644
index 00000000000..89ad22ee840
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNewDiagramFileWizard.java
@@ -0,0 +1,175 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+/**
+ * @generated
+ */
+public class SysmlNewDiagramFileWizard extends Wizard {
+
+ /**
+ * @generated
+ */
+ private WizardNewFileCreationPage myFileCreationPage;
+
+ /**
+ * @generated
+ */
+ private ModelElementSelectionPage diagramRootElementSelectionPage;
+
+ /**
+ * @generated
+ */
+ private TransactionalEditingDomain myEditingDomain;
+
+ /**
+ * @generated
+ */
+ public SysmlNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) {
+ assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
+ assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
+ assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$
+
+ myFileCreationPage = new WizardNewFileCreationPage(Messages.SysmlNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY);
+ myFileCreationPage.setTitle(Messages.SysmlNewDiagramFileWizard_CreationPageTitle);
+ myFileCreationPage.setDescription(NLS.bind(Messages.SysmlNewDiagramFileWizard_CreationPageDescription, ResourceEditPart.MODEL_ID));
+ IPath filePath;
+ String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
+ if(domainModelURI.isPlatformResource()) {
+ filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
+ } else if(domainModelURI.isFile()) {
+ filePath = new Path(domainModelURI.trimSegments(1).toFileString());
+ } else {
+ // TODO : use some default path
+ throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
+ }
+ myFileCreationPage.setContainerFullPath(filePath);
+ myFileCreationPage.setFileName(SysmlDiagramEditorUtil.getUniqueFileName(filePath, fileName, "sysml_diagram")); //$NON-NLS-1$
+
+ diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(Messages.SysmlNewDiagramFileWizard_RootSelectionPageName);
+ diagramRootElementSelectionPage.setTitle(Messages.SysmlNewDiagramFileWizard_RootSelectionPageTitle);
+ diagramRootElementSelectionPage.setDescription(Messages.SysmlNewDiagramFileWizard_RootSelectionPageDescription);
+ diagramRootElementSelectionPage.setModelElement(diagramRoot);
+
+ myEditingDomain = editingDomain;
+ }
+
+ /**
+ * @generated
+ */
+ public void addPages() {
+ addPage(myFileCreationPage);
+ addPage(diagramRootElementSelectionPage);
+ }
+
+ /**
+ * @generated
+ */
+ public boolean performFinish() {
+ List affectedFiles = new LinkedList();
+ IFile diagramFile = myFileCreationPage.createNewFile();
+ SysmlDiagramEditorUtil.setCharset(diagramFile);
+ affectedFiles.add(diagramFile);
+ URI diagramModelURI = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
+ ResourceSet resourceSet = myEditingDomain.getResourceSet();
+ final Resource diagramResource = resourceSet.createResource(diagramModelURI);
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, Messages.SysmlNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ int diagramVID = SysmlVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement());
+ if(diagramVID != ResourceEditPart.VISUAL_ID) {
+ return CommandResult.newErrorCommandResult(Messages.SysmlNewDiagramFileWizard_IncorrectRootError);
+ }
+ Diagram diagram = ViewService.createDiagram(diagramRootElementSelectionPage.getModelElement(), ResourceEditPart.MODEL_ID, SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ diagramResource.getContents().add(diagram);
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
+ diagramResource.save(SysmlDiagramEditorUtil.getSaveOptions());
+ SysmlDiagramEditorUtil.openDiagram(diagramResource);
+ } catch (ExecutionException e) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
+ } catch (IOException ex) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$
+ } catch (PartInitException ex) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
+ }
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ private static class DiagramRootElementSelectionPage extends ModelElementSelectionPage {
+
+ /**
+ * @generated
+ */
+ protected DiagramRootElementSelectionPage(String pageName) {
+ super(pageName);
+ }
+
+ /**
+ * @generated
+ */
+ protected String getSelectionTitle() {
+ return Messages.SysmlNewDiagramFileWizard_RootSelectionPageSelectionTitle;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean validatePage() {
+ if(selectedModelElement == null) {
+ setErrorMessage(Messages.SysmlNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
+ return false;
+ }
+ boolean result = ViewService.getInstance().provides(new CreateDiagramViewOperation(new EObjectAdapter(selectedModelElement), ResourceEditPart.MODEL_ID, SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
+ setErrorMessage(result ? null : Messages.SysmlNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage);
+ return result;
+ }
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNodeDescriptor.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNodeDescriptor.java
new file mode 100644
index 00000000000..5e13e843d3c
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlNodeDescriptor.java
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * @generated
+ */
+public class SysmlNodeDescriptor {
+
+ /**
+ * @generated
+ */
+ private final EObject myModelElement;
+
+ /**
+ * @generated
+ */
+ private final int myVisualID;
+
+ /**
+ * @generated
+ */
+ public SysmlNodeDescriptor(EObject modelElement, int visualID) {
+ myModelElement = modelElement;
+ myVisualID = visualID;
+ }
+
+ /**
+ * @generated
+ */
+ public EObject getModelElement() {
+ return myModelElement;
+ }
+
+ /**
+ * @generated
+ */
+ public int getVisualID() {
+ return myVisualID;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlPaletteFactory.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlPaletteFactory.java
new file mode 100644
index 00000000000..add4abda9d8
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlPaletteFactory.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.Tool;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.papyrus.diagram.clazz.providers.UMLElementTypes;
+import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.providers.SysmlElementTypes;
+
+/**
+ * @generated
+ */
+public class SysmlPaletteFactory extends org.eclipse.papyrus.diagram.clazz.part.UMLPaletteFactory {
+
+ /**
+ * @generated
+ */
+ private final static String BLOCK_TOOL_BLOCK = "block.tool.block"; //$NON-NLS-1$
+
+ private final static String CLAZZ_TOOL_OPERATION = "clazz.tool.operation"; //$NON-NLS-1$
+
+ private final static String CLAZZ_TOOL_PROPERTY = "clazz.tool.property"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public SysmlPaletteFactory() {
+
+ }
+
+ /**
+ * @generated NOT
+ */
+ @Override
+ public Tool createTool(String toolId) {
+ if(toolId.equals(CLAZZ_TOOL_PROPERTY)) {
+ return createProperty1CreationTool();
+ }
+ if(toolId.equals(CLAZZ_TOOL_OPERATION)) {
+ return createOperation2CreationTool();
+ }
+ if(toolId.equals(BLOCK_TOOL_BLOCK)) {
+ return createBlock1CreationTool();
+ }
+ return super.createTool(toolId);
+ }
+
+ public Object getTemplate(String templateId) {
+
+ // default return: null
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ private Tool createBlock1CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(1);
+ types.add(SysmlElementTypes.Block_2001);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated NOT
+ */
+ private Tool createProperty1CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(6);
+ // SysML
+ types.add(SysmlElementTypes.Property_3001);
+
+ // UML
+ types.add(UMLElementTypes.Property_3002);
+ types.add(UMLElementTypes.Property_3005);
+ types.add(UMLElementTypes.Property_3006);
+ types.add(UMLElementTypes.Property_3012);
+ types.add(UMLElementTypes.Property_3018);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+ /**
+ * @generated NOT
+ */
+ private Tool createOperation2CreationTool() {
+ List<IElementType> types = new ArrayList<IElementType>(5);
+ // SYSML
+ types.add(SysmlElementTypes.Operation_3102);
+
+ // UML
+ types.add(UMLElementTypes.Operation_3003);
+ types.add(UMLElementTypes.Operation_3007);
+ types.add(UMLElementTypes.Operation_3013);
+ types.add(UMLElementTypes.Operation_3019);
+
+ Tool tool = new AspectUnspecifiedTypeCreationTool(types);
+ return tool;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlUriEditorInputTester.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlUriEditorInputTester.java
new file mode 100644
index 00000000000..b7a1e2b063a
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlUriEditorInputTester.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.emf.common.ui.URIEditorInput;
+
+/**
+ * @generated
+ */
+public class SysmlUriEditorInputTester extends PropertyTester {
+
+ /**
+ * @generated
+ */
+ public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
+ if(false == receiver instanceof URIEditorInput) {
+ return false;
+ }
+ URIEditorInput editorInput = (URIEditorInput)receiver;
+ return "sysml_diagram".equals(editorInput.getURI().fileExtension()); //$NON-NLS-1$
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlVisualIDRegistry.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlVisualIDRegistry.java
new file mode 100644
index 00000000000..6fff4dedca6
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/part/SysmlVisualIDRegistry.java
@@ -0,0 +1,294 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.part;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.diagram.clazz.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.diagram.common.providers.BaseViewInfo;
+import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
+import org.eclipse.papyrus.resource.Resource;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.part.BlockNameEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockAttributeCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockConstraintCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockOperationCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockPartCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockReferenceCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.BlockValueCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.OperationEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.PropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.edit.parts.ResourceEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This registry is used to determine which type of visual object should be
+ * created for the corresponding Diagram, Node, ChildNode or Link represented
+ * by a domain model object.
+ *
+ * @generated
+ */
+public class SysmlVisualIDRegistry {
+
+ /**
+ * @generated
+ */
+ private static final String DEBUG_KEY = "org.eclipse.papyrus.sysml.diagram.blockdiagram/debug/visualID"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static int getVisualID(View view) {
+ if(view instanceof Diagram) {
+ if(ResourceEditPart.MODEL_ID.equals(view.getType())) {
+ return ResourceEditPart.VISUAL_ID;
+ } else {
+ return -1;
+ }
+ }
+ return org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry.getVisualID(view.getType());
+ }
+
+ /**
+ * @generated
+ */
+ public static String getModelID(View view) {
+ View diagram = view.getDiagram();
+ while(view != diagram) {
+ EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
+ if(annotation != null) {
+ return annotation.getDetails().get("modelID"); //$NON-NLS-1$
+ }
+ view = (View)view.eContainer();
+ }
+ return diagram != null ? diagram.getType() : null;
+ }
+
+ /**
+ * @generated
+ */
+ public static int getVisualID(String type) {
+ try {
+ return Integer.parseInt(type);
+ } catch (NumberFormatException e) {
+ if(Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
+ SysmlDiagramEditorPlugin.getInstance().logError("Unable to parse view type as a visualID number: " + type);
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * @generated
+ */
+ public static String getType(int visualID) {
+ return String.valueOf(visualID);
+ }
+
+ /**
+ * The diagram is created under an UML Element
+ *
+ * @generated NOT
+ */
+ public static int getDiagramVisualID(EObject domainElement) {
+ if(domainElement == null) {
+ return -1;
+ }
+ if(UMLPackage.eINSTANCE.getPackage().isSuperTypeOf(domainElement.eClass())) {
+ return ResourceEditPart.VISUAL_ID;
+ }
+
+ return -1;
+ }
+
+ /**
+ * @generated
+ */
+ public static int getNodeVisualID(View containerView, EObject domainElement) {
+ if(domainElement == null) {
+ return -1;
+ }
+ String containerModelID = org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry.getModelID(containerView);
+ if(!ResourceEditPart.MODEL_ID.equals(containerModelID)) {
+ return -1;
+ }
+ int containerVisualID;
+ if(ResourceEditPart.MODEL_ID.equals(containerModelID)) {
+ containerVisualID = org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry.getVisualID(containerView);
+ } else {
+ if(containerView instanceof Diagram) {
+ containerVisualID = ResourceEditPart.VISUAL_ID;
+ } else {
+ return -1;
+ }
+ }
+ switch(containerVisualID) {
+ case BlockAttributeCompartmentEditPart.VISUAL_ID:
+ case BlockReferenceCompartmentEditPart.VISUAL_ID:
+ case BlockValueCompartmentEditPart.VISUAL_ID:
+ case BlockPartCompartmentEditPart.VISUAL_ID:
+ if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return PropertyEditPart.VISUAL_ID;
+ }
+ break;
+ case BlockOperationCompartmentEditPart.VISUAL_ID:
+ if(UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return OperationEditPart.VISUAL_ID;
+ }
+ break;
+ case BlockConstraintCompartmentEditPart.VISUAL_ID:
+ if(UMLPackage.eINSTANCE.getOperation().isSuperTypeOf(domainElement.eClass())) {
+ return ConstraintEditPart.VISUAL_ID;
+ }
+ break;
+ case ResourceEditPart.VISUAL_ID:
+ if(BlocksPackage.eINSTANCE.getBlock().isSuperTypeOf(domainElement.eClass())
+
+ ) {
+ return BlockEditPart.VISUAL_ID;
+ }
+ break;
+ }
+ return -1;
+ }
+
+ /**
+ *
+ * @generated NOT
+ */
+ public static boolean canCreateNode(View containerView, int nodeVisualID) {
+ String containerModelID = org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry.getModelID(containerView);
+ if(!ResourceEditPart.MODEL_ID.equals(containerModelID)) {
+ return false;
+ }
+ int containerVisualID;
+ if(ResourceEditPart.MODEL_ID.equals(containerModelID)) {
+ containerVisualID = org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlVisualIDRegistry.getVisualID(containerView);
+ } else {
+ if(containerView instanceof Diagram) {
+ containerVisualID = ResourceEditPart.VISUAL_ID;
+ } else {
+ return false;
+ }
+ }
+ switch(containerVisualID) {
+ case BlockEditPart.VISUAL_ID:
+ if(BlockNameEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(BlockConstraintCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(BlockOperationCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(BlockAttributeCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(BlockPartCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(BlockReferenceCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ if(BlockValueCompartmentEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case BlockAttributeCompartmentEditPart.VISUAL_ID:
+ case BlockPartCompartmentEditPart.VISUAL_ID:
+ case BlockValueCompartmentEditPart.VISUAL_ID:
+ case BlockReferenceCompartmentEditPart.VISUAL_ID:
+ if(PropertyEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case BlockOperationCompartmentEditPart.VISUAL_ID:
+ if(OperationEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ case ResourceEditPart.VISUAL_ID:
+ if(BlockEditPart.VISUAL_ID == nodeVisualID) {
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ /**
+ * @generated
+ */
+ public static int getLinkWithClassVisualID(EObject domainElement) {
+ if(domainElement == null) {
+ return -1;
+ }
+ return -1;
+ }
+
+ /**
+ * User can change implementation of this method to handle some specific
+ * situations not covered by default logic.
+ *
+ * @generated
+ */
+ private static boolean isDiagram(Resource element) {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ private static ViewInfo diagramViewInfo = null;
+
+ /**
+ * @generated
+ */
+ public static ViewInfo getDiagramViewInfo() {
+ if(diagramViewInfo == null) {
+ diagramViewInfo = getResource_1000ViewInfo();
+ }
+ return diagramViewInfo;
+ }
+
+ /**
+ * @generated
+ */
+ protected static ViewInfo getResource_1000ViewInfo() {
+ ViewInfo root = new BaseViewInfo(1000, ViewInfo.Head, "", null, null);
+ ViewInfo viewInfo = null;
+ viewInfo = new BaseViewInfo(2001, ViewInfo.Node, "Block");
+ root.addNode(1000, viewInfo);
+
+ viewInfo = new BaseViewInfo(3001, ViewInfo.Node, "Property");
+
+ root.addNode(7001, viewInfo);
+
+ viewInfo = new BaseViewInfo(3102, ViewInfo.Node, "Operation");
+
+ root.addNode(7002, viewInfo);
+
+ return root;
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/BlockPreferencePage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/BlockPreferencePage.java
new file mode 100644
index 00000000000..f00645cbac8
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/BlockPreferencePage.java
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+
+/**
+ * @generated
+ */
+public class BlockPreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /**
+ * @generated
+ */
+ @Override
+ protected String getBundleId() {
+ return SysmlDiagramEditorPlugin.getInstance().ID;
+ }
+
+ /**
+ * @generated
+ */
+ public static void initDefaults(IPreferenceStore store) {
+
+ String elementName = "Block";
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
+ PreferenceConverter.setDefault(store, PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
+
+ // Set the default for the gradient
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY), false);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(new org.eclipse.swt.graphics.RGB(255, 255, 255), new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
+
+ }
+
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramAppearancePreferencePage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramAppearancePreferencePage.java
new file mode 100644
index 00000000000..96eafc4e2cd
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramAppearancePreferencePage.java
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences;
+
+import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+
+/**
+ * @generated
+ */
+public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
+
+ /**
+ * @generated
+ */
+ public DiagramAppearancePreferencePage() {
+ setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramConnectionsPreferencePage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramConnectionsPreferencePage.java
new file mode 100644
index 00000000000..3e8613e1098
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramConnectionsPreferencePage.java
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences;
+
+import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+
+/**
+ * @generated
+ */
+public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage {
+
+ /**
+ * @generated
+ */
+ public DiagramConnectionsPreferencePage() {
+ setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramGeneralPreferencePage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramGeneralPreferencePage.java
new file mode 100644
index 00000000000..b73ee7f0d6c
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramGeneralPreferencePage.java
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences;
+
+import org.eclipse.gmf.runtime.diagram.ui.preferences.DiagramsPreferencePage;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+
+/**
+ * @generated
+ */
+public class DiagramGeneralPreferencePage extends DiagramsPreferencePage {
+
+ /**
+ * @generated
+ */
+ public DiagramGeneralPreferencePage() {
+ setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPreferenceInitializer.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPreferenceInitializer.java
new file mode 100644
index 00000000000..b94ea443714
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPreferenceInitializer.java
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+
+/**
+ * @generated
+ */
+public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /**
+ * @generated
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = getPreferenceStore();
+
+ OperationPreferencePage.initDefaults(store);
+
+ PropertyPreferencePage.initDefaults(store);
+
+ BlockPreferencePage.initDefaults(store);
+
+ }
+
+ /**
+ * @generated
+ */
+ protected IPreferenceStore getPreferenceStore() {
+ return SysmlDiagramEditorPlugin.getInstance().getPreferenceStore();
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPrintingPreferencePage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPrintingPreferencePage.java
new file mode 100644
index 00000000000..5e04a75065c
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramPrintingPreferencePage.java
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.blockdiagram.preferences;
+
+import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage;
+import org.eclipse.papyrus.sysml.diagram.blockdiagram.part.SysmlDiagramEditorPlugin;
+
+/**
+ * @generated
+ */
+public class DiagramPrintingPreferencePage extends PrintingPreferencePage {
+
+ /**
+ * @generated
+ */
+ public DiagramPrintingPreferencePage() {
+ setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
+ }
+}
diff --git a/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramRulersAndGridPreferencePage.java b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramRulersAndGridPreferencePage.java
new file mode 100644
index 00000000000..b4c1de1b02a
--- /dev/null
+++ b/extraplugins/deprecated-plugins/sysml.deprecated/org.eclipse.papyrus.sysml.diagram.blockdiagram/src/org/eclipse/papyrus/sysml/diagram/blockdiagram/preferences/DiagramRulersAndGridPreferencePage.java
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and impleme