Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2009-02-10 09:04:46 -0500
committerptessier2009-02-10 09:04:46 -0500
commit586b852360d7c946683d1a20067b03bd4bca519f (patch)
treec82676b7904f2673cecda0c1e8655b447da16e21
parentaa18a54447c571a38b014012a24217a2c0fa49ac (diff)
downloadorg.eclipse.papyrus-586b852360d7c946683d1a20067b03bd4bca519f.tar.gz
org.eclipse.papyrus-586b852360d7c946683d1a20067b03bd4bca519f.tar.xz
org.eclipse.papyrus-586b852360d7c946683d1a20067b03bd4bca519f.zip
add content of core plugins into CQ
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/.classpath7
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/.project28
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/META-INF/MANIFEST.MF17
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/about.html28
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/build.properties13
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/plugin.properties12
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/plugin.xml6
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/Activator.java63
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/CreateDiagramHandler.java117
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/.classpath7
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/.options7
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/.project28
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/META-INF/MANIFEST.MF51
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/about.html28
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/build.properties18
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ActivityDiagram.gifbin0 -> 96 bytes
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ClassDiagram.gifbin0 -> 120 bytes
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/UMLDiagramFile.gifbin0 -> 339 bytes
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/messages.properties235
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/plugin.properties95
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/plugin.xml65
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/schema/nestedEditor.exsd192
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramAction.java138
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramCommandHandler.java162
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractPapyrusGmfCreateDiagramCommandHandler.java278
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Activator.java283
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorContext.java59
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorFactory.java117
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramDocumentProvider.java1076
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramEditor.java405
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramSharedObjects.java77
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiPagesActionBarContributor.java158
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramActionBarContributor.java49
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramEditor.java127
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Messages.java1292
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/ModelManagerEditor.java598
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLDiagramEditorUtil.java425
-rw-r--r--core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLModelManagerEditor.java111
-rw-r--r--core/org.eclipse.papyrus.core.feature/.project17
-rw-r--r--core/org.eclipse.papyrus.core.feature/build.properties3
-rw-r--r--core/org.eclipse.papyrus.core.feature/feature.properties125
-rw-r--r--core/org.eclipse.papyrus.core.feature/feature.xml166
-rw-r--r--core/org.eclipse.papyrus.core.feature/license.html79
-rw-r--r--core/org.eclipse.papyrus.core/.classpath7
-rw-r--r--core/org.eclipse.papyrus.core/.options6
-rw-r--r--core/org.eclipse.papyrus.core/.project28
-rw-r--r--core/org.eclipse.papyrus.core/META-INF/MANIFEST.MF40
-rw-r--r--core/org.eclipse.papyrus.core/about.ini11
-rw-r--r--core/org.eclipse.papyrus.core/about.properties13
-rw-r--r--core/org.eclipse.papyrus.core/build.properties24
-rw-r--r--core/org.eclipse.papyrus.core/icons/papyrus/32x32/Papyrus_32x32_t.gifbin0 -> 1630 bytes
-rw-r--r--core/org.eclipse.papyrus.core/icons/papyrus/Papyrus.gifbin0 -> 1137 bytes
-rw-r--r--core/org.eclipse.papyrus.core/plugin.properties12
-rw-r--r--core/org.eclipse.papyrus.core/plugin.xml27
-rw-r--r--core/org.eclipse.papyrus.core/schema/contentOutline.exsd135
-rw-r--r--core/org.eclipse.papyrus.core/schema/modelListener.exsd133
-rw-r--r--core/org.eclipse.papyrus.core/schema/papyrusDiagram.exsd197
-rw-r--r--core/org.eclipse.papyrus.core/schema/readme.txt5
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/Activator.java65
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/IPapyrusUIConstants.java34
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/ContentOutlineRegistry.java220
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/IPapyrusContentOutlinePage.java34
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneContext.java127
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneException.java70
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/DiagramNotifier.java149
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/EditingDomainService.java199
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/IMultiDiagramEditor.java66
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/MultiDiagramEditor.java508
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/SashMultiDiagramEditor.java523
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadClassNameException.java85
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadNameExtensionException.java69
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/DescriptorExtensionFactory.java76
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/ExtensionException.java84
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/NotFoundException.java69
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandDescriptor.java70
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandExtensionFactory.java71
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandRegistry.java98
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommand.java35
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommandRegistry.java41
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/AbstractEditorFactory.java85
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptor.java151
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptorExtensionFactory.java69
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorFactoryRegistry.java133
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/IEditorFactory.java49
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/IEditorFactoryRegistry.java38
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/editorcontext/AbstractEditorContext.java61
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/editorcontext/ContextDescriptor.java68
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/editorcontext/ContextDescriptorExtensionFactory.java71
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/editorcontext/EditorContextRegistry.java131
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/editorcontext/IEditorContext.java56
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/editorcontext/IEditorContextRegistry.java44
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/listenerservice/IPapyrusListener.java29
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/listenerservice/ModelListenerManager.java127
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/multidiagram/SashDiagramModelException.java58
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/multidiagram/SashDiagramModelManager.java154
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/multidiagram/SashDiagramModelUtil.java436
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/multidiagram/SashWindowModelManagerWrapper.java357
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/multidiagram/commands/MoveTabFromFolderToFolderCommand.java92
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/multidiagram/commands/MoveTabInsideFolderCommand.java69
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/multidiagram/commands/MoveTabToFolderSideCommand.java62
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/perspective/PapyrusPerspective.java93
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/BusinessModelResolver.java122
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/DiResourceSet.java1279
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/FilteredCollectionView.java210
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/FilteredCollectionViewFromIterator.java244
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/FilteredListView.java367
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/IDebugChannel.java30
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/IFilter.java29
-rw-r--r--core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/utils/PapyrusTrace.java102
-rw-r--r--core/org.eclipse.papyrus.core/todo.txt8
-rw-r--r--core/org.eclipse.papyrus.di.edit/.classpath7
-rw-r--r--core/org.eclipse.papyrus.di.edit/.project33
-rw-r--r--core/org.eclipse.papyrus.di.edit/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.di.edit/META-INF/MANIFEST.MF20
-rw-r--r--core/org.eclipse.papyrus.di.edit/about.html28
-rw-r--r--core/org.eclipse.papyrus.di.edit/build.properties29
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/di2.GIFbin0 -> 890 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateDiagramElement_property_Property.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateDiagram_owner_CoreSemanticModelBridge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateDiagram_owner_SemanticModelBridge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateDiagram_owner_SimpleSemanticModelElement.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateDiagram_owner_Uml1SemanticModelBridge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_anchorage_GraphConnector.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_anchorage_GraphEdge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_Diagram.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_DiagramElement.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_Ellipse.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_GraphEdge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_GraphElement.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_GraphNode.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_GraphicPrimitive.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_Image.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_LeafElement.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_Polilyne.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_Reference.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_contained_TextElement.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_link_DiagramLink.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_semanticModel_CoreSemanticModelBridge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_semanticModel_SemanticModelBridge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_semanticModel_SimpleSemanticModelElement.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/ctool16/CreateGraphElement_semanticModel_Uml1SemanticModelBridge.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/CoreSemanticModelBridge.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/DiagramElement.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/DiagramLink.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_ActivityDiagram.gifbin0 -> 96 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_ClassDiagram.gifbin0 -> 90 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_ComponentDiagram.gifbin0 -> 79 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_CompositeStructureDiagram.gifbin0 -> 96 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_DeploymentDiagram.gifbin0 -> 92 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_ProfileDiagram.gifbin0 -> 99 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_SequenceDiagram.gifbin0 -> 92 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_StateMachineDiagram.gifbin0 -> 95 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Diagram_UseCaseDiagram.gifbin0 -> 91 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Dimension.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Ellipse.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/GraphConnector.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/GraphEdge.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/GraphElement.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/GraphNode.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/GraphicPrimitive.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Image.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/LeafElement.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Point.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Polilyne.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Property.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Reference.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/SemanticModelBridge.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/SimpleSemanticModelElement.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/TextElement.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/icons/full/obj16/Uml1SemanticModelBridge.gifbin0 -> 129 bytes
-rw-r--r--core/org.eclipse.papyrus.di.edit/plugin.properties135
-rw-r--r--core/org.eclipse.papyrus.di.edit/plugin.xml26
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/CoreSemanticModelBridgeItemProvider.java146
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/DiEditPlugin.java93
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/DiItemProviderAdapterFactory.java642
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/DiagramElementItemProvider.java492
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/DiagramItemProvider.java258
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/DiagramLinkItemProvider.java236
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/EllipseItemProvider.java272
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/GraphConnectorItemProvider.java194
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/GraphEdgeItemProvider.java175
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/GraphElementItemProvider.java284
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/GraphNodeItemProvider.java152
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/GraphicPrimitiveItemProvider.java119
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/ImageItemProvider.java176
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/LeafElementItemProvider.java119
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/PolilyneItemProvider.java176
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/PropertyItemProvider.java192
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/ReferenceItemProvider.java175
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/SemanticModelBridgeItemProvider.java191
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/SimpleSemanticModelElementItemProvider.java154
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/TextElementItemProvider.java152
-rw-r--r--core/org.eclipse.papyrus.di.edit/src/org/eclipse/papyrus/di/provider/Uml1SemanticModelBridgeItemProvider.java146
-rw-r--r--core/org.eclipse.papyrus.di.editor/.classpath7
-rw-r--r--core/org.eclipse.papyrus.di.editor/.project33
-rw-r--r--core/org.eclipse.papyrus.di.editor/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.di.editor/META-INF/MANIFEST.MF21
-rw-r--r--core/org.eclipse.papyrus.di.editor/about.html28
-rw-r--r--core/org.eclipse.papyrus.di.editor/build.properties29
-rw-r--r--core/org.eclipse.papyrus.di.editor/icons/di2.GIFbin0 -> 890 bytes
-rw-r--r--core/org.eclipse.papyrus.di.editor/icons/full/obj16/Di2ModelFile.gifbin0 -> 346 bytes
-rw-r--r--core/org.eclipse.papyrus.di.editor/icons/full/obj16/DiModelFile.gifbin0 -> 346 bytes
-rw-r--r--core/org.eclipse.papyrus.di.editor/icons/full/wizban/NewDi.gifbin0 -> 2462 bytes
-rw-r--r--core/org.eclipse.papyrus.di.editor/icons/full/wizban/NewDi2.gifbin0 -> 2462 bytes
-rw-r--r--core/org.eclipse.papyrus.di.editor/plugin.properties81
-rw-r--r--core/org.eclipse.papyrus.di.editor/plugin.xml49
-rw-r--r--core/org.eclipse.papyrus.di.editor/src/org/eclipse/papyrus/di/presentation/DiActionBarContributor.java400
-rw-r--r--core/org.eclipse.papyrus.di.editor/src/org/eclipse/papyrus/di/presentation/DiEditor.java1684
-rw-r--r--core/org.eclipse.papyrus.di.editor/src/org/eclipse/papyrus/di/presentation/DiEditorPlugin.java94
-rw-r--r--core/org.eclipse.papyrus.di.editor/src/org/eclipse/papyrus/di/presentation/DiModelWizard.java581
-rw-r--r--core/org.eclipse.papyrus.di/.classpath8
-rw-r--r--core/org.eclipse.papyrus.di/.project33
-rw-r--r--core/org.eclipse.papyrus.di/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.di/META-INF/MANIFEST.MF17
-rw-r--r--core/org.eclipse.papyrus.di/about.html28
-rw-r--r--core/org.eclipse.papyrus.di/build.properties32
-rw-r--r--core/org.eclipse.papyrus.di/customsrc/org/eclipse/papyrus/di/DiConstants.java44
-rw-r--r--core/org.eclipse.papyrus.di/model/UML.ecore10032
-rw-r--r--core/org.eclipse.papyrus.di/model/di.ecore176
-rw-r--r--core/org.eclipse.papyrus.di/model/di2.genmodel129
-rw-r--r--core/org.eclipse.papyrus.di/model/note.txt132
-rw-r--r--core/org.eclipse.papyrus.di/plugin.properties26
-rw-r--r--core/org.eclipse.papyrus.di/plugin.xml21
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/CoreSemanticModelBridge.java61
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/DiFactory.java215
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/DiPackage.java4270
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/Diagram.java188
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/DiagramElement.java453
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/DiagramLink.java144
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/Ellipse.java196
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/GraphConnector.java113
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/GraphEdge.java114
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/GraphElement.java145
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/GraphNode.java61
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/GraphicPrimitive.java28
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/Image.java87
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/LeafElement.java28
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/PapyrusKeyEnumeration.java192
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/Polilyne.java70
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/Property.java88
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/Reference.java87
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/SemanticModelBridge.java88
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/SimpleSemanticModelElement.java60
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/TextElement.java60
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/Uml1SemanticModelBridge.java61
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/CoreSemanticModelBridgeImpl.java163
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/DiFactoryImpl.java489
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/DiPackageImpl.java1347
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/DiagramElementImpl.java1008
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/DiagramImpl.java463
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/DiagramLinkImpl.java353
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/EllipseImpl.java445
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/GraphConnectorImpl.java324
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/GraphEdgeImpl.java282
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/GraphElementImpl.java393
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/GraphNodeImpl.java175
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/GraphicPrimitiveImpl.java50
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/ImageImpl.java227
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/LeafElementImpl.java50
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/PolilyneImpl.java196
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/PropertyImpl.java228
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/ReferenceImpl.java235
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/SemanticModelBridgeImpl.java236
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/SimpleSemanticModelElementImpl.java173
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/TextElementImpl.java173
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/impl/Uml1SemanticModelBridgeImpl.java168
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/util/DiAdapterFactory.java455
-rw-r--r--core/org.eclipse.papyrus.di/src/org/eclipse/papyrus/di/util/DiSwitch.java540
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/.classpath7
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/.project28
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/META-INF/MANIFEST.MF16
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/about.html28
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/build.properties9
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/plugin.properties12
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/plugin.xml5
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/schema/DirectEditor.exsd130
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/Activator.java162
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/configuration/DefaultDirectEditorConfiguration.java154
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/configuration/IDirectEditorConfiguration.java94
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/definition/DirectEditorExtensionPoint.java209
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/definition/IDirectEditorConfigurationIds.java37
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/utils/DirectEditorsUtil.java91
-rw-r--r--core/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/utils/IDirectEditorsIds.java24
-rw-r--r--core/org.eclipse.papyrus.preferences/.classpath7
-rw-r--r--core/org.eclipse.papyrus.preferences/.project28
-rw-r--r--core/org.eclipse.papyrus.preferences/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.preferences/META-INF/MANIFEST.MF19
-rw-r--r--core/org.eclipse.papyrus.preferences/about.html28
-rw-r--r--core/org.eclipse.papyrus.preferences/build.properties7
-rw-r--r--core/org.eclipse.papyrus.preferences/icons/fill_color.gifbin0 -> 217 bytes
-rw-r--r--core/org.eclipse.papyrus.preferences/icons/font_color.gifbin0 -> 143 bytes
-rw-r--r--core/org.eclipse.papyrus.preferences/icons/line_color.gifbin0 -> 194 bytes
-rw-r--r--core/org.eclipse.papyrus.preferences/plugin.properties14
-rw-r--r--core/org.eclipse.papyrus.preferences/plugin.xml94
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/Activator.java64
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/initializer/AbstractViewInitializer.java133
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/initializer/LinkViewInitializer.java146
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/initializer/NodeViewInitializer.java62
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/jface/preference/ColorFieldEditor.java206
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/jface/preference/FontFieldEditor.java200
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/AbstractPapyrusElementPreferencePage.java129
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/AbstractPapyrusLinkPreferencePage.java190
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/AbstractPapyrusNodePreferencePage.java56
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/AbstractPapyrusPreferencePage.java210
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/internal/PapyrusDiagramsPreferencePage.java41
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/internal/PapyrusPathmapsPreferencePage.java73
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/internal/PapyrusPrintingPreferencePage.java73
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/internal/PapyrusRulersAndGridPreferencePage.java72
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/pages/internal/PapyrusUML2PreferencePage.java52
-rw-r--r--core/org.eclipse.papyrus.preferences/src/org/eclipse/papyrus/preferences/utils/FontHelper.java92
-rw-r--r--core/org.eclipse.papyrus.sasheditor/.classpath7
-rw-r--r--core/org.eclipse.papyrus.sasheditor/.options7
-rw-r--r--core/org.eclipse.papyrus.sasheditor/.project33
-rw-r--r--core/org.eclipse.papyrus.sasheditor/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.sasheditor/META-INF/MANIFEST.MF20
-rw-r--r--core/org.eclipse.papyrus.sasheditor/about.html28
-rw-r--r--core/org.eclipse.papyrus.sasheditor/build.properties17
-rw-r--r--core/org.eclipse.papyrus.sasheditor/messages.properties244
-rw-r--r--core/org.eclipse.papyrus.sasheditor/plugin.properties95
-rw-r--r--core/org.eclipse.papyrus.sasheditor/plugin.xml9
-rw-r--r--core/org.eclipse.papyrus.sasheditor/schema/nestedEditor.exsd175
-rw-r--r--core/org.eclipse.papyrus.sasheditor/schema/readme.txt5
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/Activator.java63
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/actions/CreateDiagramAction.java102
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/actions/CreateDiagramRetargetAction.java81
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/actions/DeleteDiagramAction.java66
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/actions/DeleteDiagramRetargetAction.java38
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/eclipsecopy/IMultiPageEditorPart.java25
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/eclipsecopy/IMultiPageEditorSiteHolder.java19
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/eclipsecopy/MultiPageEditorActionBarContributor.java58
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/eclipsecopy/MultiPageEditorPart.java955
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/eclipsecopy/MultiPageEditorSite.java469
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/eclipsecopy/MultiPageEditorTile.java1080
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/eclipsecopy/MultiPageSelectionProvider.java168
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/ActionBarButtonDescriptor.java169
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/BadClassNameException.java47
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/BadNameExtensionException.java69
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/EditorFactory.java145
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/EditorFactoryRegistry.java112
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/ExtensionException.java83
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/ExtensionMultiDiagramEditor.java113
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/ExtensionPointFactory.java139
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/ICreateDiagramAction.java31
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/IEditorFactory.java42
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/MultiDiagramActionBarContributor.java57
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/MultiDiagramSharedObjects.java22
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/NestedDiagram.java49
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/NestedEditorDescriptor.java151
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/extension/RequiredAttributeExtensionException.java44
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/EditorNotFoundException.java52
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/GefMultiPageEditorPart.java416
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/GefMultiPagesActionBarContributor.java218
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/GefPageEditor.java33
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/GraphicalPageWithFlyoutPalette.java56
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/IEditorFactoryRegistry.java34
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/InstantiationException.java56
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/MultiDiagramEditorGefDelegate.java108
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/MultiDiagramException.java52
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/MultiPageSelectionSynchronizer.java44
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/gef/SelectionSynchronizer.java316
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/ChangeEvent.java21
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/Debug.java44
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/FolderInsertedEvent.java78
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/IMultiEditorNestedPartManager.java58
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/ISashWindowModelChangeListener.java25
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/ISashWindowsModelManager.java112
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/ITilePart.java231
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/ITilePartFactory.java33
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/PTabFolder.java381
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/PartMap.java63
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/ReplaceableSashForm.java71
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/RootPart.java268
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/SashMultiPageEditorPart.java199
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/SashPart.java580
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/SashWindowsModelManagerImpl.java120
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/TabFolderPart.java713
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/TabMovedEvent.java99
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/TilePart.java122
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/TilePartContainer.java502
-rw-r--r--core/org.eclipse.papyrus.sasheditor/src/org/eclipse/papyrus/sasheditor/sash/TilePartFactory.java86
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/.classpath7
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/.project28
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/META-INF/MANIFEST.MF34
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/build.properties12
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/incomingLinksNavigatorGroup.gifbin0 -> 709 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/linkSourceNavigatorGroup.gifbin0 -> 709 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/linkTargetNavigatorGroup.gifbin0 -> 709 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/linksNavigatorGroup.gifbin0 -> 709 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/obj16/Diagram_ClassDiagram.gifbin0 -> 90 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/obj16/UMLDiagramFile.gifbin0 -> 339 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/outgoingLinksNavigatorGroup.gifbin0 -> 709 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/128x128/Papyrus_128x128.gifbin0 -> 2149 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/128x128/Papyrus_128x128.xpm204
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/Add_16x16.gifbin0 -> 318 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ArrowDown_16x16.gifbin0 -> 332 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ArrowLeft_16x16.gifbin0 -> 327 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ArrowRight_16x16.gifbin0 -> 541 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ArrowUp_16x16.gifbin0 -> 323 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ArtifactFile_16x16.gifbin0 -> 307 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ArtifactFile_16x16.jpgbin0 -> 780 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/Autosize_16x16.gifbin0 -> 140 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/BehaviorsGroup.gifbin0 -> 352 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ConsoleView_16x16.gifbin0 -> 582 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/Delete_16x16.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/DisplayedExtensionPoint_16x16.gifbin0 -> 169 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/DisplayedStereotype_16x16.gifbin0 -> 961 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/EventsGroup.gifbin0 -> 297 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ImportPackageWorkspace.gifbin0 -> 362 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ImportProfileRepository.gifbin0 -> 168 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ImportsGroup.gifbin0 -> 144 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/Inherited.gifbin0 -> 144 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/Papyrus_16x16.gifbin0 -> 256 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/ProfileApplicationsGroup.gifbin0 -> 115 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/Project_16x16.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/SegmentEdit_16x16.gifbin0 -> 158 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/Sort.gifbin0 -> 153 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/TriggersGroup.gifbin0 -> 306 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/16x16/diagrams.gifbin0 -> 152 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/32x32/Add_32x32.gifbin0 -> 367 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/32x32/Papyrus_32x32.gifbin0 -> 518 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/32x32/Papyrus_32x32_t.gifbin0 -> 1630 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/48x48/Papyrus_48x48.gifbin0 -> 691 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/64x64/Papyrus_64x64.gifbin0 -> 885 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/DI2.gifbin0 -> 890 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/Papyrus.gifbin0 -> 1137 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/Papyrus.icobin0 -> 24238 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/papyrus/figures/ActorFigure.gifbin0 -> 2021 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Abstraction.gifbin0 -> 96 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/AcceptCallAction.gifbin0 -> 367 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/AcceptEventAction.gifbin0 -> 886 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ActionExecutionSpecification.gifbin0 -> 109 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ActionInputPin.gifbin0 -> 154 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Activity.gifbin0 -> 348 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ActivityFinalNode.gifbin0 -> 540 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ActivityParameterNode.gifbin0 -> 202 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ActivityPartition.gifbin0 -> 333 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Actor.gifbin0 -> 151 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/AddStructuralFeatureValueAction.gifbin0 -> 604 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/AddVariableValueAction.gifbin0 -> 606 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/AnyReceiveEvent.gifbin0 -> 204 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Artifact.gifbin0 -> 371 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Artifact.jpgbin0 -> 797 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Association.gifbin0 -> 93 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/AssociationClass.gifbin0 -> 198 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Association_composite.gifbin0 -> 96 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Association_none.gifbin0 -> 93 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Association_shared.gifbin0 -> 100 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/BehaviorExecutionSpecification.gifbin0 -> 233 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/BroadcastSignalAction.gifbin0 -> 592 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CallBehaviorAction.gifbin0 -> 367 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CallEvent.gifbin0 -> 223 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CallOperationAction.gifbin0 -> 361 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CentralBufferNode.gifbin0 -> 318 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ChangeEvent.gifbin0 -> 322 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Class.gifbin0 -> 228 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ClassifierTemplateParameter.gifbin0 -> 252 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Clause.gifbin0 -> 91 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ClearAssociationAction.gifbin0 -> 598 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ClearStructuralFeatureAction.gifbin0 -> 604 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ClearVariableAction.gifbin0 -> 623 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Collaboration.gifbin0 -> 200 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CollaborationUse.gifbin0 -> 205 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CombinedFragment.gifbin0 -> 359 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Comment.gifbin0 -> 324 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CommunicationPath.gifbin0 -> 147 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Component.bmpbin0 -> 1280 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Component.gifbin0 -> 348 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Component.jpgbin0 -> 782 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ComponentRealization.gifbin0 -> 219 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ConditionalNode.gifbin0 -> 371 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ConnectableElementTemplateParameter.gifbin0 -> 228 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ConnectionPointReference.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Connector.gifbin0 -> 98 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ConnectorEnd.gifbin0 -> 95 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Connector_assembly.gifbin0 -> 208 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Connector_delegation.gifbin0 -> 100 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ConsiderIgnoreFragment.gifbin0 -> 365 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Constraint.gifbin0 -> 101 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Continuation.gifbin0 -> 111 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ControlFlow.gifbin0 -> 97 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CreateLinkAction.gifbin0 -> 570 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CreateLinkObjectAction.gifbin0 -> 588 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CreateObjectAction.gifbin0 -> 579 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/CreationEvent.gifbin0 -> 326 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DataStoreNode.gifbin0 -> 328 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DataType.gifbin0 -> 368 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DecisionNode.gifbin0 -> 220 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Dependency.gifbin0 -> 131 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Deployment.gifbin0 -> 330 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DeploymentSpecification.gifbin0 -> 336 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DestroyLinkAction.gifbin0 -> 364 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DestroyObjectAction.gifbin0 -> 370 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DestructionEvent.gifbin0 -> 202 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Device.gifbin0 -> 349 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_ActivityDiagram.gifbin0 -> 96 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_ClassDiagram.gifbin0 -> 90 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_ComponentDiagram.gifbin0 -> 79 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_CompositeStructureDiagram.gifbin0 -> 96 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_DeploymentDiagram.gifbin0 -> 92 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_ProfileDiagram.gifbin0 -> 99 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_RequirementDiagram.gifbin0 -> 90 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_SequenceDiagram.gifbin0 -> 92 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_StateMachineDiagram.gifbin0 -> 95 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Diagram_UseCaseDiagram.gifbin0 -> 91 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Duration.gifbin0 -> 90 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DurationConstraint.gifbin0 -> 94 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DurationInterval.gifbin0 -> 80 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DurationObservation.gifbin0 -> 88 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/DurationObservationLink.gifbin0 -> 146 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ElementImport.gifbin0 -> 153 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Enumeration.gifbin0 -> 367 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/EnumerationLiteral.gifbin0 -> 373 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExceptionHandler.gifbin0 -> 131 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExecutionEnvironment.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExecutionEvent.gifbin0 -> 317 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExecutionOccurrenceSpecification.gifbin0 -> 85 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExpansionNode.gifbin0 -> 337 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExpansionRegion.gifbin0 -> 362 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Expression.gifbin0 -> 88 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Extend.gifbin0 -> 126 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Extension.gifbin0 -> 102 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExtensionEnd.gifbin0 -> 84 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ExtensionPoint.gifbin0 -> 152 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/FinalState.gifbin0 -> 540 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/FlowFinalNode.gifbin0 -> 553 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ForkNode.gifbin0 -> 343 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/FunctionBehavior.gifbin0 -> 163 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Gate.gifbin0 -> 70 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/GeneralOrdering.gifbin0 -> 74 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Generalization.gifbin0 -> 144 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/GeneralizationSet.gifbin0 -> 152 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/GraphicalLink.gifbin0 -> 146 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Image.gifbin0 -> 597 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Include.gifbin0 -> 127 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InformationFlow.gifbin0 -> 94 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InformationItem.gifbin0 -> 222 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InitialNode.gifbin0 -> 180 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InputPin.gifbin0 -> 130 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InstanceSpecification.gifbin0 -> 211 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InstanceSpecificationLink.gifbin0 -> 146 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InstanceValue.gifbin0 -> 212 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Interaction.gifbin0 -> 249 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InteractionConstraint.gifbin0 -> 100 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InteractionOperand.gifbin0 -> 235 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InteractionUse.gifbin0 -> 365 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Interface.gifbin0 -> 246 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InterfaceRealization.gifbin0 -> 121 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/InterruptibleActivityRegion.gifbin0 -> 314 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Interval.gifbin0 -> 85 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/IntervalConstraint.gifbin0 -> 98 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/JoinNode.gifbin0 -> 342 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Lifeline.gifbin0 -> 143 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LinkEndCreationData.gifbin0 -> 356 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LinkEndData.gifbin0 -> 224 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LinkEndDestructionData.gifbin0 -> 350 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LiteralBoolean.gifbin0 -> 365 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LiteralInteger.gifbin0 -> 367 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LiteralNull.gifbin0 -> 361 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LiteralString.gifbin0 -> 375 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LiteralUnlimitedNatural.gifbin0 -> 361 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/LoopNode.gifbin0 -> 352 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Manifestation.gifbin0 -> 95 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/MergeNode.gifbin0 -> 218 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Message.gifbin0 -> 72 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/MessageOccurrenceSpecification.gifbin0 -> 78 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Message_asynchCall.gifbin0 -> 157 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Message_asynchSignal.gifbin0 -> 360 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Message_createMessage.gifbin0 -> 73 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Message_deleteMessage.gifbin0 -> 97 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Message_reply.gifbin0 -> 71 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Message_synchCall.gifbin0 -> 153 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Metaclass.gifbin0 -> 941 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Model.gifbin0 -> 143 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Node.gifbin0 -> 231 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ObjectFlow.gifbin0 -> 189 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/OccurrenceSpecification.gifbin0 -> 66 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/OpaqueAction.gifbin0 -> 210 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/OpaqueBehavior.gifbin0 -> 335 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/OpaqueExpression.gifbin0 -> 371 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Operation.gifbin0 -> 573 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/OperationTemplateParameter.gifbin0 -> 357 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/OutputPin.gifbin0 -> 130 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Package.gifbin0 -> 110 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/PackageImport.gifbin0 -> 123 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/PackageMerge.gifbin0 -> 125 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Parameter.gifbin0 -> 78 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ParameterSet.gifbin0 -> 346 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Parameter_in.gifbin0 -> 85 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Parameter_inout.gifbin0 -> 89 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Parameter_out.gifbin0 -> 85 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Parameter_return.gifbin0 -> 88 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/PartDecomposition.gifbin0 -> 221 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pin.gifbin0 -> 116 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Port.gifbin0 -> 185 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/PrimitiveType.gifbin0 -> 371 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Profile.gifbin0 -> 154 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ProfileApplication.gifbin0 -> 125 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Property.gifbin0 -> 329 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ProtocolConformance.gifbin0 -> 218 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ProtocolStateMachine.gifbin0 -> 342 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ProtocolTransition.gifbin0 -> 98 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate.gifbin0 -> 290 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_choice.gifbin0 -> 205 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_deepHistory.gifbin0 -> 1039 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_entryPoint.gifbin0 -> 553 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_exitPoint.gifbin0 -> 553 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_fork.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_initial.gifbin0 -> 180 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_join.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_junction.gifbin0 -> 202 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_shallowHistory.gifbin0 -> 1039 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Pseudostate_terminate.gifbin0 -> 79 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/QualifierValue.gifbin0 -> 214 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/RaiseExceptionAction.gifbin0 -> 349 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadExtentAction.gifbin0 -> 383 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadIsClassifiedObjectAction.gifbin0 -> 585 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadLinkAction.gifbin0 -> 377 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadLinkObjectEndAction.gifbin0 -> 603 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadLinkObjectEndQualifierAction.gifbin0 -> 604 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadSelfAction.gifbin0 -> 604 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadStructuralFeatureAction.gifbin0 -> 379 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReadVariableAction.gifbin0 -> 606 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Realization.gifbin0 -> 147 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReceiveOperationEvent.gifbin0 -> 344 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReceiveSignalEvent.gifbin0 -> 598 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Reception.gifbin0 -> 570 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReclassifyObjectAction.gifbin0 -> 373 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/RedefinableTemplateSignature.gifbin0 -> 232 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReduceAction.gifbin0 -> 574 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Region.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Region_horizontal.gifbin0 -> 348 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Region_vertical.gifbin0 -> 351 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/RemoveStructuralFeatureValueAction.gifbin0 -> 612 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/RemoveVariableValueAction.gifbin0 -> 615 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ReplyAction.gifbin0 -> 365 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/RoleBinding.gifbin0 -> 146 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/SendObjectAction.gifbin0 -> 365 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/SendOperationEvent.gifbin0 -> 235 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/SendSignalAction.gifbin0 -> 898 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/SendSignalEvent.gifbin0 -> 597 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/SequenceNode.gifbin0 -> 355 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Signal.gifbin0 -> 345 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/SignalEvent.gifbin0 -> 374 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Slot.gifbin0 -> 345 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/StartClassifierBehaviorAction.gifbin0 -> 585 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/State.gifbin0 -> 210 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/StateInvariant.gifbin0 -> 109 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/StateMachine.gifbin0 -> 340 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Stereotype.gifbin0 -> 248 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/StringExpression.gifbin0 -> 89 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/StructuredActivityNode.gifbin0 -> 205 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Substitution.gifbin0 -> 94 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TemplateBinding.gifbin0 -> 98 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TemplateParameter.gifbin0 -> 158 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TemplateParameterSubstitution.gifbin0 -> 212 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TemplateSignature.gifbin0 -> 235 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TestIdentityAction.gifbin0 -> 577 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TimeConstraint.gifbin0 -> 98 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TimeEvent.gifbin0 -> 550 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TimeExpression.gifbin0 -> 90 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TimeInterval.gifbin0 -> 76 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TimeObservation.gifbin0 -> 101 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/TimeObservationLink.gifbin0 -> 146 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Transition.gifbin0 -> 75 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Transition_external.gifbin0 -> 357 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Transition_internal.gifbin0 -> 330 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Transition_local.gifbin0 -> 214 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Trigger.gifbin0 -> 375 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/UnmarshallAction.gifbin0 -> 574 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Usage.gifbin0 -> 166 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/UseCase.gifbin0 -> 145 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ValuePin.gifbin0 -> 215 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/ValueSpecificationAction.gifbin0 -> 571 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/obj16/Variable.gifbin0 -> 209 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/ovr16/VisibilityKind_package.gifbin0 -> 79 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/ovr16/VisibilityKind_private.gifbin0 -> 88 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/ovr16/VisibilityKind_protected.gifbin0 -> 86 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/icons/uml/ovr16/VisibilityKind_public.gifbin0 -> 98 bytes
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/plugin.properties13
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/Activator.java98
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/bridge/Extractor.java35
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/bridge/Injector.java33
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/bridge/MultiplicityElementBridge.java77
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/commands/AddReferenceCommand.java68
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/commands/CreateElementCommand.java76
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/commands/CustomizableSetValueCommand.java50
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/commands/MoveReferenceCommand.java72
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/commands/RemoveReferenceCommand.java62
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/commands/SetValueCommand.java62
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/dialog/ElementTreeSelectionDialog.java187
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/dialog/TabElementTreeSelectionDialog.java202
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/BehavioredClassifierFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/ClassFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/ClassifierFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/CommentFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/EnumerationFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/EnumerationLiteralFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/GeneralizationFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/InModelFilter.java46
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/InProfileFilter.java46
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/InterfaceFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/InterfaceRealizationFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/InterfaceRealizationsFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/NamedElementFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/OperationFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/PackageFilter.java38
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/ParameterFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/PropertyFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/SlotFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/StructuralFeatureFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/TypeFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/filters/ValueSpecificationFilter.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/AbstractControlsGroup.java290
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/AbstractPropertyEditor.java90
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/AdvancedReferencedEForm.java145
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/AdvancedReferencedTable.java131
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/CheckBoxFigure.java148
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/ComboList.java285
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/ControlGroup.java71
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/ControlGroupChild.java62
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/ControlWrapper.java34
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/HorizontalBox.java55
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/InputText.java28
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/InputTextControls.java234
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/LabeledCheckBoxFigure.java125
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/LabeledPropertyEditor.java143
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/PropertyEditor.java53
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/RadioButtons.java273
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/ReferencedElementForm.java364
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/ReferencedTable.java659
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/VerticalBox.java49
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/forms/VerticalBoxGroup.java269
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/helpers/MultiplicityHelper.java104
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/BooleanPropertyChangeListener.java28
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/CreateElementListener.java58
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/EmfAdapterWrapper.java42
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/INavigationListener.java31
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/IntegerPropertyChangeListener.java28
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/ListPropertyChangeListener.java54
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/NavigationListener.java74
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/listeners/PropertyChangeListener.java28
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/sections/AbstractCheckBoxSection.java99
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/sections/AbstractCompositeSection.java162
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/sections/AbstractEnhancedPropertySection.java156
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/core/sections/ISection.java70
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/customform/AbstractCustomForm.java30
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/customform/CustomCommentBodyForm.java189
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/customform/InputStringDialog.java138
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/customform/StringTable.java560
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/ClassActiveSection.java77
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/ClassifierAbstractSection.java78
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/PropertyQualifiersSection.java233
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/RoleSection.java236
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/RolesSection.java96
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/ShowNamedElementNameSection.java125
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/VisibilitySection.java119
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/AggregationKindFigure.java87
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/FeatureQualifiersForm.java122
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/LabeledMultiplicityFigure.java92
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/LabeledPropertyQualifiersForm.java88
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/LabeledQualifiersFigure.java57
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/RoleFigure.java139
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/RoleQualifiersFigure.java72
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/RolesFigure.java69
-rw-r--r--core/org.eclipse.papyrus.tabbedproperties.core/src/org/eclipse/papyrus/tabbedproperties/uml2/figures/VisibilityFigure.java76
-rw-r--r--core/org.eclipse.papyrus.wizards/.classpath7
-rw-r--r--core/org.eclipse.papyrus.wizards/.project28
-rw-r--r--core/org.eclipse.papyrus.wizards/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--core/org.eclipse.papyrus.wizards/META-INF/MANIFEST.MF20
-rw-r--r--core/org.eclipse.papyrus.wizards/about.html28
-rw-r--r--core/org.eclipse.papyrus.wizards/build.properties16
-rw-r--r--core/org.eclipse.papyrus.wizards/icons/papyrus/Papyrus.gifbin0 -> 1137 bytes
-rw-r--r--core/org.eclipse.papyrus.wizards/plugin.properties12
-rw-r--r--core/org.eclipse.papyrus.wizards/plugin.xml35
-rw-r--r--core/org.eclipse.papyrus.wizards/schema/templates.exsd127
-rw-r--r--core/org.eclipse.papyrus.wizards/src/org/eclipse/papyrus/wizards/Activator.java62
-rw-r--r--core/org.eclipse.papyrus.wizards/src/org/eclipse/papyrus/wizards/CreateModelWizard.java169
-rw-r--r--core/org.eclipse.papyrus.wizards/src/org/eclipse/papyrus/wizards/InitDiagramAction.java95
-rw-r--r--core/org.eclipse.papyrus.wizards/src/org/eclipse/papyrus/wizards/NewModelFilePage.java91
-rw-r--r--core/org.eclipse.papyrus.wizards/src/org/eclipse/papyrus/wizards/SelectDiagramKindPage.java203
-rw-r--r--core/org.eclipse.papyrus.wizards/src/org/eclipse/papyrus/wizards/SelectRootElementPage.java178
784 files changed, 72616 insertions, 0 deletions
diff --git a/core/org.eclipse.papyrus.core.adaptor.emf/.classpath b/core/org.eclipse.papyrus.core.adaptor.emf/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/core/org.eclipse.papyrus.core.adaptor.emf/.project b/core/org.eclipse.papyrus.core.adaptor.emf/.project
new file mode 100644
index 00000000000..aaa4ac1f908
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.core.adaptor.emf</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/core/org.eclipse.papyrus.core.adaptor.emf/.settings/org.eclipse.jdt.core.prefs b/core/org.eclipse.papyrus.core.adaptor.emf/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..ad6e80a3672
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Tue Aug 26 17:00:29 CEST 2008
+eclipse.preferences.version=1
+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/core/org.eclipse.papyrus.core.adaptor.emf/META-INF/MANIFEST.MF b/core/org.eclipse.papyrus.core.adaptor.emf/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..1df4f53ade1
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.core.adaptor.emf;singleton:=true
+Bundle-Version: 0.7.0.vqualifier
+Bundle-Activator: org.eclipse.papyrus.core.adaptor.emf.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.di.editor,
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.core;bundle-version="0.7.0",
+ org.eclipse.emf.transaction;bundle-version="1.2.0",
+ org.eclipse.gef;bundle-version="3.4.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.core.adaptor.emf
+Bundle-Vendor: %providerName
diff --git a/core/org.eclipse.papyrus.core.adaptor.emf/about.html b/core/org.eclipse.papyrus.core.adaptor.emf/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/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>November 14, 2008</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/core/org.eclipse.papyrus.core.adaptor.emf/build.properties b/core/org.eclipse.papyrus.core.adaptor.emf/build.properties
new file mode 100644
index 00000000000..376e0623d5d
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/build.properties
@@ -0,0 +1,13 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ bin/,\
+ plugin.properties,\
+ about.html
+src.includes = about.html,\
+ .classpath,\
+ .settings/,\
+ plugin.xml,\
+ src/
diff --git a/core/org.eclipse.papyrus.core.adaptor.emf/plugin.properties b/core/org.eclipse.papyrus.core.adaptor.emf/plugin.properties
new file mode 100644
index 00000000000..036489e988d
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 CEA LIST.
+# 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:
+# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+##################################################################################
+pluginName=Papyrus EMF Tree Adaptor (Incubation)
+providerName=Eclipse.org
diff --git a/core/org.eclipse.papyrus.core.adaptor.emf/plugin.xml b/core/org.eclipse.papyrus.core.adaptor.emf/plugin.xml
new file mode 100644
index 00000000000..ceb0c71fcba
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/plugin.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+
+</plugin>
diff --git a/core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/Activator.java b/core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/Activator.java
new file mode 100644
index 00000000000..31c0b01ed27
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/Activator.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.emf;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.diagram.emftree";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/CreateDiagramHandler.java b/core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/CreateDiagramHandler.java
new file mode 100644
index 00000000000..a7b57888414
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.emf/src/org/eclipse/papyrus/core/adaptor/emf/CreateDiagramHandler.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.emf;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.core.editor.BackboneContext;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.extension.diagrameditor.IEditorFactory;
+import org.eclipse.papyrus.core.multidiagram.SashDiagramModelUtil;
+import org.eclipse.papyrus.di.DiFactory;
+import org.eclipse.papyrus.di.Diagram;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author dumoulin
+ *
+ */
+public abstract class CreateDiagramHandler extends AbstractHandler implements IHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(editingDomain, "Create EMF Diagram") {
+
+ @Override
+ protected void doExecute() {
+ addNewDiagram();
+ }
+
+ };
+
+ editingDomain.getCommandStack().execute(command);
+ return null;
+ }
+
+ protected abstract void addNewDiagram();
+
+ /**
+ * Add a new Diagram to the graphical model.
+ *
+ * @param diagram
+ * The diagram to add to graphical model. This will be the diagram provided to {@link IEditorFactory#createEditorFor(org.eclipse.papyrus.backbone.IEditorContext, Object)}
+ */
+ protected void addNewDiagram(String name, String type, EObject diagram) {
+ // create di2node
+ Diagram di2Diagram = DiFactory.eINSTANCE.createDiagram();
+ di2Diagram.setIsVisible(true);
+ di2Diagram.setType(type);
+ if (name != null)
+ di2Diagram.setName(name);
+
+ // Add it to resource, so that it will be saved.
+ getDiResource().getContents().add(di2Diagram);
+
+ // Attach to sash in order to show it
+ SashDiagramModelUtil.openDiagramInCurrentFolder(getDiResource(), di2Diagram);
+ }
+
+ /**
+ * Get the current MultiDiagramEditor.
+ *
+ * @return
+ */
+ protected IMultiDiagramEditor getMultiDiagramEditor() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editorPart = page.getActiveEditor();
+ return (IMultiDiagramEditor) editorPart;
+ }
+
+ /**
+ * Get the shared object.
+ *
+ * @return
+ */
+ protected BackboneContext getDefaultContext() {
+ IMultiDiagramEditor editor = getMultiDiagramEditor();
+ return (BackboneContext) editor.getDefaultContext();
+ }
+
+ /**
+ * Get the di resource.
+ *
+ * @return
+ */
+ private Resource getDiResource() {
+ return getDefaultContext().getResourceSet().getDiResource();
+ }
+
+ /**
+ * Get the main editing doamin.
+ *
+ * @return
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return getDefaultContext().getTransactionalEditingDomain();
+ }
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/.classpath b/core/org.eclipse.papyrus.core.adaptor.gmf/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/.options b/core/org.eclipse.papyrus.core.adaptor.gmf/.options
new file mode 100644
index 00000000000..c6913fd8b04
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/.options
@@ -0,0 +1,7 @@
+# Tracing options for the org.eclipse.uml2.diagram.clazz plug-in
+
+# Common issues
+org.eclipse.uml2.diagram.clazz/debug=false
+
+# Visual IDs
+org.eclipse.uml2.diagram.clazz/debug/visualID=false
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/.project b/core/org.eclipse.papyrus.core.adaptor.gmf/.project
new file mode 100644
index 00000000000..a1a1ef35d42
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.core.adaptor.gmf</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/META-INF/MANIFEST.MF b/core/org.eclipse.papyrus.core.adaptor.gmf/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..fca6397dd0d
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/META-INF/MANIFEST.MF
@@ -0,0 +1,51 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.core.adaptor.gmf;singleton:=true
+Bundle-Version: 0.7.0.vqualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.core.expressions,
+ org.eclipse.jface,
+ org.eclipse.ui.ide;visibility:=reexport,
+ org.eclipse.ui.views,
+ org.eclipse.ui.navigator,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.emf.edit.ui,
+ org.eclipse.gef,
+ 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;visibility:=reexport,
+ org.eclipse.gmf.runtime.diagram.ui.providers,
+ org.eclipse.gmf.runtime.diagram.ui.providers.ide,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor,
+ org.eclipse.gmf.runtime.diagram.ui.render,
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;visibility:=reexport,
+ org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
+ org.eclipse.gmf.runtime.notation.providers;visibility:=reexport,
+ org.eclipse.uml2.uml;visibility:=reexport,
+ org.eclipse.uml2.uml.edit,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.edit,
+ org.eclipse.emf.ocl,
+ org.eclipse.emf.query.ocl,
+ org.eclipse.uml2.diagram.common,
+ org.eclipse.draw2d,
+ org.eclipse.ocl.ecore,
+ org.eclipse.ui.navigator.resources,
+ org.eclipse.uml2.diagram.clazz,
+ org.eclipse.uml2.diagram.activity,
+ org.eclipse.uml2.diagram.statemachine,
+ org.eclipse.papyrus.core;bundle-version="0.7.0";visibility:=reexport,
+ org.eclipse.papyrus.sasheditor;bundle-version="0.7.0";visibility:=reexport,
+ org.eclipse.papyrus.di;bundle-version="0.7.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Activator: org.eclipse.papyrus.core.adaptor.gmf.Activator
+Export-Package: org.eclipse.papyrus.core.adaptor.gmf
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/about.html b/core/org.eclipse.papyrus.core.adaptor.gmf/about.html
new file mode 100644
index 00000000000..209103075a7
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/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>November 14, 2008</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/core/org.eclipse.papyrus.core.adaptor.gmf/build.properties b/core/org.eclipse.papyrus.core.adaptor.gmf/build.properties
new file mode 100644
index 00000000000..93c03c7275f
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/build.properties
@@ -0,0 +1,18 @@
+#seeBugzilla=181484
+jars.compile.order = .
+
+output.. = bin/
+source.. = src/
+
+bin.includes = .options,\
+ META-INF/,\
+ plugin.properties,\
+ messages.properties,\
+ about.html,\
+ .,\
+ icons/,\
+ plugin.xml
+
+src.includes = about.html
+
+
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ActivityDiagram.gif b/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ActivityDiagram.gif
new file mode 100644
index 00000000000..11991dc2a3e
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ActivityDiagram.gif
Binary files differ
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ClassDiagram.gif b/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ClassDiagram.gif
new file mode 100644
index 00000000000..edf2be7e83d
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/Diagram_ClassDiagram.gif
Binary files differ
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/UMLDiagramFile.gif b/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/UMLDiagramFile.gif
new file mode 100644
index 00000000000..de938070dea
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/icons/obj16/UMLDiagramFile.gif
Binary files differ
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/messages.properties b/core/org.eclipse.papyrus.core.adaptor.gmf/messages.properties
new file mode 100644
index 00000000000..d90579e32e4
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/messages.properties
@@ -0,0 +1,235 @@
+
+# TODO: manually put keys and values
+DocumentProvider_isModifiable=DocumentProvider_isModifiable
+DocumentProvider_handleElementContentChanged=DocumentProvider_handleElementContentChanged
+Nodes1Group_title=Nodes
+Nodes1Group_desc=Diagram Nodes
+Children2Group_title=Children
+Children2Group_desc=Child Elements of the Diagram Nodes
+Links3Group_title=Links
+Links3Group_desc=Diagram Links
+Instances4Group_title=Instances
+Instances4Group_desc=Instances
+Association1Group_title=Association
+Association1Group_desc=Create Association Link
+Dependency2Group_title=Dependency
+Dependency2Group_desc=Create Dependency link
+Class1CreationTool_title=Class
+Class1CreationTool_desc=Create Class
+Package2CreationTool_title=Package
+Package2CreationTool_desc=Create Package
+Enumeration3CreationTool_title=Enumeration
+Enumeration3CreationTool_desc=Create Enumeration
+DataType4CreationTool_title=DataType
+DataType4CreationTool_desc=Create DataType
+PrimitiveType5CreationTool_title=PrimitiveType
+PrimitiveType5CreationTool_desc=Create PrimitiveType
+Constraint6CreationTool_title=Constraint
+Constraint6CreationTool_desc=Create Constraint
+AssociationClass7CreationTool_title=Association Class
+AssociationClass7CreationTool_desc=Create Association Class
+Interface8CreationTool_title=Interface
+Interface8CreationTool_desc=Create Interface
+Attribute1CreationTool_title=Attribute
+Attribute1CreationTool_desc=Create Attribute
+Operation2CreationTool_title=Operation
+Operation2CreationTool_desc=Create Operation
+EnumLiteral3CreationTool_title=Enum Literal
+EnumLiteral3CreationTool_desc=Create Enum Literal
+Port4CreationTool_title=Port
+Port4CreationTool_desc=Create Port
+TemplateSignature5CreationTool_title=Template Signature
+TemplateSignature5CreationTool_desc=Create Template Signature
+Generalization3CreationTool_title=Generalization
+Generalization3CreationTool_desc=Create Generalization Link
+ProvidedInterface4CreationTool_title=Provided Interface
+ProvidedInterface4CreationTool_desc=Create Interface Realization
+RequiredInterface5CreationTool_title=Required Interface
+RequiredInterface5CreationTool_desc=Create Usage
+ConstrainedElement6CreationTool_title=Constrained Element
+ConstrainedElement6CreationTool_desc=Create Constrained Element Link
+NAryDependencyTarget7CreationTool_title=NAry Dependency Target
+NAryDependencyTarget7CreationTool_desc=Add NAry Dependency Target
+NAryDependencySource8CreationTool_title=NAry Dependency Source
+NAryDependencySource8CreationTool_desc=Add NAry Dependency Source
+AssociationEnd9CreationTool_title=Association End
+AssociationEnd9CreationTool_desc=Create Association End Link
+Realization10CreationTool_title=Realization
+Realization10CreationTool_desc=Create Realization Link
+InstanceSpecification1CreationTool_title=Instance Specification
+InstanceSpecification1CreationTool_desc=Create Instance Specification
+Slot2CreationTool_title=Slot
+Slot2CreationTool_desc=Create Slot
+Association1CreationTool_title=Association
+Association1CreationTool_desc=Create Association
+SharedAggregation2CreationTool_title=Shared Aggregation
+SharedAggregation2CreationTool_desc=Create Shared Aggregation
+CompositeAggregation3CreationTool_title=Composite Aggregation
+CompositeAggregation3CreationTool_desc=Create Composite Aggregation
+Dependency1CreationTool_title=Dependency
+Dependency1CreationTool_desc=Create Dependency link
+Abstraction2CreationTool_title=Abstraction
+Abstraction2CreationTool_desc=Create Abstraction link
+Usage3CreationTool_title=Usage
+Usage3CreationTool_desc=Create Usage link
+Substitution4CreationTool_title=Substitution
+Substitution4CreationTool_desc=Create Substitution link
+NavigableAssociation4CreationTool_title=Navigable Association
+NavigableAssociation4CreationTool_desc=Create Association with Navigable Target End
+PackagePackagesEditPart_title=packages
+PackageClassifiersEditPart_title=classifiers
+PackageOtherEditPart_title=other
+ClassAttributesEditPart_title=attributes
+ClassOperationsEditPart_title=operations
+ClassClassesEditPart_title=classes
+AssociationClassAttributesEditPart_title=attributes
+AssociationClassOperationsEditPart_title=operations
+AssociationClassClassesEditPart_title=classes
+DataTypeAttributesEditPart_title=attributes
+DataTypeOperationsEditPart_title=operations
+PrimitiveTypeAttributesEditPart_title=attributes
+PrimitiveTypeOperationsEditPart_title=operations
+EnumerationLiteralsEditPart_title=literals
+EnumerationAttributesEditPart_title=attributes
+EnumerationOperationsEditPart_title=operations
+InstanceSpecificationSlotsEditPart_title=Slots
+InterfaceAttributesEditPart_title=attributes
+InterfaceOperationsEditPart_title=operations
+InterfaceClassesEditPart_title=classes
+ EvaluateOCLLinkConstraintError=Link constraint evaluation error
+CommandName_OpenDiagram=Open Diagram
+NavigatorGroupName_Package_1000_links=links
+NavigatorGroupName_Package_2002_outgoinglinks=outgoing links
+NavigatorGroupName_Package_2002_incominglinks=incoming links
+NavigatorGroupName_Class_2001_outgoinglinks=outgoing links
+NavigatorGroupName_Class_2001_incominglinks=incoming links
+NavigatorGroupName_AssociationClass_2007_outgoinglinks=outgoing links
+NavigatorGroupName_AssociationClass_2007_incominglinks=incoming links
+NavigatorGroupName_DataType_2004_outgoinglinks=outgoing links
+NavigatorGroupName_DataType_2004_incominglinks=incoming links
+NavigatorGroupName_PrimitiveType_2005_outgoinglinks=outgoing links
+NavigatorGroupName_PrimitiveType_2005_incominglinks=incoming links
+NavigatorGroupName_Enumeration_2003_outgoinglinks=outgoing links
+NavigatorGroupName_Enumeration_2003_incominglinks=incoming links
+NavigatorGroupName_Interface_2010_outgoinglinks=outgoing links
+NavigatorGroupName_Interface_2010_incominglinks=incoming links
+NavigatorGroupName_Constraint_2006_outgoinglinks=outgoing links
+NavigatorGroupName_Constraint_2006_incominglinks=incoming links
+NavigatorGroupName_InstanceSpecification_2008_outgoinglinks=outgoing links
+NavigatorGroupName_InstanceSpecification_2008_incominglinks=incoming links
+NavigatorGroupName_Dependency_2009_outgoinglinks=outgoing links
+NavigatorGroupName_Dependency_2009_incominglinks=incoming links
+NavigatorGroupName_GeneralizationSet_2012_outgoinglinks=outgoing links
+NavigatorGroupName_GeneralizationSet_2012_incominglinks=incoming links
+NavigatorGroupName_Interface_2013_outgoinglinks=outgoing links
+NavigatorGroupName_Interface_2013_incominglinks=incoming links
+NavigatorGroupName_Package_3006_outgoinglinks=outgoing links
+NavigatorGroupName_Package_3006_incominglinks=incoming links
+NavigatorGroupName_Class_3007_outgoinglinks=outgoing links
+NavigatorGroupName_Class_3007_incominglinks=incoming links
+NavigatorGroupName_DataType_3008_outgoinglinks=outgoing links
+NavigatorGroupName_DataType_3008_incominglinks=incoming links
+NavigatorGroupName_PrimitiveType_3009_outgoinglinks=outgoing links
+NavigatorGroupName_PrimitiveType_3009_incominglinks=incoming links
+NavigatorGroupName_Enumeration_3011_outgoinglinks=outgoing links
+NavigatorGroupName_Enumeration_3011_incominglinks=incoming links
+NavigatorGroupName_AssociationClass_3012_outgoinglinks=outgoing links
+NavigatorGroupName_AssociationClass_3012_incominglinks=incoming links
+NavigatorGroupName_InstanceSpecification_3013_outgoinglinks=outgoing links
+NavigatorGroupName_InstanceSpecification_3013_incominglinks=incoming links
+NavigatorGroupName_Property_3001_outgoinglinks=outgoing links
+NavigatorGroupName_Property_3001_incominglinks=incoming links
+NavigatorGroupName_Operation_3002_outgoinglinks=outgoing links
+NavigatorGroupName_Operation_3002_incominglinks=incoming links
+NavigatorGroupName_Class_3003_outgoinglinks=outgoing links
+NavigatorGroupName_Class_3003_incominglinks=incoming links
+NavigatorGroupName_Port_3025_outgoinglinks=outgoing links
+NavigatorGroupName_Port_3025_incominglinks=incoming links
+NavigatorGroupName_RedefinableTemplateSignature_3027_outgoinglinks=outgoing links
+NavigatorGroupName_RedefinableTemplateSignature_3027_incominglinks=incoming links
+NavigatorGroupName_Property_3019_outgoinglinks=outgoing links
+NavigatorGroupName_Property_3019_incominglinks=incoming links
+NavigatorGroupName_Operation_3020_outgoinglinks=outgoing links
+NavigatorGroupName_Operation_3020_incominglinks=incoming links
+NavigatorGroupName_Property_3014_outgoinglinks=outgoing links
+NavigatorGroupName_Property_3014_incominglinks=incoming links
+NavigatorGroupName_Operation_3015_outgoinglinks=outgoing links
+NavigatorGroupName_Operation_3015_incominglinks=incoming links
+NavigatorGroupName_Property_3021_outgoinglinks=outgoing links
+NavigatorGroupName_Property_3021_incominglinks=incoming links
+NavigatorGroupName_Operation_3022_outgoinglinks=outgoing links
+NavigatorGroupName_Operation_3022_incominglinks=incoming links
+NavigatorGroupName_EnumerationLiteral_3016_outgoinglinks=outgoing links
+NavigatorGroupName_EnumerationLiteral_3016_incominglinks=incoming links
+NavigatorGroupName_Property_3023_outgoinglinks=outgoing links
+NavigatorGroupName_Property_3023_incominglinks=incoming links
+NavigatorGroupName_Operation_3024_outgoinglinks=outgoing links
+NavigatorGroupName_Operation_3024_incominglinks=incoming links
+NavigatorGroupName_Slot_3017_incominglinks=incoming links
+NavigatorGroupName_Property_3028_outgoinglinks=outgoing links
+NavigatorGroupName_Property_3028_incominglinks=incoming links
+NavigatorGroupName_Operation_3029_outgoinglinks=outgoing links
+NavigatorGroupName_Operation_3029_incominglinks=incoming links
+NavigatorGroupName_Class_3030_outgoinglinks=outgoing links
+NavigatorGroupName_Class_3030_incominglinks=incoming links
+NavigatorGroupName_Generalization_4001_source=source
+NavigatorGroupName_Generalization_4001_target=target
+NavigatorGroupName_Dependency_4002_source=source
+NavigatorGroupName_Dependency_4002_target=target
+NavigatorGroupName_Property_4003_source=source
+NavigatorGroupName_Property_4003_target=target
+NavigatorGroupName_ConstraintConstrainedElement_4004_source=source
+NavigatorGroupName_ConstraintConstrainedElement_4004_target=target
+NavigatorGroupName_Association_4005_source=source
+NavigatorGroupName_Association_4005_target=target
+NavigatorGroupName_DependencySupplier_4006_source=source
+NavigatorGroupName_DependencySupplier_4006_target=target
+NavigatorGroupName_DependencyClient_4007_source=source
+NavigatorGroupName_DependencyClient_4007_target=target
+NavigatorGroupName_InterfaceRealization_4008_source=source
+NavigatorGroupName_InterfaceRealization_4008_target=target
+NavigatorGroupName_Realization_4010_source=source
+NavigatorGroupName_Realization_4010_target=target
+NavigatorGroupName_Generalization_4011_source=source
+NavigatorGroupName_Generalization_4011_target=target
+NavigatorGroupName_GeneralizationGeneral_4012_target=target
+NavigatorGroupName_Usage_4013_source=source
+NavigatorGroupName_Usage_4013_target=target
+NavigatorGroupName_Package_2014_incominglinks=incoming links
+NavigatorGroupName_Package_2014_outgoinglinks=outgoing links
+UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
+UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
+UMLDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
+UMLDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
+UMLDocumentProvider_isModifiable=Updating cache failed
+UMLDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
+UMLDocumentProvider_IncorrectInputError={1}
+UMLDocumentProvider_UnableToLoadResourceError=Unable to load diagram resource
+UMLDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
+UMLDocumentProvider_DiagramLoadingError=Error loading diagram
+UMLDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
+UMLDocumentProvider_SaveDiagramTask=Saving diagram
+UMLDocumentProvider_SaveNextResourceTask=Saving {0}
+UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle=Error
+UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogMessage=Model file loading failed
+UMLInitDiagramFileAction_InitDiagramFileWizardTitle=Initialize new {0} diagram file
+UMLInitDiagramFileAction_OpenModelFileDialogTitle=Select domain model
+UMLNewDiagramFileWizard_CreationPageName=Initialize new diagram file
+UMLNewDiagramFileWizard_CreationPageTitle=Diagram file
+UMLNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
+UMLNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
+UMLNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
+UMLNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
+UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
+UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
+UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
+UMLNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
+UMLNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
+UMLDocumentProvider_SaveAsOperation=Saving {0} diagram as
+UMLDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
+UMLDiagramEditor_SaveAsErrorTitle=Problem During Save As...
+UMLDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
+UMLDiagramEditor_SaveErrorTitle=Save Problems
+UMLDiagramEditor_SaveErrorMessage=Could not save file.
+UMLElementChooserDialog_SelectModelElementTitle=Select model element
+NavigatorActionProvider_OpenDiagramActionName=Open Diagram
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/plugin.properties b/core/org.eclipse.papyrus.core.adaptor.gmf/plugin.properties
new file mode 100644
index 00000000000..a8d89b43625
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/plugin.properties
@@ -0,0 +1,95 @@
+#################################################################################
+# Copyright (c) 2008 CEA LIST.
+# 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:
+# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+##################################################################################
+pluginName=UML Papyrus GMF Editor (Incubation)
+providerName=Eclipse.org
+
+preferences.general=UML MultiDiagram
+preferences.appearance=Appearance
+preferences.connections=Connections
+preferences.printing=Printing
+preferences.rulersAndGrid=Rulers & Grid
+preferences.pathmaps=Path Maps
+ editorName=UML GMF Multi Diagram Editor
+newWizardName=UML GMF Multi Diagram
+newWizardDesc=Creates UML model.
+ initDiagramActionLabel=Initialize umlclass_diagram diagram file
+loadResourceActionLabel=Load Resource...
+ navigatorContentName=*.umlclass_diagram diagram contents
+domainNavigatorContentName=*.uml model contents
+ tab.appearance=Appearance
+tab.diagram=Rulers & Grid
+tab.domain=Core
+ metatype.name.Package_1000=Undefined
+metatype.name.Package_2002=Package
+metatype.name.Class_2001=Class
+metatype.name.AssociationClass_2007=AssociationClass
+metatype.name.DataType_2004=DataType
+metatype.name.PrimitiveType_2005=PrimitiveType
+metatype.name.Enumeration_2003=Enumeration
+metatype.name.Interface_2010=Interface
+metatype.name.Constraint_2006=Constraint
+metatype.name.InstanceSpecification_2008=InstanceSpecification
+metatype.name.Dependency_2009=Dependency
+metatype.name.GeneralizationSet_2012=GeneralizationSet
+metatype.name.Interface_2013=Interface
+metatype.name.Package_3006=Package
+metatype.name.Class_3007=Class
+metatype.name.DataType_3008=DataType
+metatype.name.PrimitiveType_3009=PrimitiveType
+metatype.name.Enumeration_3011=Enumeration
+metatype.name.AssociationClass_3012=AssociationClass
+metatype.name.InstanceSpecification_3013=InstanceSpecification
+metatype.name.Property_3001=Property
+metatype.name.Operation_3002=Operation
+metatype.name.Class_3003=Class
+metatype.name.Port_3025=Port
+metatype.name.RedefinableTemplateSignature_3027=RedefinableTemplateSignature
+metatype.name.Property_3019=Property
+metatype.name.Operation_3020=Operation
+metatype.name.Property_3014=Property
+metatype.name.Operation_3015=Operation
+metatype.name.Property_3021=Property
+metatype.name.Operation_3022=Operation
+metatype.name.EnumerationLiteral_3016=EnumerationLiteral
+metatype.name.Property_3023=Property
+metatype.name.Operation_3024=Operation
+metatype.name.Slot_3017=Slot
+metatype.name.Property_3028=Property
+metatype.name.Operation_3029=Operation
+metatype.name.Class_3030=Class
+metatype.name.Generalization_4001=Generalization
+metatype.name.Dependency_4002=Dependency
+metatype.name.Property_4003=Property
+metatype.name.ConstraintConstrainedElement_4004=Undefined
+metatype.name.Association_4005=Association
+metatype.name.DependencySupplier_4006=Undefined
+metatype.name.DependencyClient_4007=Undefined
+metatype.name.InterfaceRealization_4008=InterfaceRealization
+metatype.name.Realization_4010=Realization
+metatype.name.Generalization_4011=Generalization
+metatype.name.GeneralizationGeneral_4012=Undefined
+metatype.name.Usage_4013=Usage
+metatype.name.Package_2014=Package
+
+createShortcutActionLabel=Create Shortcut...
+preference.page.title.org.eclipse.uml2.uml.diagram.clazz.general=UML Class Diagram
+preference.page.title.org.eclipse.uml2.uml.diagram.clazz.appearance=Appearance
+preference.page.title.org.eclipse.uml2.uml.diagram.clazz.connections=Connections
+preference.page.title.org.eclipse.uml2.uml.diagram.clazz.printing=Printing
+preference.page.title.org.eclipse.uml2.uml.diagram.clazz.rulersAndGrid=Rulers And Grid
+preference.page.title.org.eclipse.uml2.uml.diagram.clazz.pathmaps=Pathmaps
+
+preferences.icons=Icon Style
+context.description=UMLClass Diagram Editing
+context.name=In UMLClass Diagram Editor
+update.diagram.name=Update UMLClass diagram
+update.diagram.description=Perform UMLClass diagram update
+
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/plugin.xml b/core/org.eclipse.papyrus.core.adaptor.gmf/plugin.xml
new file mode 100644
index 00000000000..28706be20e4
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/plugin.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<plugin>
+ <extension-point id="nestedEditor" name="NestedEditor" schema="schema/nestedEditor.exsd"/>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <?gmfgen generated="true"?>
+ <initializer class="org.eclipse.uml2.diagram.clazz.preferences.DiagramPreferenceInitializer"/>
+ </extension>
+
+ <extension point="org.eclipse.team.core.fileTypes">
+ <?gmfgen generated="true"?>
+ <fileTypes
+ type="text"
+ extension="umlclass_diagram">
+ </fileTypes>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.extension_parser">
+ <?gmfgen generated="true"?>
+ <parser
+ type="umlclass_diagram"
+ class="org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory">
+ </parser>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <?gmfgen generated="true"?>
+ <editor
+ id="papyrus.multidiagram.gmf.uml.MultiDiagramEditorID"
+ name="%editorName"
+ icon="icons/obj16/UMLDiagramFile.gif"
+ extensions="umlclass_diagram"
+ default="true"
+ class="org.eclipse.papyrus.core.adaptor.gmf.GmfUmlMultiDiagramEditor"
+ contributorClass="org.eclipse.papyrus.core.adaptor.gmf.GmfUmlMultiDiagramActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <?gmfgen generated="true"?>
+ <wizard
+ name="%newWizardName"
+ icon="icons/obj16/UMLDiagramFile.gif"
+ category="org.eclipse.ui.Examples"
+ class="org.eclipse.uml2.diagram.clazz.part.UMLCreationWizard"
+ id="org.eclipse.uml2.diagram.clazz.part.UMLCreationWizardID">
+ <description>%newWizardDesc</description>
+ </wizard>
+ </extension>
+<extension
+ point="org.eclipse.papyrus.core.papyrusDiagram">
+ <editorContext
+ contextClass="org.eclipse.papyrus.core.adaptor.gmf.GmfEditorContext"
+ id="com.cea.papyrus.gmf.editor.context">
+ </editorContext>
+ </extension>
+
+
+
+
+
+
+</plugin>
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/schema/nestedEditor.exsd b/core/org.eclipse.papyrus.core.adaptor.gmf/schema/nestedEditor.exsd
new file mode 100644
index 00000000000..9271e591ec8
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/schema/nestedEditor.exsd
@@ -0,0 +1,192 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="papyrus.gmf.multipages" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="papyrus.gmf.multipages" id="nestedEditor" name="NestedEditor"/>
+ </appinfo>
+ <documentation>
+ Define a nested editor descriptor. This descriptor is used to add instance of the described editor to a multi diagram editor.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="editor" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="editor">
+ <annotation>
+ <documentation>
+ cc
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="createEditorButton" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="factoryClass" type="string" use="required">
+ <annotation>
+ <documentation>
+ The factory used to create an instance of the editor.
+The factory must implements org.eclipse.papyrus.core.adaptor.gmf.extension.IEditorFactory
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.papyrus.core.adaptor.gmf.extension.IEditorFactory"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="createEditorButton">
+ <annotation>
+ <appinfo>
+ <meta.element deprecated="true"/>
+ </appinfo>
+ <documentation>
+ Description of a toolbar button used to create a new editor.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="actionId" type="string" use="required">
+ <annotation>
+ <documentation>
+ ID used for the action.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+ Label used for the button
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="tooltip" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="image" type="string" use="required">
+ <annotation>
+ <documentation>
+ Icon used as button image.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="resource"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="disableImage" type="string">
+ <annotation>
+ <documentation>
+ Image used when button is disabled.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="resource"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="action" type="string" use="required">
+ <annotation>
+ <documentation>
+ The action class implementing the creation of the root object.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.papyrus.core.adaptor.gmf.extension.ICreateDiagramAction"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiInfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ /*******************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ * 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:
+ * CEA LIST - initial API and implementation
+ *******************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramAction.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramAction.java
new file mode 100644
index 00000000000..631b5c45fc5
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramAction.java
@@ -0,0 +1,138 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.sasheditor.extension.ICreateDiagramAction;
+import org.eclipse.papyrus.sasheditor.extension.MultiDiagramSharedObjects;
+import org.eclipse.uml2.diagram.clazz.part.Messages;
+import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+
+
+
+/**
+ * Action creating a new diagram.
+ *
+ * @deprecated Use Eclipse native extension mechanism instead.
+ * TODO Remove it.
+
+ * @author dumoulin
+ *
+ */
+public abstract class AbstractGmfCreateDiagramAction implements ICreateDiagramAction {
+
+
+ /**
+ * Delegate to cast the parameter.
+ */
+ public void run(MultiDiagramSharedObjects sharedObjects) {
+ run((GmfMultiDiagramSharedObjects)sharedObjects);
+ }
+
+ /**
+ * Create a new class diagram
+ */
+ public void run(GmfMultiDiagramSharedObjects sharedObjects) {
+ final String diagramName = getDiagramName();
+
+ final Resource modelResource = sharedObjects.getDomainResource();
+ final Resource diagramResource = sharedObjects.getNotationResource();
+ TransactionalEditingDomain editingDomain = sharedObjects.getEditingDomain();
+
+
+
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(
+ editingDomain,
+ Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel,
+ Collections.EMPTY_LIST) {
+ protected CommandResult doExecuteWithResult(
+ IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+
+ Element model = createInitialModel();
+ attachModelToResource(model, modelResource);
+
+ Diagram diagram = ViewService.createDiagram(model, getDiagramNotationID(), getPreferenceHint());
+ if (diagram != null) {
+ diagram.setName(diagramName);
+ diagram.setElement(model);
+ diagramResource.getContents().add(diagram);
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(command,
+ new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ UMLDiagramEditorPlugin.getInstance().logError(
+ "Unable to create model and diagram", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Create a new instance of domain element associated with canvas.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ abstract protected Element createInitialModel();
+// protected Package createInitialModel() {
+// return UMLFactory.eINSTANCE.createPackage();
+// }
+
+ /**
+ * Store model element in the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void attachModelToResource(Element model, Resource resource) {
+ resource.getContents().add(model);
+ }
+
+ /**
+ * @return
+ */
+ abstract protected String getDiagramNotationID();
+ /**
+ * @return
+ */
+ abstract protected PreferencesHint getPreferenceHint();
+
+
+ /**
+ * Get the name used for diagram.
+ * @return
+ */
+ abstract protected String getDiagramName();
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramCommandHandler.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramCommandHandler.java
new file mode 100644
index 00000000000..0d380f46206
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractGmfCreateDiagramCommandHandler.java
@@ -0,0 +1,162 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.sasheditor.extension.ExtensionMultiDiagramEditor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.diagram.clazz.part.Messages;
+import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Command creating a new diagram. This command is intended to be used in eclipse extensions.
+ * This Handler is for editors using SharedObject.
+ *
+ * @deprecated Now use context.
+ * @author dumoulin
+ *
+ */
+public abstract class AbstractGmfCreateDiagramCommandHandler extends AbstractHandler implements IHandler {
+
+ /**
+ * Get the current MultiDiagramEditor.
+ *
+ * @return
+ */
+ protected ExtensionMultiDiagramEditor getMultiDiagramEditor() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editorPart = page.getActiveEditor();
+ return (ExtensionMultiDiagramEditor) editorPart;
+
+ }
+
+ /**
+ * Get the shared object.
+ *
+ * @return
+ */
+ protected GmfMultiDiagramSharedObjects getMultiEditorSharedObject() {
+ ExtensionMultiDiagramEditor editor = getMultiDiagramEditor();
+ return (GmfMultiDiagramSharedObjects) editor.getSharedObjects();
+ }
+
+ /**
+ * Method called when the command is invoked.
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ GmfMultiDiagramSharedObjects sharedObjects;
+ try {
+ sharedObjects = getMultiEditorSharedObject();
+ } catch (ClassCastException ex) {
+ // Bad current editor. Skip
+ throw new ExecutionException("Current editor type not supported.", ex);
+ }
+
+ run(sharedObjects);
+
+ return null;
+ }
+
+ /**
+ * Create a new class diagram
+ */
+ protected void run(GmfMultiDiagramSharedObjects sharedObjects) {
+ final String diagramName = getDiagramName();
+
+ final Resource modelResource = sharedObjects.getDomainResource();
+ final Resource diagramResource = sharedObjects.getNotationResource();
+ TransactionalEditingDomain editingDomain = sharedObjects.getEditingDomain();
+
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Element model = createInitialModel();
+ attachModelToResource(model, modelResource);
+
+ Diagram diagram = ViewService.createDiagram(model, getDiagramNotationID(), getPreferenceHint());
+ if (diagram != null) {
+ diagram.setName(diagramName);
+ diagram.setElement(model);
+ diagramResource.getContents().add(diagram);
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Create a new instance of domain element associated with canvas. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ abstract protected Element createInitialModel();
+
+ // protected Package createInitialModel() {
+ // return UMLFactory.eINSTANCE.createPackage();
+ // }
+
+ /**
+ * Store model element in the resource. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void attachModelToResource(Element model, Resource resource) {
+ resource.getContents().add(model);
+ }
+
+ /**
+ * @return
+ */
+ abstract protected String getDiagramNotationID();
+
+ /**
+ * @return
+ */
+ abstract protected PreferencesHint getPreferenceHint();
+
+ /**
+ * Get the name used for diagram.
+ *
+ * @return
+ */
+ abstract protected String getDiagramName();
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractPapyrusGmfCreateDiagramCommandHandler.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractPapyrusGmfCreateDiagramCommandHandler.java
new file mode 100644
index 00000000000..aae642d5b14
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/AbstractPapyrusGmfCreateDiagramCommandHandler.java
@@ -0,0 +1,278 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.core.editor.BackboneContext;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.multidiagram.SashDiagramModelUtil;
+import org.eclipse.papyrus.core.utils.DiResourceSet;
+import org.eclipse.papyrus.di.CoreSemanticModelBridge;
+import org.eclipse.papyrus.di.DiFactory;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.diagram.clazz.part.Messages;
+import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * Command creating a new GMF diagram in Papyrus. This command is intended to be used in eclipse extensions. This command is to be used with Editors using Context.
+ *
+ * @author dumoulin
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public abstract class AbstractPapyrusGmfCreateDiagramCommandHandler extends AbstractHandler implements IHandler {
+
+ /**
+ * Method called when the command is invoked.
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ BackboneContext context;
+ try {
+ context = getDefaultContext();
+ } catch (ClassCastException ex) {
+ // Bad current editor. Skip
+ throw new ExecutionException("Current editor type not supported.", ex);
+ }
+ Element container = null;
+ // if editor is open and active
+ if (getMultiDiagramEditor() != null) {
+ container = getSelectedUmlElement();
+ }
+ runAsTransaction(context, container);
+ return null;
+ }
+
+ /**
+ * Create a new class diagram
+ */
+ protected void runAsTransaction(BackboneContext sharedObjects, Element container) {
+ DiResourceSet diResourceSet = sharedObjects.getResourceSet();
+ runAsTransaction(diResourceSet, container);
+ }
+
+ /**
+ * Create a new class diagram
+ */
+ protected void runAsTransaction(final DiResourceSet diResourceSet, final Element container) {
+ final String diagramName = getDiagramName();
+ if (diagramName != null) {
+ final Resource modelResource = diResourceSet.getUMLModelResource();
+ final Resource diagramResource = diResourceSet.getNotationResource();
+ final Resource diResource = diResourceSet.getDiResource();
+ // TODO: get the appropriate value from diResourceSet
+ TransactionalEditingDomain editingDomain = diResourceSet.getTransactionalEditingDomain();
+
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Element model = container;
+ if (model == null) {
+ model = getModel(modelResource);
+ attachModelToResource(model, modelResource);
+ }
+
+ Diagram diagram = ViewService.createDiagram(model, getDiagramNotationID(), getPreferenceHint());
+ if (diagram != null) {
+ diagram.setName(diagramName);
+ diagram.setElement(model);
+ diagramResource.getContents().add(diagram);
+ }
+
+ // Add element to di2
+ // org.eclipse.papyrus.di.Diagram diDiagram = createDi2GmfDiagram(diagram);
+ // diResource.getContents().add(diDiagram);
+ SashDiagramModelUtil.openDiagramInCurrentFolder(diResource, diagram);
+
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ e.printStackTrace();
+ UMLDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /**
+ * Create a di2 diagram referencing the notation diagram.
+ *
+ * @param notationDiagram
+ * @return
+ */
+ protected org.eclipse.papyrus.di.Diagram createDi2GmfDiagram(Diagram notationDiagram) {
+ org.eclipse.papyrus.di.Diagram diDiagram = DiFactory.eINSTANCE.createDiagram();
+ CoreSemanticModelBridge bridge = DiFactory.eINSTANCE.createCoreSemanticModelBridge();
+ bridge.setElement(notationDiagram);
+
+ diDiagram.setName(notationDiagram.getName());
+ diDiagram.setSemanticModel(bridge);
+ diDiagram.setType(GmfEditorFactory.GMF_DIAGRAM);
+ diDiagram.setIsVisible(true);
+
+ return diDiagram;
+ }
+
+ /**
+ * Get the instance of domain element associated with canvas.
+ */
+ protected Element getModel(Resource modelResource) {
+ if (modelResource != null && modelResource.getContents() != null) {
+ if (modelResource.getContents().size() > 0) {
+ Object root = modelResource.getContents().get(0);
+ if (root instanceof Element) {
+ return (Element) root;
+ }
+ }
+ }
+ return UMLFactory.eINSTANCE.createModel();
+ }
+
+ /**
+ * Store model element in the resource.
+ */
+ protected void attachModelToResource(Element model, Resource resource) {
+ resource.getContents().add(model);
+ }
+
+ /**
+ * @return
+ */
+ abstract protected String getDiagramNotationID();
+
+ /**
+ * @return
+ */
+ abstract protected PreferencesHint getPreferenceHint();
+
+ /**
+ * Get the name used for diagram.
+ *
+ * @return
+ */
+ abstract protected String getDiagramName();
+
+ /**
+ * Get currently selected UML element.
+ *
+ * @return The currently selected UML element, or null if any.
+ */
+ protected NamedElement getSelectedUmlElement() {
+
+ Object selected = getCurrentSelection();
+ if (selected == null)
+ return null;
+ return (NamedElement) getDefaultContext().getModelResolver().getBussinessModel(selected);
+ }
+
+ /**
+ * Get current selection first element.
+ *
+ * @return the selected element or null.
+ */
+ private Object getCurrentSelection() {
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
+ return structuredSelection.getFirstElement();
+ }
+
+ return null;
+ }
+
+ /**
+ * Create a diagram.
+ *
+ * @param umlOwner
+ * @param name
+ * @param type
+ * @return
+ */
+ protected Diagram createDiagram(Element umlOwner, String name, String type) {
+ // create diagram
+ Diagram diagram = null;
+
+ return diagram;
+ }
+
+ /**
+ * Get the current MultiDiagramEditor.
+ *
+ * @return
+ */
+ protected IMultiDiagramEditor getMultiDiagramEditor() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editorPart = page.getActiveEditor();
+ return (IMultiDiagramEditor) editorPart;
+ }
+
+ /**
+ * Get the shared object.
+ *
+ * @return
+ */
+ protected BackboneContext getDefaultContext() {
+ IMultiDiagramEditor editor = getMultiDiagramEditor();
+ return (BackboneContext) editor.getDefaultContext();
+ }
+
+ /**
+ * Open popup to enter the new diagram name
+ *
+ * @param defaultValue
+ * the default value
+ * @return the entered diagram name
+ */
+ protected String openDiagramNameDialog(final String defaultValue) {
+ InputDialog inputDialog = new InputDialog(Display.getCurrent().getActiveShell(), "Enter a new diagram name", "The new diagram name:", defaultValue, null);
+ int ret = inputDialog.open();
+ if (ret == Window.OK) {
+ String name = inputDialog.getValue();
+ if (name == null || name.length() == 0) {
+ name = defaultValue;
+ }
+ return name;
+ } else {
+ return null;
+ }
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Activator.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Activator.java
new file mode 100644
index 00000000000..3afd5cc736e
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Activator.java
@@ -0,0 +1,283 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+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.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.uml2.diagram.clazz.part.UMLDocumentProvider;
+import org.eclipse.uml2.diagram.common.providers.AlternativeUMLItemProviderAdapterFactory;
+import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * @generated
+ */
+public class Activator extends AbstractUIPlugin {
+
+ /**
+ * @generated
+ */
+ public static final String ID = "org.eclipse.papyrus.gmf.multipages"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
+
+ /**
+ * @generated
+ */
+ private static Activator instance;
+
+ /**
+ * @generated
+ */
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * @generated
+ */
+ private GmfMultiDiagramDocumentProvider documentProvider;
+
+ /**
+ * @generated
+ */
+ public Activator() {
+ }
+
+ /**
+ * @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 Activator getInstance() {
+ return instance;
+ }
+
+ /**
+ * @generated
+ */
+ protected ComposedAdapterFactory createAdapterFactory() {
+ List factories = new ArrayList();
+ fillItemProviderFactories(factories);
+ return new ComposedAdapterFactory(factories);
+ }
+
+ /**
+ * @generated
+ */
+ protected void fillItemProviderFactoriesGen(List factories) {
+ factories.add(new UMLItemProviderAdapterFactory());
+ factories.add(new EcoreItemProviderAdapterFactory());
+ factories.add(new ResourceItemProviderAdapterFactory());
+ factories.add(new ReflectiveItemProviderAdapterFactory());
+ }
+
+ /**
+ * Use alternative UMLItemProviderAdapterFactory insteadof UMLItemProviderAdapterFactory
+ * @see org.eclipse.emf.edit.provider.ComposedAdapterFactory#getFactoryForTypes(java.util.Collection)
+ * @generated NOT
+ */
+ protected void fillItemProviderFactories(List factories) {
+ factories.add(new AlternativeUMLItemProviderAdapterFactory(getPreferenceStore()));
+ fillItemProviderFactoriesGen(factories);
+ }
+
+ /**
+ * @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 string from plug-in's resource bundle
+ * @generated
+ */
+ public static String getString(String key) {
+ return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * @generated
+ */
+ public GmfMultiDiagramDocumentProvider getDocumentProvider() {
+ throw new UnsupportedOperationException("Try to get DocumentProvider from plugin !!! - use shared object instead.");
+// if (documentProvider == null) {
+// documentProvider = new GmfMultiDiagramDocumentProvider();
+// }
+// return documentProvider;
+ }
+
+ /**
+ * @generated
+ */
+ public void logError(String error) {
+ logError(error, null);
+ }
+
+ /**
+ * @param throwable actual error or null could be passed
+ * @generated
+ */
+ public void logError(String error, Throwable throwable) {
+ if (error == null && throwable != null) {
+ error = throwable.getMessage();
+ }
+ getLog().log(new Status(IStatus.ERROR, Activator.ID, IStatus.OK, error, throwable));
+ debug(error, throwable);
+ }
+
+ /**
+ * @generated
+ */
+ public void logInfo(String message) {
+ logInfo(message, null);
+ }
+
+ /**
+ * @param throwable actual error or null could be passed
+ * @generated
+ */
+ public void logInfo(String message, Throwable throwable) {
+ if (message == null && throwable != null) {
+ message = throwable.getMessage();
+ }
+ getLog().log(new Status(IStatus.INFO, Activator.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();
+ }
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ *
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(ID, path);
+ }
+
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorContext.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorContext.java
new file mode 100644
index 00000000000..150b1b832dc
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorContext.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.extension.editorcontext.AbstractEditorContext;
+import org.eclipse.ui.IEditorInput;
+
+/**
+ * the GMFeditorContext for GMFeditor
+ *
+ * @author Cedric Dumoulin
+ * @author Patrick Tessier
+ * @author Remi Schnekenburger
+ */
+public class GmfEditorContext extends AbstractEditorContext {
+
+ /**
+ * The document provider used by GMF.
+ */
+ private IDocumentProvider documentProvider;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void init(IMultiDiagramEditor multiEditor) throws BackboneException {
+ super.init(multiEditor);
+ documentProvider = new GmfMultiDiagramDocumentProvider(multiEditor.getDefaultContext().getTransactionalEditingDomain());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setInput(IEditorInput input) {
+ }
+
+ /**
+ * Returns the document provider used by GMF.
+ *
+ * @return the document provider used by GMF
+ */
+ public IDocumentProvider getDocumentProvider() {
+ return documentProvider;
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorFactory.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorFactory.java
new file mode 100644
index 00000000000..fc2b71a00e5
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfEditorFactory.java
@@ -0,0 +1,117 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import java.lang.reflect.Constructor;
+
+import org.eclipse.gef.ui.parts.GraphicalEditor;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.extension.diagrameditor.AbstractEditorFactory;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContext;
+import org.eclipse.papyrus.di.CoreSemanticModelBridge;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * Base class of GmfEditor factories. Editor should subclass this class and provide a 0 args constructor initializing the super class.
+ *
+ * @author Cedric Dumoulin
+ * @author Remi Schnekenburger
+ * @author Patrick Tessier
+ */
+public class GmfEditorFactory extends AbstractEditorFactory {
+
+ public static final String GMF_DIAGRAM = "diagram.gmf";
+
+ /**
+ * Creates a new GmfEditorFactory.
+ *
+ * @param diagramClass
+ * expected Class of the diagram to create.
+ * @param expectedType
+ * expected diagram type (@see {@link Diagram#getType()})
+ */
+ public GmfEditorFactory(Class<?> diagramClass, String expectedType) {
+ super(diagramClass, expectedType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isEditorFor(Object root) {
+
+ // TODO Change next to remove dependency on di2.
+ // Retrieve GMF diagram, if any.
+ if (root instanceof org.eclipse.papyrus.di.Diagram) {
+ org.eclipse.papyrus.di.Diagram di2Diagram = (org.eclipse.papyrus.di.Diagram) root;
+ if (!GMF_DIAGRAM.equals(di2Diagram.getType()))
+ return false;
+ // Ok, this is a gmf diagram
+ root = ((CoreSemanticModelBridge) di2Diagram.getSemanticModel()).getElement();
+ }
+
+ if (root instanceof Diagram) {
+ Diagram diagram = (Diagram) root;
+ final String type = diagram.getType();
+ return getExpectedType().equals(type);
+ }
+ // no
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IEditorPart createEditorFor(IEditorContext context, Object root) throws BackboneException {
+ assert (context instanceof GmfEditorContext);
+ return createEditorFor((GmfEditorContext) context, root);
+ }
+
+ /**
+ * It is used to create the editor by taking account the root element, for example a diagram
+ *
+ * @param context
+ * the gmf context
+ * @param root
+ * the element on which the editor can be launch , for example the editor
+ * @return the created editor
+ * @throws BackboneException
+ * editor could not be created
+ */
+ public IEditorPart createEditorFor(GmfEditorContext context, Object root) throws BackboneException {
+ GraphicalEditor editor;
+
+ // TODO Change next to remove dependency on di2.
+ // Retrieve GMF diagram, if any.
+ if (root instanceof org.eclipse.papyrus.di.Diagram) {
+ org.eclipse.papyrus.di.Diagram di2Diagram = (org.eclipse.papyrus.di.Diagram) root;
+ if (!GMF_DIAGRAM.equals(di2Diagram.getType()))
+ throw new BackboneException("Problem retrieving GMF Diagram.");
+ // Ok, this is a gmf diagram
+ root = ((CoreSemanticModelBridge) di2Diagram.getSemanticModel()).getElement();
+ }
+
+ try {
+ Constructor<?> c = getDiagramClass().getConstructor(Diagram.class, GmfEditorContext.class);
+ editor = (GraphicalEditor) c.newInstance((Diagram) root, context);
+ // editor = new ClassDiagramEditor((Diagram)root, context.getModelMngr(), context.getCommandStack(), context.getActionRegistry() );
+ return editor;
+
+ } catch (Exception e) {
+ // Lets propagate. This is an implementation problem that should be solved by programmer.
+ throw new BackboneException(e);
+ }
+ }
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramDocumentProvider.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramDocumentProvider.java
new file mode 100644
index 00000000000..82625153c4d
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramDocumentProvider.java
@@ -0,0 +1,1076 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+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.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+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 GmfMultiDiagramDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider, IEditingDomainProvider {
+
+ // public static String EditingDomainID = "org.eclipse.uml2.diagram.clazz.EditingDomain";
+ public static String EditingDomainID = "com.cea.papyrus.core.PapyrusEditingDomainID";
+
+ /**
+ * The shared ResourceSet.
+ */
+ private TransactionalEditingDomain sharedEditingDomain = null;
+
+ /**
+ * ResourceSet to use when creation EditingDomain. Can be null.
+ */
+ private ResourceSet resourceSet;
+
+ /**
+ * @param resourceSet
+ */
+ public GmfMultiDiagramDocumentProvider(ResourceSet resourceSet) {
+ super();
+ this.resourceSet = resourceSet;
+ }
+
+ /**
+ * @param resourceSet
+ */
+ public GmfMultiDiagramDocumentProvider(TransactionalEditingDomain editingDomain) {
+ super();
+ this.sharedEditingDomain = editingDomain;
+ configureEditingDomain(sharedEditingDomain);
+ }
+
+ /**
+ * Constructor.
+ */
+ public GmfMultiDiagramDocumentProvider() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @generated
+ */
+ protected ElementInfo createElementInfo(Object element) throws CoreException {
+ if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind(Messages.UMLDocumentProvider_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, Activator.ID, 0, NLS.bind(Messages.UMLDocumentProvider_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 it = info.getResourceSet().getResources().iterator(); 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;
+ }
+
+ /**
+ * Create the editing Domain. All Editing Domain will be created with the same ResourceSet. The first creation will record the ResourceSet, other creation will use it.
+ */
+ private TransactionalEditingDomain createEditingDomain() {
+
+ TransactionalEditingDomain editingDomain = null;
+ // System.out.println(this.getClass().getSimpleName() + "- (" + this + ")");
+ // Check if edit domain exist
+ if (sharedEditingDomain != null) { // Already initialized
+ editingDomain = sharedEditingDomain;
+ System.out.println(this.getClass().getSimpleName() + ".createEditingDomain() - got EditingDomain from previous call (" + editingDomain + ")");
+ return editingDomain;
+ }
+
+ // No editingDomain. Create and initialize a new one.
+
+ // Try to get a registered one if any
+ editingDomain = TransactionalEditingDomain.Registry.INSTANCE.getEditingDomain(EditingDomainID);
+ if (editingDomain != null) {
+ // got it
+ sharedEditingDomain = editingDomain;
+ System.out.println(this.getClass().getSimpleName() + ".createEditingDomain() - got EditingDomain from REGISTRY (" + editingDomain + ")");
+ return editingDomain;
+ }
+
+ // Create EditingDomain using provided ResourceSet if any.
+ if (resourceSet == null) {
+ editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
+ } else {
+ editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain(resourceSet);
+ }
+ sharedEditingDomain = editingDomain;
+ editingDomain.setID(EditingDomainID); //$NON-NLS-1$
+ System.out.println(this.getClass().getSimpleName() + ".createEditingDomain() - create a new EditingDomain (" + editingDomain + ")");
+
+ configureEditingDomain(editingDomain);
+
+ return editingDomain;
+ }
+
+ /**
+ * Configure an EditingDomain suitable for GMF. This method should be called only once for an EditingDomain.
+ *
+ * @param editingDomain
+ */
+ private void configureEditingDomain(TransactionalEditingDomain editingDomain) {
+ // Add listener on resource change
+ 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;
+ }
+
+ });
+ }
+
+ /**
+ * @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.UMLDocumentProvider_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, Activator.ID, 0, msg != null ? msg : Messages.UMLDocumentProvider_DiagramLoadingError, e));
+ }
+ throw thrownExcp;
+ }
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind(Messages.UMLDocumentProvider_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 files2Validate = new ArrayList();
+ for (Iterator it = info.getResourceSet().getResources().iterator(); 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) {
+ Activator.getInstance().logError(Messages.UMLDocumentProvider_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) {
+ Activator.getInstance().logError(Messages.UMLDocumentProvider_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 it = info.getResourceSet().getResources().iterator(); 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 rules = new ArrayList();
+ for (Iterator it = info.getResourceSet().getResources().iterator(); 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 rules = new ArrayList();
+ for (Iterator it = info.getResourceSet().getResources().iterator(); 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 rules = new ArrayList();
+ for (Iterator it = info.getResourceSet().getResources().iterator(); 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 files = new ArrayList();
+ for (Iterator it = info.getResourceSet().getResources().iterator(); 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 it = info.getResourceSet().getResources().iterator(); 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, Activator.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, Messages.UMLDocumentProvider_UnsynchronizedFileSaveError, null));
+ }
+ info.stopResourceListening();
+ fireElementStateChanging(element);
+ List resources = info.getResourceSet().getResources();
+ try {
+ monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, resources.size() + 1); // "Saving diagram"
+ for (Iterator it = resources.iterator(); it.hasNext();) {
+ Resource nextResource = (Resource) it.next();
+ monitor.setTaskName(NLS.bind(Messages.UMLDocumentProvider_SaveNextResourceTask, nextResource.getURI()));
+ if (nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
+ try {
+ nextResource.save(UMLDiagramEditorUtil.getSaveOptions());
+ } catch (IOException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.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, Activator.ID, 0, NLS.bind(Messages.UMLDocumentProvider_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, Activator.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.UMLDocumentProvider_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(UMLDiagramEditorUtil.getSaveOptions());
+ } catch (ExecutionException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, e.getLocalizedMessage(), null));
+ } catch (IOException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.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) {
+ Activator.getInstance().logError(Messages.UMLDocumentProvider_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 IEditorInput getEditorInput() {
+ return myEditorInput;
+ }
+
+ /**
+ * @generated
+ */
+ public void dispose() {
+ stopResourceListening();
+ getResourceSet().eAdapters().remove(myResourceSetListener);
+ for (Iterator it = getResourceSet().getResources().iterator(); it.hasNext();) {
+ Resource resource = (Resource) it.next();
+ resource.unload();
+ }
+ }
+
+ /**
+ * @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() {
+ // Do not listen because all document use the same EditingDomain
+ // 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 it = myInfo.getResourceSet().getResources().iterator(); 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));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Return the editingDomain
+ */
+ public EditingDomain getEditingDomain() {
+ if (sharedEditingDomain == null) {
+ createEditingDomain();
+ }
+ return sharedEditingDomain;
+ }
+
+ public static String getEditingDomainID() {
+ return "org.eclipse.uml2.diagram.clazz.EditingDomain";
+ }
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramEditor.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramEditor.java
new file mode 100644
index 00000000000..3556b420dd4
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramEditor.java
@@ -0,0 +1,405 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.EditDomain;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentEditor;
+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.papyrus.sasheditor.extension.ExtensionMultiDiagramEditor;
+import org.eclipse.papyrus.sasheditor.extension.MultiDiagramSharedObjects;
+import org.eclipse.papyrus.sasheditor.gef.GefMultiPageEditorPart;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IReusableEditor;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.part.IShowInSource;
+import org.eclipse.ui.part.ShowInContext;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+
+
+
+
+/**
+ * Base class to create GMF multitab editor.
+ * A multitab editor contains sub editor which are modified GMF generated editors.
+ * This class provides (implements or initializes) services needed by GMF
+ * @author dumoulin
+ *
+ */
+public abstract class GmfMultiDiagramEditor extends ExtensionMultiDiagramEditor
+ implements IDiagramWorkbenchPart, IShowInSource, ITabbedPropertySheetPageContributor,
+ IDocumentEditor, IReusableEditor {
+
+
+ /**
+ * Loader used to load the models.
+ */
+ private ModelManagerEditor loadedEditor;
+
+
+ /**
+ * Document provider holding all open diagrams documents.
+ */
+// private MultiDiagramDocumentProvider documentProvider;
+
+ /** Palette component, holding the tools and shapes. */
+ private static PaletteRoot PALETTE_MODEL;
+ /**
+ * The associated ModelFactory
+ */
+ private EditDomain editDomain;
+
+ /**
+ * Listener on editorModel events.
+ */
+ private PropertyChangeListener editorModelListener = new PropertyChangeListener(){
+
+ public void propertyChange(PropertyChangeEvent event) {
+ System.out.println("modelRoot changed");
+ String prop = event.getPropertyName();
+ if (ModelManagerEditor.DIAGRAM_ADDED.equals(prop)
+ || ModelManagerEditor.DIAGRAM_REMOVED.equals(prop)) {
+ refreshTabs();
+ }
+
+ }
+ };
+
+ /**
+ * Constructor.
+ *
+ */
+ public GmfMultiDiagramEditor()
+ {
+ super();
+ System.out.println("Create GmfMultiDiagramEditor");
+// setEditDomain(new DefaultEditDomain(this));
+ }
+
+
+// protected void setEditDomain(DefaultEditDomain editDomain) {
+// this.editDomain = editDomain;
+// }
+
+
+
+ /**
+ * Returns this text editor's document provider.
+ *
+ * @return the document provider or <code>null</code> if none, e.g. after closing the editor
+ */
+ public IDocumentProvider getDocumentProvider() {
+ return loadedEditor.getDocumentProvider();
+ }
+
+
+
+ /**
+ * Call the loadedEditor counterpart in order to initialize it.
+ * Should be done with init rather than setInput because the setSite() method should be called.
+ */
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ System.out.println("call setInput()");
+ super.init(site, input);
+ loadedEditor = createModelManagerEditor();
+ loadedEditor.init(site, input);
+ setPartName(input.getName());
+ }
+
+ /**
+ * Create an instance of the ModelManagerEditor which will be used to manage the models.
+ * @return
+ */
+ protected abstract ModelManagerEditor createModelManagerEditor();
+
+ /**
+ * Save the models.
+ * Forward to the model manager.
+ */
+ public void doSave(IProgressMonitor monitor) {
+ System.out.println("call doSave");
+ loadedEditor.doSave(monitor);
+ }
+
+ /**
+ * Mark the command stack of all sub-editors
+ *
+ */
+// protected void markSaveLocation() {
+// for (int i=0; i<getPageCount(); i++) {
+// IEditorPart editor = getEditor(i);
+// if (editor instanceof GraphicalPageWithFlyoutPalette ) {
+// GraphicalPageWithFlyoutPalette graphEditor = (GraphicalPageWithFlyoutPalette)editor;
+// graphEditor.markSaveLocation();
+// }
+// }
+// }
+
+ /**
+ * Perform the doSaveAs operation.
+ * Forward to the model manager.
+ */
+ public void doSaveAs() {
+ System.out.println("call doSave");
+ loadedEditor.doSaveAs();
+ }
+
+ /**
+ * Forward to the model manager.
+ */
+ public boolean isSaveAsAllowed() {
+ System.out.println("call isSaveAsAllowed");
+ return loadedEditor.isSaveAsAllowed();
+ }
+
+
+
+ private void showStack()
+ {
+ try {
+ throw new UnsupportedOperationException();
+ }
+ catch(UnsupportedOperationException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ /**
+ * @return the editDomain
+ */
+ protected EditDomain getEditDomain() {
+ return editDomain;
+ }
+
+ /**
+ *
+ * @param editDomain
+ */
+ protected void setEditDomain(DefaultEditDomain editDomain) {
+ this.editDomain = editDomain;
+ }
+
+ /**
+ * Get the list of models to be displayed.
+ * Get the root of the models, and return the list of root elements.
+ */
+ public List getModels() {
+ DiagramDocument document = (DiagramDocument)getDocumentProvider().getDocument(getEditorInput());
+
+ Diagram diagram = document.getDiagram();
+
+ return diagram.eResource().getContents();
+ }
+
+ /**
+ * Set an observer to the "diagram added" object.
+ */
+ public void activate()
+ {
+ super.activate();
+ loadedEditor.activate();
+ loadedEditor.getDiagramListListener().addPropertyChangeListener(editorModelListener);
+ }
+
+ /**
+ * Remove the observer to the "diagram added" object.
+ */
+ public void deactivate()
+ {
+ loadedEditor.deactivate();
+ loadedEditor.getDiagramListListener().addPropertyChangeListener(editorModelListener);
+ super.deactivate();
+ }
+
+ /**
+ * Get the diagram associated to the active editor.
+ * Return null if there is no active page.
+ * @return
+ */
+ public Diagram getDiagram() {
+ DiagramDocumentEditor editor = (DiagramDocumentEditor)getActiveEditor();
+ if( editor == null )
+ return null;
+ return editor.getDiagram();
+ }
+
+ /**
+ *
+ */
+ public IDiagramEditDomain getDiagramEditDomain() {
+ DiagramDocumentEditor editor = (DiagramDocumentEditor)getActiveEditor();
+ if( editor == null )
+ return null;
+ return editor.getDiagramEditDomain();
+ }
+
+ /**
+ *
+ */
+ public DiagramEditPart getDiagramEditPart() {
+ DiagramDocumentEditor editor = (DiagramDocumentEditor)getActiveEditor();
+ if( editor == null )
+ return null;
+ return editor.getDiagramEditPart();
+ }
+
+ /**
+ *
+ */
+ public IDiagramGraphicalViewer getDiagramGraphicalViewer() {
+ DiagramDocumentEditor editor = (DiagramDocumentEditor)getActiveEditor();
+ if( editor == null )
+ return null;
+ return editor.getDiagramGraphicalViewer();
+ }
+
+ /**
+ * Initialize the newly created shared object.
+ */
+// protected void initSharedObject(MultiDiagramSharedObjects sharedObject)
+// {
+// }
+
+ /**
+ * Create shared object.
+ * The shared object will be initialized with a call to initSharedObject();
+ * @return
+ */
+ protected MultiDiagramSharedObjects createSharedObject()
+ {
+ return new GmfMultiDiagramSharedObjects(loadedEditor);
+ }
+
+ /**
+ * Returns the context to show, or <code>null</code> if there is
+ * currently no valid context to show.
+ *
+ * @return the context to show, or <code>null</code>
+ */
+ public ShowInContext getShowInContext()
+ {
+ EditorPart editor = (EditorPart)getActiveEditor();
+ if( editor instanceof IShowInSource )
+ return ((IShowInSource)editor).getShowInContext();
+ // No editor, or not good type
+ return null;
+
+ }
+
+ /**
+ * Returns the contributor ID for the tabbed property sheet page.
+ *
+ * @return the contributor ID for the tabbed property sheet page.
+ */
+ public String getContributorId()
+ {
+ EditorPart editor = (EditorPart)getActiveEditor();
+ if( editor instanceof ITabbedPropertySheetPageContributor )
+ return ((ITabbedPropertySheetPageContributor)editor).getContributorId();
+ // No editor, or not good type
+ return null;
+ }
+
+ /* ------------------------- */
+ /* IDocumentEditor interface */
+ /* ------------------------- */
+
+ /**
+ * Closes this text editor after optionally saving changes.
+ *
+ * @param save <code>true</code> if unsaved changed should be saved, and
+ * <code>false</code> if unsaved changed should be discarded
+ */
+ public void close(boolean save)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+// return loadedEditor.close(save);
+ }
+
+ /**
+ * Returns whether the text in this text editor can be changed by the user.
+ *
+ * @return <code>true</code> if it can be edited, and <code>false</code> if it is read-only
+ */
+ public boolean isEditable()
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ // return loadedEditor.isEditable();
+ }
+
+ /**
+ * Returns whether the editor's input is read-only. The semantics of
+ * this method is orthogonal to <code>isEditable</code> as it talks about the
+ * editor input, i.e. the domain element, and <b>not</b> about the editor
+ * document.
+ *
+ * @return <code>true</code> if the editor input is read-only
+ */
+ public boolean isEditorInputReadOnly()
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ // return loadedEditor.isEditorInputReadOnly();
+ }
+
+
+ /**
+ * Returns whether the editor's input can be persistently be modified.
+ * This is orthogonal to <code>ITextEditorExtension.isEditorInputReadOnly</code> as read-only elements may be modifiable and
+ * writable elements may not be modifiable. If the given element is not connected to this document
+ * provider, the result is undefined. Document providers are allowed to use a cache to answer this
+ * question, i.e. there can be a difference between the "real" state of the element and the return
+ * value.
+ *
+ * @return <code>true</code> if the editor input is modifiable
+ */
+ public boolean isEditorInputModifiable()
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ // return loadedEditor.isEditorInputModifiable();
+
+ }
+
+ /**
+ * Validates the state of the given editor input. The predominate intent
+ * of this method is to take any action probably necessary to ensure that
+ * the input can persistently be changed.
+ *
+ * @return <code>true</code> if the input was validated, <code>false</code> otherwise
+ */
+ public boolean validateEditorInputState()
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ // return loadedEditor.validateEditorInputState();
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramSharedObjects.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramSharedObjects.java
new file mode 100644
index 00000000000..6e12d59718c
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiDiagramSharedObjects.java
@@ -0,0 +1,77 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
+import org.eclipse.papyrus.sasheditor.extension.MultiDiagramSharedObjects;
+
+
+/**
+ * @author dumoulin
+ *
+ */
+public class GmfMultiDiagramSharedObjects extends MultiDiagramSharedObjects {
+
+ /**
+ * The fake editor from GMF.
+ */
+ private ModelManagerEditor loadedEditor;
+
+
+ /**
+ * Constructor.
+ * @param documentProvider
+ */
+ public GmfMultiDiagramSharedObjects(ModelManagerEditor loadedEditor) {
+ super();
+ this.loadedEditor = loadedEditor;
+ }
+
+
+
+ public IDocumentProvider getDocumentProvider() {
+ return getLoadedEditor().getDocumentProvider();
+ }
+
+
+
+ public Resource getDomainResource() {
+ return getLoadedEditor().getDomainResource();
+ }
+
+
+
+ public Resource getNotationResource() {
+ return getLoadedEditor().getNotationResource();
+ }
+
+
+
+ public TransactionalEditingDomain getEditingDomain() {
+ return getLoadedEditor().getEditingDomain();
+ }
+
+
+
+ /**
+ * @return the loadedEditor
+ */
+ public ModelManagerEditor getLoadedEditor() {
+ return loadedEditor;
+ }
+
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiPagesActionBarContributor.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiPagesActionBarContributor.java
new file mode 100644
index 00000000000..5b97d51d3d8
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfMultiPagesActionBarContributor.java
@@ -0,0 +1,158 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import org.eclipse.gmf.runtime.common.core.util.Trace;
+import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService;
+import org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor;
+import org.eclipse.gmf.runtime.common.ui.util.WorkbenchPartDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIDebugOptions;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
+import org.eclipse.papyrus.sasheditor.extension.MultiDiagramActionBarContributor;
+import org.eclipse.papyrus.sasheditor.gef.GefMultiPagesActionBarContributor;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.activities.ActivityManagerEvent;
+import org.eclipse.ui.activities.IActivityManagerListener;
+
+
+/**
+ * GMF based multi diagram action bar contributor.
+ * GMF based multi diagram editors should subclass this action bar contributor.
+ * This class is based on {@link org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor}
+ * @author dumoulin and original authors from gmf.
+ *
+ */
+public abstract class GmfMultiPagesActionBarContributor extends
+ MultiDiagramActionBarContributor {
+
+
+
+ /**
+ * Listens for activity/capability events.
+ *
+ */
+ class ActivityManagerListener
+ implements IActivityManagerListener {
+
+ public void activityManagerChanged(
+ ActivityManagerEvent activityManagerEvent) {
+ if (activityManagerEvent.haveEnabledActivityIdsChanged()) {
+ updateActionBars();
+ }
+ }
+ }
+
+ /**
+ * The activity listener.
+ */
+ private ActivityManagerListener activityManagerListener;
+
+ private IWorkbenchPartDescriptor descriptor;
+
+ /**
+ * @see org.eclipse.ui.part.EditorActionBarContributor#init(org.eclipse.ui.IActionBars)
+ */
+ public void init(final IActionBars bars) {
+ super.init(bars);
+
+ descriptor =
+ new WorkbenchPartDescriptor(
+ getEditorId(),
+ getEditorClass(),
+ getPage());
+
+ try {
+// getEditingDomain().runExclusive(new Runnable() {
+ //
+// public void run() {
+ ContributionItemService.getInstance()
+ .contributeToActionBars(bars, descriptor);
+// }
+// });
+ }catch (Exception e) {
+ Trace.catching(DiagramUIPlugin.getInstance(),
+ DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(),
+ "init()", //$NON-NLS-1$
+ e);
+ }
+
+ bars.updateActionBars();
+
+ activityManagerListener = new ActivityManagerListener();
+ PlatformUI.getWorkbench().getActivitySupport().getActivityManager()
+ .addActivityManagerListener(activityManagerListener);
+ }
+
+ /**
+ * @see org.eclipse.ui.IEditorActionBarContributor#dispose()
+ */
+ public void dispose() {
+ ContributionItemService.getInstance().disposeContributions(descriptor);
+ descriptor = null;
+
+ if (activityManagerListener != null) {
+ PlatformUI.getWorkbench().getActivitySupport().getActivityManager()
+ .removeActivityManagerListener(activityManagerListener);
+ }
+ activityManagerListener = null;
+
+ super.dispose();
+ }
+
+ /**
+ * @see org.eclipse.gef.ui.actions.ActionBarContributor#declareGlobalActionKeys()
+ */
+ protected void declareGlobalActionKeys() {
+ // empty impl
+ }
+
+ /**
+ * Returns the id of the editor configured with this contributor
+ *
+ * @return The editor's id configured with this contribution
+ */
+ protected abstract String getEditorId();
+
+ /**
+ * Returns the class of the editor configured with this contributor
+ *
+ * @return The editor's class configured with this contribution
+ */
+ protected abstract Class getEditorClass();
+
+// protected abstract TransactionalEditingDomain getEditingDomain();
+
+ /**
+ * Updates the actionbars to show/hide contribution items as applicable.
+ */
+ private void updateActionBars() {
+
+ // get the new contributions
+ ContributionItemService.getInstance().updateActionBars(getActionBars(),
+ descriptor);
+
+ // refresh the UI
+ getActionBars().updateActionBars();
+ }
+
+ /**
+ * Connect the actions registered in the globalActionKeys.
+ */
+ protected void connectActions() {
+ super.connectActions();
+ updateActionBars();
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramActionBarContributor.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramActionBarContributor.java
new file mode 100644
index 00000000000..e9de4cb5e9a
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramActionBarContributor.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import org.eclipse.papyrus.sasheditor.extension.EditorFactoryRegistry;
+
+
+
+
+/**
+ * GMF based editors action bar contributor.
+ */
+public class GmfUmlMultiDiagramActionBarContributor extends
+ GmfMultiPagesActionBarContributor {
+
+ /**
+ * @generated
+ */
+ protected Class getEditorClass() {
+ return UMLModelManagerEditor.class;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getEditorId() {
+ return UMLModelManagerEditor.ID;
+ }
+
+ /**
+ * Return the EditorRegistry loading the extension points accepted by this editor.
+ * Should set the namespace.
+ */
+ protected EditorFactoryRegistry getEditorRegistry() {
+ return new EditorFactoryRegistry(Activator.ID);
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramEditor.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramEditor.java
new file mode 100644
index 00000000000..716155eb975
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/GmfUmlMultiDiagramEditor.java
@@ -0,0 +1,127 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import org.eclipse.core.commands.operations.IOperationHistory;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.gef.editparts.ZoomManager;
+import org.eclipse.gef.ui.palette.PaletteViewer;
+import org.eclipse.gef.ui.views.palette.PalettePage;
+import org.eclipse.gmf.runtime.common.ui.action.ActionManager;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.papyrus.sasheditor.extension.EditorFactoryRegistry;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.internal.util.Util;
+import org.eclipse.ui.part.IShowInTargetList;
+
+
+/**
+ * Multidiagram editors for GMF-UML generated diagrams.
+ * @author dumoulin
+ *
+ */
+public class GmfUmlMultiDiagramEditor extends GmfMultiDiagramEditor implements IDiagramWorkbenchPart {
+
+ /**
+ * From generated UML diagram.
+ * Used by Utils.
+ */
+ public static final String ID = "papyrus.multidiagram.gmf.uml.GmfUmlMultiDiagramEditor"; //$NON-NLS-1$
+
+ /**
+ * Constructor.
+ *
+ */
+ public GmfUmlMultiDiagramEditor()
+ {
+ super();
+ System.out.println("Create GmfUmlMultiDiagramEditor");
+// setEditDomain(new DefaultEditDomain(this));
+ }
+
+ /**
+ * Create an instance of the ModelManagerEditor which will be used to manage the models.
+ * @return
+ */
+ protected ModelManagerEditor createModelManagerEditor()
+ {
+ return new UMLModelManagerEditor();
+ }
+
+ /**
+ * Return the EditorRegistry loading the extension points accepted by this editor.
+ * Should set the namespace.
+ */
+ protected EditorFactoryRegistry createEditorRegistry() {
+ return new EditorFactoryRegistry(Activator.ID);
+ }
+
+
+ /**
+ * Returns the adapter for the specified key.
+ *
+ * <P><EM>IMPORTANT</EM> certain requests, such as the property sheet, may be made before
+ * or after {@link #createPartControl(Composite)} is called. The order is unspecified by
+ * the Workbench.
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+
+ public Object getAdapter(Class type) {
+
+ // check if we need to retrieve adapter from the current editor.
+ if (Display.getCurrent()!=null &&
+ (type == IShowInTargetList.class
+ || PalettePage.class == type
+ || PaletteViewer.class == type
+ || (ActionManager.class == type)
+ || (IDiagramEditDomain.class == type)
+ || (type == ZoomManager.class)
+ || (type == IUndoContext.class)
+ || (type == IOperationHistory.class) ) )
+ {
+ IEditorPart innerEditor = getActiveEditor();
+ // see bug 138823 - prevent some subclasses from causing
+ // an infinite loop
+ if (innerEditor != null && innerEditor != this) {
+ return Util.getAdapter(innerEditor, type);
+ }
+ }
+ // Check if we require the documentProvider
+ if(type == IEditingDomainProvider.class)
+ {
+ return ((GmfMultiDiagramSharedObjects)getSharedObjects()).getDocumentProvider();
+ }
+
+// Object res = loadedEditor.getAdapter(type);
+// if(res!=null)
+// return res;
+// if (type == IContentOutlinePage.class)
+// {
+//// showStack();
+// return new TreeOutlinePage(new TreeViewer(), getEditDomain(), getActionRegistry(), getSelectionSynchronizer(), getModel());
+// }
+// if (type == IDiagramOverviewPage.class)
+// {
+// System.err.println("getAdapter(" + type+ ")");
+//// showStack();
+//// return new DiagramOverviewPage(new TreeViewer(), getEditDomain(), getActionRegistry(), getSelectionSynchronizer(), getModel());
+// }
+ return super.getAdapter(type);
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Messages.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Messages.java
new file mode 100644
index 00000000000..f74eb8eedc9
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/Messages.java
@@ -0,0 +1,1292 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+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 UMLCreationWizardTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLCreationWizard_DiagramModelFilePageTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLCreationWizard_DiagramModelFilePageDescription;
+
+ /**
+ * @generated
+ */
+ public static String UMLCreationWizard_DomainModelFilePageTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLCreationWizard_DomainModelFilePageDescription;
+
+ /**
+ * @generated
+ */
+ public static String UMLCreationWizardOpenEditorError;
+
+ /**
+ * @generated
+ */
+ public static String UMLCreationWizardCreationError;
+
+ /**
+ * @generated
+ */
+ public static String UMLCreationWizardPageExtensionError;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditorUtil_CreateDiagramProgressTask;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditorUtil_CreateDiagramCommandLabel;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_isModifiable;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_handleElementContentChanged;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_IncorrectInputError;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_NoDiagramInResourceError;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_DiagramLoadingError;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_UnsynchronizedFileSaveError;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_SaveDiagramTask;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_SaveNextResourceTask;
+
+ /**
+ * @generated
+ */
+ public static String UMLDocumentProvider_SaveAsOperation;
+
+ /**
+ * @generated
+ */
+ public static String UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogMessage;
+
+ /**
+ * @generated
+ */
+ public static String UMLInitDiagramFileAction_InitDiagramFileWizardTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLInitDiagramFileAction_OpenModelFileDialogTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_CreationPageName;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_CreationPageTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_CreationPageDescription;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_RootSelectionPageName;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_RootSelectionPageTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_RootSelectionPageDescription;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_InitDiagramCommand;
+
+ /**
+ * @generated
+ */
+ public static String UMLNewDiagramFileWizard_IncorrectRootError;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditor_SavingDeletedFile;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditor_SaveAsErrorTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditor_SaveAsErrorMessage;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditor_SaveErrorTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLDiagramEditor_SaveErrorMessage;
+
+ /**
+ * @generated
+ */
+ public static String UMLElementChooserDialog_SelectModelElementTitle;
+
+ /**
+ * @generated
+ */
+ public static String ModelElementSelectionPageMessage;
+
+ /**
+ * @generated
+ */
+ public static String ValidateActionMessage;
+
+ /**
+ * @generated
+ */
+ public static String Nodes1Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Nodes1Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Children2Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Children2Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Links3Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Links3Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Instances4Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Instances4Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Association1Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Association1Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Dependency2Group_title;
+
+ /**
+ * @generated
+ */
+ public static String Dependency2Group_desc;
+
+ /**
+ * @generated
+ */
+ public static String Class1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Class1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Package2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Package2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Enumeration3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Enumeration3CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String DataType4CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String DataType4CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String PrimitiveType5CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String PrimitiveType5CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Constraint6CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Constraint6CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String AssociationClass7CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String AssociationClass7CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Interface8CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Interface8CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Attribute1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Attribute1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Operation2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Operation2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String EnumLiteral3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String EnumLiteral3CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Port4CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Port4CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String TemplateSignature5CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String TemplateSignature5CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String ElementImport6CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ElementImport6CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Generalization3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Generalization3CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String ProvidedInterface4CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ProvidedInterface4CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String RequiredInterface5CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String RequiredInterface5CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String ConstrainedElement6CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String ConstrainedElement6CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String NAryDependencyTarget7CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String NAryDependencyTarget7CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String NAryDependencySource8CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String NAryDependencySource8CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String AssociationEnd9CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String AssociationEnd9CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Realization10CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Realization10CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String InstanceSpecification1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String InstanceSpecification1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Slot2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Slot2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Association1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Association1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String SharedAggregation2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String SharedAggregation2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String CompositeAggregation3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String CompositeAggregation3CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String NavigableAssociation4CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String NavigableAssociation4CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Dependency1CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Dependency1CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Abstraction2CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Abstraction2CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Usage3CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Usage3CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String Substitution4CreationTool_title;
+
+ /**
+ * @generated
+ */
+ public static String Substitution4CreationTool_desc;
+
+ /**
+ * @generated
+ */
+ public static String PackagePackagesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String PackageClassifiersEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String PackageOtherEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String ClassAttributesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String ClassOperationsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String ClassClassesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String AssociationClassAttributesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String AssociationClassOperationsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String AssociationClassClassesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String DataTypeAttributesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String DataTypeOperationsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String PrimitiveTypeAttributesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String PrimitiveTypeOperationsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String EnumerationLiteralsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String EnumerationAttributesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String EnumerationOperationsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String InstanceSpecificationSlotsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String InterfaceAttributesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String InterfaceOperationsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String InterfaceClassesEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String PackageImportsEditPart_title;
+
+ /**
+ * @generated
+ */
+ public static String CommandName_OpenDiagram;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Package_1000_links;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Package_2002_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Package_2002_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_2001_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_2001_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_AssociationClass_2007_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_AssociationClass_2007_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DataType_2004_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DataType_2004_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_PrimitiveType_2005_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_PrimitiveType_2005_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Enumeration_2003_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Enumeration_2003_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Interface_2010_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Interface_2010_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Constraint_2006_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Constraint_2006_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InstanceSpecification_2008_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InstanceSpecification_2008_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Dependency_2009_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Dependency_2009_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_GeneralizationSet_2012_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_GeneralizationSet_2012_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Interface_2013_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Interface_2013_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Package_2014_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Package_2014_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_AssociationClass_2015_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_AssociationClass_2015_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Package_3006_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Package_3006_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_3007_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_3007_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DataType_3008_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DataType_3008_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_PrimitiveType_3009_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_PrimitiveType_3009_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Enumeration_3011_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Enumeration_3011_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_AssociationClass_3012_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_AssociationClass_3012_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InstanceSpecification_3013_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InstanceSpecification_3013_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3001_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3001_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3002_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3002_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_3003_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_3003_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Port_3025_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Port_3025_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_RedefinableTemplateSignature_3027_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_RedefinableTemplateSignature_3027_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3019_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3019_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3020_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3020_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3014_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3014_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3015_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3015_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3021_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3021_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3022_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3022_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_EnumerationLiteral_3016_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_EnumerationLiteral_3016_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3023_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3023_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3024_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3024_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Slot_3017_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3028_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_3028_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3029_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Operation_3029_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_3030_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Class_3030_outgoinglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ElementImport_3031_incominglinks;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Generalization_4001_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Generalization_4001_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Dependency_4002_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Dependency_4002_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_4003_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Property_4003_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ConstraintConstrainedElement_4004_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_ConstraintConstrainedElement_4004_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Association_4005_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Association_4005_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DependencySupplier_4006_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DependencySupplier_4006_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DependencyClient_4007_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_DependencyClient_4007_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InterfaceRealization_4008_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_InterfaceRealization_4008_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Realization_4010_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Realization_4010_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Generalization_4011_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Generalization_4011_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_GeneralizationGeneral_4012_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Usage_4013_target;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorGroupName_Usage_4013_source;
+
+ /**
+ * @generated
+ */
+ public static String NavigatorActionProvider_OpenDiagramActionName;
+
+ /**
+ * @generated
+ */
+ public static String AbstractParser_UnexpectedValueTypeMessage;
+
+ /**
+ * @generated
+ */
+ public static String AbstractParser_WrongStringConversionMessage;
+
+ /**
+ * @generated
+ */
+ public static String AbstractParser_UnknownLiteralMessage;
+
+ /**
+ * @generated
+ */
+ public static String MessageFormatParser_InvalidInputError;
+
+ /**
+ * @generated
+ */
+ public static String UMLModelingAssistantProviderTitle;
+
+ /**
+ * @generated
+ */
+ public static String UMLModelingAssistantProviderMessage;
+
+ //TODO: put accessor fields manually
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/ModelManagerEditor.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/ModelManagerEditor.java
new file mode 100644
index 00000000000..2321a4f74ee
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/ModelManagerEditor.java
@@ -0,0 +1,598 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import java.beans.PropertyChangeSupport;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+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.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+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.IDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.MEditingDomainElement;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.l10n.EditorMessages;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorMatchingStrategy;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.uml2.diagram.clazz.part.Messages;
+import org.osgi.framework.Bundle;
+
+/**
+ * This class is used as an model manager for regular GMF Editor. All editor capabilities are neutralize, except the model load and save
+ * capabilities.
+ *
+ * @author dumoulin
+ *
+ */
+public class ModelManagerEditor {
+
+ public static final String DIAGRAM_ADDED = "DIAGRAM_ADDED";
+
+ public static final String DIAGRAM_MOVED = "DIAGRAM_MOVED";
+
+ public static final String DIAGRAM_REMOVED = "DIAGRAM_REMOVED";
+
+ /**
+ * The underlying document provider.
+ */
+ protected IDocumentProvider documentProvider;
+
+ /**
+ * EditorInput provided when the editor is created.
+ */
+ protected IEditorInput editorInput;
+
+ protected IEditorSite site;
+
+ /**
+ * Listener on diagram added/removed.
+ */
+ private PropertyChangeSupport diagramListListener = new PropertyChangeSupport(this);
+
+ /**
+ * Adapter listening to diagram addition/remove events
+ */
+ private Adapter adapter = new Adapter() {
+
+ Notifier notifier;
+
+ public Notifier getTarget() {
+ return notifier;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * Notifies that a change to some feature has occurred.
+ * @param notification a description of the change.
+ */
+ public void notifyChanged(Notification notification) {
+// System.out.println("notifyChanged("+ notification +")");
+// System.out.println("getEventType=" + notification.getEventType() );
+// System.out.println("getFeature=" + notification.getFeature() );
+// System.out.println("getNotifier=" + notification.getNotifier() );
+
+ int eventType = notification.getEventType();
+ if( eventType == Notification.ADD )
+ {
+ Object newValue = notification.getNewValue();
+ if(newValue instanceof Diagram)
+ diagramListListener.firePropertyChange(DIAGRAM_ADDED, null, newValue);
+ }
+ else if(eventType == Notification.MOVE)
+ {
+ Object newValue = notification.getNewValue();
+ if(newValue instanceof Diagram)
+ diagramListListener.firePropertyChange(DIAGRAM_MOVED, null, newValue);
+
+ }
+ else if(eventType == Notification.REMOVE)
+ {
+ Object newValue = notification.getNewValue();
+ if(newValue==null)
+ System.out.println( getClass().getName() + "- Warning: can't get removed object.");
+
+ if(newValue instanceof Diagram)
+ diagramListListener.firePropertyChange(DIAGRAM_REMOVED, null, newValue);
+ }
+ }
+
+ public void setTarget(Notifier newTarget) {
+ notifier = newTarget;
+
+ }
+
+ };
+
+
+ /**
+ * @param hasFlyoutPalette
+ */
+ public ModelManagerEditor(IDocumentProvider documentProvider) {
+ this.documentProvider = documentProvider;
+ }
+
+
+ public IDocumentProvider getDocumentProvider() {
+ return documentProvider;
+ }
+
+ /**
+ *
+ */
+ public TransactionalEditingDomain getEditingDomain() {
+ IDocument document = getEditorInput() != null ? getDocumentProvider().getDocument(getEditorInput()) : null;
+ if (document instanceof IDiagramDocument) {
+ return ((IDiagramDocument) document).getEditingDomain();
+ }
+ return getEditorInput() instanceof MEditingDomainElement ? ((MEditingDomainElement)getEditorInput()).getEditingDomain() : null;
+ }
+
+ /**
+ * @cdm
+ */
+ public void setInput(IEditorInput input) {
+ System.out.println(this + ".setInput(IEditorInput input)");
+ }
+
+ /**
+ *
+ * @param site
+ * @param input
+ * @throws PartInitException
+ */
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+// System.out.println(this + ".init(IEditorSite site, IEditorInput input)");
+ this.editorInput = input;
+ this.site = site;
+ try {
+ getDocumentProvider().connect(input);
+ } catch (CoreException x) {
+ // code from DiagramDocumentEditor.setInput(IEditorInput)
+ String title= EditorMessages.Editor_error_setinput_title;
+ String msg= EditorMessages.Editor_error_setinput_message;
+ Shell shell= site.getShell();
+ ErrorDialog.openError(shell, title, msg, x.getStatus());
+ }
+ }
+
+ /**
+ * Returns diagram list listener.
+ * This listener send event whenever a diagram is added or removed to the eResource.
+ * @return the listener
+ */
+ public PropertyChangeSupport getDiagramListListener(){
+ return diagramListListener;
+ }
+
+ /**
+ * Called when the editor should be activated.
+ * Subclass should implements this method to register listeners to the model.
+ *
+ */
+ public void activate()
+ {
+ getNotationModelEResource().eAdapters().add(adapter);
+
+ }
+
+ /**
+ * Called when the editor is deactivated.
+ *
+ */
+ public void deactivate()
+ {
+ getNotationModelEResource().eAdapters().remove(adapter);
+ }
+
+ private Resource getNotationModelEResource()
+ {
+ // Get the default diagram document
+ DiagramDocument document = (DiagramDocument)getDocumentProvider().getDocument(getEditorInput());
+ Diagram diagram = document.getDiagram();
+
+ return diagram.eResource();
+ }
+
+ /**
+ * Get the resource for notation model.
+ * @return
+ */
+ public Resource getNotationResource()
+ {
+ return getNotationModelEResource();
+ }
+
+ /**
+ * Get the resource for the domain model.
+ * @return
+ */
+ public Resource getDomainResource()
+ {
+ // Get the default diagram document
+ DiagramDocument document = (DiagramDocument)getDocumentProvider().getDocument(getEditorInput());
+ Diagram diagram = document.getDiagram();
+
+ EObject rootObject = diagram.getElement();
+ return rootObject.eResource();
+ }
+
+
+ /**
+ * @return the editorInput
+ */
+ public IEditorInput getEditorInput() {
+ return editorInput;
+ }
+
+ /**
+ * The <code>AbstractDiagramEditor</code> implementation of this
+ * <code>IEditorPart</code> method may be extended by subclasses.
+ *
+ * @param progressMonitor the progress monitor for communicating result state or <code>null</code>
+ */
+ public void doSave(IProgressMonitor progressMonitor) {
+
+ IDocumentProvider p= getDocumentProvider();
+ if (p == null)
+ return;
+
+ if (p.isDeleted(getEditorInput())) {
+
+ if (isSaveAsAllowed()) {
+
+ /*
+ * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors.
+ * Changed Behavior to make sure that if called inside a regular save (because
+ * of deletion of input element) there is a way to report back to the caller.
+ */
+ performSaveAs(progressMonitor);
+
+ } else {
+
+ Shell shell= getSite().getShell();
+ String title= EditorMessages.Editor_error_save_deleted_title;
+ String msg= EditorMessages.Editor_error_save_deleted_message;
+ MessageDialog.openError(shell, title, msg);
+ }
+
+ } else {
+ updateState(getEditorInput());
+ validateState(getEditorInput());
+ performSave(false, progressMonitor);
+ }
+ }
+
+ /**
+ * Updates the state of the given editor input such as read-only flag.
+ *
+ * @param input the input to be validated
+ *
+ */
+ protected void updateState(IEditorInput input) {
+ IDocumentProvider provider= getDocumentProvider();
+ try {
+
+ provider.updateStateCache(input);
+
+// if (getDiagramEditPart() != null) {
+// if(isEditable())
+// getDiagramEditPart().enableEditMode();
+// else
+// getDiagramEditPart().disableEditMode();
+// }
+
+ } catch (CoreException x) {
+ Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID);
+ ILog log= Platform.getLog(bundle);
+ log.log(x.getStatus());
+ }
+ }
+
+ /**
+ * Validates the state of the given editor input. The predominate intent
+ * of this method is to take any action probably necessary to ensure that
+ * the input can persistently be changed.
+ *
+ * @param input the input to be validated
+ *
+ */
+ protected void validateState(IEditorInput input) {
+
+ IDocumentProvider provider= getDocumentProvider();
+
+ try {
+
+ provider.validateState(input, getSite().getShell());
+
+ } catch (CoreException x) {
+ IStatus status= x.getStatus();
+ if (status == null || status.getSeverity() != IStatus.CANCEL) {
+ Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID);
+ ILog log= Platform.getLog(bundle);
+ log.log(x.getStatus());
+
+ Shell shell= getSite().getShell();
+ String title= EditorMessages.Editor_error_validateEdit_title;
+ String msg= EditorMessages.Editor_error_validateEdit_message;
+ ErrorDialog.openError(shell, title, msg, x.getStatus());
+ }
+ return;
+ }
+
+
+// if (getDiagramEditPart() != null) {
+// if(isEditable())
+// getDiagramEditPart().enableEditMode();
+// else
+// getDiagramEditPart().disableEditMode();
+// }
+
+ }
+
+ /**
+ * @generated
+ */
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * @generated
+ */
+ public void doSaveAs() {
+ performSaveAs(new NullProgressMonitor());
+ }
+
+ /**
+ * Performs the save and handles errors appropriately.
+ *
+ * @param overwrite indicates whether or not overwriting is allowed
+ * @param progressMonitor the monitor in which to run the operation
+ *
+ */
+ protected void performSave(boolean overwrite, IProgressMonitor progressMonitor) {
+
+ IDocumentProvider provider= getDocumentProvider();
+ if (provider == null)
+ return;
+
+ try {
+
+ provider.aboutToChange(getEditorInput());
+ IEditorInput input= getEditorInput();
+ provider.saveDocument(progressMonitor, input, getDocumentProvider().getDocument(input), overwrite);
+// editorSaved();
+
+ } catch (CoreException x) {
+ IStatus status= x.getStatus();
+ if (status == null || status.getSeverity() != IStatus.CANCEL)
+ handleExceptionOnSave(x, progressMonitor);
+ } finally {
+ provider.changed(getEditorInput());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void performSaveAs(IProgressMonitor progressMonitor) {
+ Shell shell = getSite().getShell();
+ IEditorInput input = getEditorInput();
+ SaveAsDialog dialog = new SaveAsDialog(shell);
+ IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
+ if (original != null) {
+ dialog.setOriginalFile(original);
+ }
+ dialog.create();
+ IDocumentProvider provider = getDocumentProvider();
+ if (provider == null) {
+ // editor has been programmatically closed while the dialog was open
+ return;
+ }
+ if (provider.isDeleted(input) && original != null) {
+ String message = NLS.bind(Messages.UMLDiagramEditor_SavingDeletedFile, original.getName());
+ dialog.setErrorMessage(null);
+ dialog.setMessage(message, IMessageProvider.WARNING);
+ }
+ if (dialog.open() == Window.CANCEL) {
+ if (progressMonitor != null) {
+ progressMonitor.setCanceled(true);
+ }
+ return;
+ }
+ IPath filePath = dialog.getResult();
+ if (filePath == null) {
+ if (progressMonitor != null) {
+ progressMonitor.setCanceled(true);
+ }
+ return;
+ }
+ IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+ IFile file = workspaceRoot.getFile(filePath);
+ final IEditorInput newInput = new FileEditorInput(file);
+ // Check if the editor is already open
+ IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
+ IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
+ for (int i = 0; i < editorRefs.length; i++) {
+ if (matchingStrategy.matches(editorRefs[i], newInput)) {
+ MessageDialog.openWarning(shell, Messages.UMLDiagramEditor_SaveAsErrorTitle, Messages.UMLDiagramEditor_SaveAsErrorMessage);
+ return;
+ }
+ }
+ boolean success = false;
+ try {
+ provider.aboutToChange(newInput);
+// getDocumentProvider(newInput).saveDocument(progressMonitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);
+ getDocumentProvider().saveDocument(progressMonitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);
+ success = true;
+ } catch (CoreException x) {
+ IStatus status = x.getStatus();
+ if (status == null || status.getSeverity() != IStatus.CANCEL) {
+ ErrorDialog.openError(shell, Messages.UMLDiagramEditor_SaveErrorTitle, Messages.UMLDiagramEditor_SaveErrorMessage, x.getStatus());
+ }
+ } finally {
+ provider.changed(newInput);
+ if (success) {
+ setInput(newInput);
+ }
+ }
+ if (progressMonitor != null) {
+ progressMonitor.setCanceled(!success);
+ }
+ }
+
+ /**
+ * Retrieves the descriptor for this editor
+ *
+ * @return the editor descriptor
+ */
+ final protected IEditorDescriptor getEditorDescriptor() {
+ IEditorRegistry editorRegistry= PlatformUI.getWorkbench().getEditorRegistry();
+ IEditorDescriptor editorDesc= editorRegistry.findEditor(getSite().getId());
+ return editorDesc;
+ }
+
+ /**
+ * The number of re-entrances into error correction code while saving.
+ *
+ */
+ private int fErrorCorrectionOnSave;
+
+ /**
+ * Handles the given exception. If the exception reports an out-of-sync
+ * situation, this is reported to the user. Otherwise, the exception
+ * is generically reported.
+ *
+ * @param exception the exception to handle
+ * @param progressMonitor the progress monitor
+ */
+ protected void handleExceptionOnSave(CoreException exception, IProgressMonitor progressMonitor) {
+
+ try {
+ ++ fErrorCorrectionOnSave;
+
+ Shell shell= getSite().getShell();
+
+ boolean isSynchronized= false;
+ IDocumentProvider p= getDocumentProvider();
+
+ isSynchronized= p.isSynchronized(getEditorInput());
+
+ if (isNotSynchronizedException(exception) && fErrorCorrectionOnSave == 1 && !isSynchronized) {
+ String title= EditorMessages.Editor_error_save_outofsync_title;
+ String msg= EditorMessages.Editor_error_save_outofsync_message;
+
+ if (MessageDialog.openQuestion(shell, title, msg))
+ performSave(true, progressMonitor);
+ else {
+ /*
+ * 1GEUPKR: ITPJUI:ALL - Loosing work with simultaneous edits
+ * Set progress monitor to canceled in order to report back
+ * to enclosing operations.
+ */
+ if (progressMonitor != null)
+ progressMonitor.setCanceled(true);
+ }
+ } else {
+ String title= EditorMessages.Editor_error_save_title;
+ String msg= EditorMessages.Editor_error_save_message;
+ ErrorDialog.openError(shell, title, msg, exception.getStatus());
+
+ /*
+ * 1GEUPKR: ITPJUI:ALL - Loosing work with simultaneous edits
+ * Set progress monitor to canceled in order to report back
+ * to enclosing operations.
+ */
+ if (progressMonitor != null)
+ progressMonitor.setCanceled(true);
+ }
+ } finally {
+ -- fErrorCorrectionOnSave;
+ }
+ }
+
+ /**
+ * Tells whether the given core exception is exactly the
+ * exception which is thrown for a non-synchronized element.
+ * <p>
+ * XXX: After 3.1 this method must be delegated to the document provider
+ * see
+ * </p>
+ *
+ * @param ex the core exception
+ * @return <code>true</code> iff the given core exception is exactly the
+ * exception which is thrown for a non-synchronized element
+ *
+ */
+ private boolean isNotSynchronizedException(CoreException ex) {
+ if (ex == null)
+ return false;
+
+ IStatus status= ex.getStatus();
+ if (status == null || status instanceof MultiStatus)
+ return false;
+
+ if (status.getException() != null)
+ return false;
+
+ // Can't access IResourceStatus.OUT_OF_SYNC_LOCAL, using value: 274
+ return status.getCode() == 274;
+ }
+
+
+
+ /**
+ * @return the site
+ */
+ public IEditorSite getSite() {
+ return site;
+ }
+
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLDiagramEditorUtil.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLDiagramEditorUtil.java
new file mode 100644
index 00000000000..90b0720511e
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLDiagramEditorUtil.java
@@ -0,0 +1,425 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+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.resource.ResourceSet;
+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.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.uml2.diagram.clazz.edit.parts.PackageEditPart;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.resource.UMLResource;
+
+
+/**
+ * @generated
+ */
+public class UMLDiagramEditorUtil {
+
+ /**
+ * @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), GmfUmlMultiDiagramEditor.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) {
+// UMLMultiDiagramEditorPlugin.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$
+// }
+//
+// extension = "." + extension;
+// if (fileName.endsWith(extension)) {
+// fileName = fileName.substring(0, fileName.length() - extension.length());
+// }
+// int i = 1;
+// IPath filePath = containerFullPath.append(fileName + extension);
+// while (ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
+// i++;
+// filePath = containerFullPath.append(fileName + i + extension);
+// }
+// return filePath.lastSegment();
+// }
+//
+// /**
+// * Runs the wizard in a dialog.
+// *
+// * @generated
+// */
+// public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
+// IDialogSettings pluginDialogSettings = UMLMultiDiagramEditorPlugin.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.UMLDiagramEditorUtil_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.UMLDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
+//
+// protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+// Package model = createInitialModel();
+// attachModelToResource(model, modelResource);
+//
+// Diagram diagram = ViewService.createDiagram(model, PackageEditPart.MODEL_ID, UMLMultiDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+// if (diagram != null) {
+// diagramResource.getContents().add(diagram);
+// diagram.setName(diagramName);
+// diagram.setElement(model);
+// }
+//
+// try {
+// modelResource.save(org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorUtil.getSaveOptions());
+// diagramResource.save(org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorUtil.getSaveOptions());
+// } catch (IOException e) {
+//
+// UMLMultiDiagramEditorPlugin.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) {
+// UMLMultiDiagramEditorPlugin.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 Package createInitialModelGen() {
+// return UMLFactory.eINSTANCE.createPackage();
+// }
+//
+// /**
+// * @generated NOT
+// */
+// private static Package createInitialModel() {
+// Package package_ = createInitialModelGen();
+// package_.setName("Package");
+// return package_;
+// }
+//
+// /**
+// * Store model element in the resource.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// */
+// private static void attachModelToResource(Package model, Resource resource) {
+// resource.getContents().add(model);
+// loadDefaultImports(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
+//
+// /**
+// * @generated
+// */
+// public static IFile getFile(URI uri) {
+// if (uri.toString().startsWith("platform:/resource")) { //$NON-NLS-1$
+// String path = uri.toString().substring("platform:/resource".length()); //$NON-NLS-1$
+// IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
+// if (workspaceResource instanceof IFile) {
+// return (IFile) workspaceResource;
+// }
+// }
+// return null;
+// }
+//
+// /**
+// * @generated
+// */
+// private static void loadDefaultImports(Package model) {
+// ResourceSet resourceSet = model.eResource().getResourceSet();
+// Model umlLibrary = (Model) resourceSet.getResource(URI.createURI(UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI), true).getContents().get(0);
+// model.createElementImport(umlLibrary.getOwnedType("Boolean"));
+// model.createElementImport(umlLibrary.getOwnedType("String"));
+// model.createElementImport(umlLibrary.getOwnedType("UnlimitedNatural"));
+// model.createElementImport(umlLibrary.getOwnedType("Integer"));
+// }
+
+}
diff --git a/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLModelManagerEditor.java b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLModelManagerEditor.java
new file mode 100644
index 00000000000..9588e1d4d33
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.adaptor.gmf/src/org/eclipse/papyrus/core/adaptor/gmf/UMLModelManagerEditor.java
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.adaptor.gmf;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IWorkspaceRoot;
+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.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+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.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.gef.palette.PaletteRoot;
+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.parts.DiagramDropTargetListener;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
+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.diagram.ui.services.palette.PaletteService;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorMatchingStrategy;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.navigator.resources.ProjectExplorer;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.IShowInTargetList;
+import org.eclipse.ui.part.ShowInContext;
+import org.eclipse.uml2.diagram.clazz.navigator.UMLNavigatorItem;
+import org.eclipse.uml2.diagram.clazz.part.Messages;
+import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditorPlugin;
+import org.eclipse.uml2.diagram.clazz.part.UMLPaletteFactory;
+
+
+/**
+ * @generated
+ */
+public class UMLModelManagerEditor extends ModelManagerEditor {
+
+ /**
+ * @generated
+ */
+ public static final String ID = "papyrus.multidiagram.gmf.uml.UMLDiagramEditorID"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final String CONTEXT_ID = "papyrus.multidiagram.gmf.uml.diagramContext"; //$NON-NLS-1$
+
+ /**
+ */
+ public UMLModelManagerEditor() {
+// super(UMLMultiDiagramEditorPlugin.getInstance().getDocumentProvider());
+ super(new GmfMultiDiagramDocumentProvider());
+ }
+
+ /**
+ * @generated
+ */
+ protected String getContextID() {
+ return CONTEXT_ID;
+ }
+
+
+} \ No newline at end of file
diff --git a/core/org.eclipse.papyrus.core.feature/.project b/core/org.eclipse.papyrus.core.feature/.project
new file mode 100644
index 00000000000..7554a31193a
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.core.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/core/org.eclipse.papyrus.core.feature/build.properties b/core/org.eclipse.papyrus.core.feature/build.properties
new file mode 100644
index 00000000000..2cbd854200f
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.feature/build.properties
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
diff --git a/core/org.eclipse.papyrus.core.feature/feature.properties b/core/org.eclipse.papyrus.core.feature/feature.properties
new file mode 100644
index 00000000000..b352cc1ac03
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.feature/feature.properties
@@ -0,0 +1,125 @@
+###############################################################################
+# Copyright (c) 2008 Obeo.
+# 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:
+# Obeo - initial API and implementation
+###############################################################################
+featureName=Eclipse Papyrus Core (Incubation)
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse.org
+
+# "updateSiteName" property - label for the update site
+updateSiteName=Eclipse Papyrus Updates (Incubation)
+
+# "description" property - description of the feature
+description=Eclipse Papyrus Core
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+########### end of license property ##########################################
diff --git a/core/org.eclipse.papyrus.core.feature/feature.xml b/core/org.eclipse.papyrus.core.feature/feature.xml
new file mode 100644
index 00000000000..97549858176
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.feature/feature.xml
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.papyrus.core.feature"
+ label="%featureName"
+ version="0.7.0.vqualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.papyrus.core">
+
+ <description url="http://www.eclipse.org/modeling/mdt/?project=papyrus">
+ %description
+ </description>
+
+ <copyright url="http://www.eclipse.org/legal/epl-v10.html">
+ Copyright (c) 2008 CEA LIST, Atos Origin, Obeo, Conselleria
+d&apos;Infraestructures i Transports.
+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. 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
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%updateSiteName" url="http://www.obeo.fr/download/papyrus/incubation"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.core.resources" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.gef" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.ecore" version="2.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf" version="2.3.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.ecore.xmi" version="2.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.transaction" version="1.2.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.edit" version="2.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.uml2.uml" version="2.2.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.uml2.uml.edit" version="2.2.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.ide" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.gmf.runtime.notation" version="1.0.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.core" version="1.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.views.properties.tabbed" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui" version="1.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.expressions"/>
+ <import plugin="org.eclipse.jface"/>
+ <import plugin="org.eclipse.ui.views"/>
+ <import plugin="org.eclipse.ui.navigator"/>
+ <import plugin="org.eclipse.emf.edit.ui"/>
+ <import plugin="org.eclipse.gmf.runtime.emf.core"/>
+ <import plugin="org.eclipse.gmf.runtime.emf.commands.core"/>
+ <import plugin="org.eclipse.gmf.runtime.emf.ui.properties"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui.properties"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui.providers"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui.providers.ide"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui.resources.editor"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui.render"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide"/>
+ <import plugin="org.eclipse.gmf.runtime.draw2d.ui"/>
+ <import plugin="org.eclipse.gmf.runtime.notation.providers"/>
+ <import plugin="org.eclipse.emf.ecore.edit"/>
+ <import plugin="org.eclipse.emf.ocl"/>
+ <import plugin="org.eclipse.emf.query.ocl"/>
+ <import plugin="org.eclipse.uml2.diagram.common"/>
+ <import plugin="org.eclipse.draw2d"/>
+ <import plugin="org.eclipse.ocl.ecore"/>
+ <import plugin="org.eclipse.ui.navigator.resources"/>
+ <import plugin="org.eclipse.uml2.diagram.clazz"/>
+ <import plugin="org.eclipse.uml2.diagram.activity"/>
+ <import plugin="org.eclipse.uml2.diagram.statemachine"/>
+ <import plugin="org.eclipse.uml2"/>
+ <import plugin="org.eclipse.emf.edit.ui" version="2.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.papyrus.diagram.common" version="0.7.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.papyrus.sasheditor" version="0.7.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.papyrus.di" version="0.7.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.papyrus.di.edit" version="0.7.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.papyrus.core" version="0.7.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.papyrus.umlutils" version="0.7.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.emf.workspace" version="1.2.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.emf.ecore.edit" version="2.4.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.papyrus.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.core.adaptor.emf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.core.adaptor.gmf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.di"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.di.edit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.di.editor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.tabbedproperties.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.sasheditor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.extensionpoints.editors"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.wizards"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.papyrus.preferences"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/core/org.eclipse.papyrus.core.feature/license.html b/core/org.eclipse.papyrus.core.feature/license.html
new file mode 100644
index 00000000000..c6af966b61e
--- /dev/null
+++ b/core/org.eclipse.papyrus.core.feature/license.html
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+<title>Eclipse.org Software User Agreement</title>
+</head>
+
+<body lang="EN-US" link=blue vlink=purple>
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>March 17, 2005</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation 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 provided with this Content and is also 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>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
+ modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
+</body>
+</html>
diff --git a/core/org.eclipse.papyrus.core/.classpath b/core/org.eclipse.papyrus.core/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <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="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/core/org.eclipse.papyrus.core/.options b/core/org.eclipse.papyrus.core/.options
new file mode 100644
index 00000000000..e98ce7bb88b
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/.options
@@ -0,0 +1,6 @@
+# master switch
+org.eclipse.papyrus.core/debug=true
+# switch for tracing papyrus core
+org.eclipse.papyrus.core/debug/core=true
+# switch for tracing papyrus extension point loading
+org.eclipse.papyrus.core/debug/extensionpoint=true \ No newline at end of file
diff --git a/core/org.eclipse.papyrus.core/.project b/core/org.eclipse.papyrus.core/.project
new file mode 100644
index 00000000000..9c5fd1135cb
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.core</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/core/org.eclipse.papyrus.core/META-INF/MANIFEST.MF b/core/org.eclipse.papyrus.core/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..1b9478fff8d
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/META-INF/MANIFEST.MF
@@ -0,0 +1,40 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.core;singleton:=true
+Bundle-Version: 0.7.0.vqualifier
+Bundle-Activator: org.eclipse.papyrus.core.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources;bundle-version="3.4.0",
+ org.eclipse.gef;bundle-version="3.4.0",
+ org.eclipse.emf.ecore;bundle-version="2.4.0",
+ org.eclipse.emf;bundle-version="2.3.0",
+ org.eclipse.emf.ecore.xmi;bundle-version="2.4.0",
+ org.eclipse.emf.transaction;bundle-version="1.2.0",
+ org.eclipse.emf.edit;bundle-version="2.4.0",
+ org.eclipse.uml2.uml;bundle-version="2.2.0";visibility:=reexport,
+ org.eclipse.uml2.uml.edit;bundle-version="2.2.0",
+ org.eclipse.papyrus.sasheditor;bundle-version="0.7.0";visibility:=reexport,
+ org.eclipse.papyrus.di;bundle-version="0.7.0",
+ org.eclipse.papyrus.di.edit;bundle-version="0.7.0",
+ org.eclipse.ui;bundle-version="3.4.0";visibility:=reexport,
+ org.eclipse.ui.ide;bundle-version="3.4.0";visibility:=reexport,
+ org.eclipse.gmf.runtime.notation;bundle-version="1.0.100",
+ org.eclipse.gmf.runtime.diagram.core;bundle-version="1.1.0",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.4.0";visibility:=reexport,
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.1.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.core,
+ org.eclipse.papyrus.core.contentoutline,
+ org.eclipse.papyrus.core.editor,
+ org.eclipse.papyrus.core.extension,
+ org.eclipse.papyrus.core.extension.commands,
+ org.eclipse.papyrus.core.extension.diagrameditor,
+ org.eclipse.papyrus.core.extension.editorcontext,
+ org.eclipse.papyrus.core.listenerservice,
+ org.eclipse.papyrus.core.multidiagram,
+ org.eclipse.papyrus.core.multidiagram.commands,
+ org.eclipse.papyrus.core.perspective,
+ org.eclipse.papyrus.core.utils
+Bundle-Vendor: %providerName
diff --git a/core/org.eclipse.papyrus.core/about.ini b/core/org.eclipse.papyrus.core/about.ini
new file mode 100644
index 00000000000..b765c003d2a
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/about.ini
@@ -0,0 +1,11 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Papyrus UML feature icon
+featureImage=icons/papyrus/32x32/Papyrus_32x32_t.gif
diff --git a/core/org.eclipse.papyrus.core/about.properties b/core/org.eclipse.papyrus.core/about.properties
new file mode 100644
index 00000000000..e5716664eb2
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/about.properties
@@ -0,0 +1,13 @@
+# about.properties
+# contains externalized strings for about.ini
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# fill-ins are supplied by about.mappings
+# This file should be translated.
+
+featureText=Papyrus Core \n\
+\n\
+Copyright (c) 2008 Atos Origin, CEA LIST, Obeo, Conselleria d'Infraestructures i Transports.\n\
+\n\
+Papyrus provide an integrated, user-consumable environment for editing models based on UML and other related languages such as SysML. \n\
+Specially, this project will provide the glue around valuable UML and SysML diagram editors (GMF-based or not) and other MDE tools. It will also offer support for UML and SysML profiling mechanisms. \n\
+Visit http://www.eclipse.org/modeling/mdt/?project=papyrus
diff --git a/core/org.eclipse.papyrus.core/build.properties b/core/org.eclipse.papyrus.core/build.properties
new file mode 100644
index 00000000000..3b0800d1f43
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/build.properties
@@ -0,0 +1,24 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ schema/,\
+ plugin.properties,\
+ .options,\
+ bin/,\
+ icons/,\
+ about.ini,\
+ about.properties,\
+ about.html
+src.includes = about.html,\
+ .classpath,\
+ .options,\
+ .project,\
+ META-INF/,\
+ plugin.properties,\
+ build.properties,\
+ icons/,\
+ plugin.xml,\
+ schema/,\
+ src/
diff --git a/core/org.eclipse.papyrus.core/icons/papyrus/32x32/Papyrus_32x32_t.gif b/core/org.eclipse.papyrus.core/icons/papyrus/32x32/Papyrus_32x32_t.gif
new file mode 100644
index 00000000000..4843130152a
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/icons/papyrus/32x32/Papyrus_32x32_t.gif
Binary files differ
diff --git a/core/org.eclipse.papyrus.core/icons/papyrus/Papyrus.gif b/core/org.eclipse.papyrus.core/icons/papyrus/Papyrus.gif
new file mode 100644
index 00000000000..cb105b4406c
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/icons/papyrus/Papyrus.gif
Binary files differ
diff --git a/core/org.eclipse.papyrus.core/plugin.properties b/core/org.eclipse.papyrus.core/plugin.properties
new file mode 100644
index 00000000000..4ce5500d6a1
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 CEA LIST.
+# 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:
+# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+##################################################################################
+pluginName=Papyrus Backbone (Incubation)
+providerName=Eclipse.org
diff --git a/core/org.eclipse.papyrus.core/plugin.xml b/core/org.eclipse.papyrus.core/plugin.xml
new file mode 100644
index 00000000000..be925abfcff
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/plugin.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="papyrusDiagram" name="PapyrusDiagram" schema="schema/papyrusDiagram.exsd"/>
+ <extension-point id="modelListener" name="ModelListener" schema="schema/modelListener.exsd"/>
+ <extension-point id="papyrusContentOutline" name="PapyrusContentOutline" schema="schema/contentOutline.exsd"/>
+ <extension point="org.eclipse.ui.editors">
+ <editor
+ id="org.eclipse.papyrus.core.papyrusEditor"
+ name="Papyrus Editor"
+ icon="icons/papyrus/Papyrus.gif"
+ extensions="di2"
+ default="true"
+ class="org.eclipse.papyrus.core.editor.SashMultiDiagramEditor">
+ </editor>
+ </extension>
+ <extension point="org.eclipse.ui.perspectives">
+ <perspective
+ class="org.eclipse.papyrus.core.perspective.PapyrusPerspective"
+ icon="icons/papyrus/Papyrus.gif"
+ id="org.eclipse.papyrus.core.perspective"
+ name="Papyrus">
+ </perspective>
+ </extension>
+
+
+</plugin>
diff --git a/core/org.eclipse.papyrus.core/schema/contentOutline.exsd b/core/org.eclipse.papyrus.core/schema/contentOutline.exsd
new file mode 100644
index 00000000000..0e8b1c7affb
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/schema/contentOutline.exsd
@@ -0,0 +1,135 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.papyrus.core" id="org.eclipse.papyrus.core.contentoutline" name="contentoutline"/>
+ </appinfo>
+ <documentation>
+ Specify the content outline to be used by the Papyrus backbone.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="contentoutline"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="contentoutline">
+ <complexType>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ A human readable description.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The class implementing the contentOutline.
+Class must extends org.eclipse.papyrus.core.contentoutline.IPapyrusContentOutlinePage.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.core.contentoutline.IPapyrusContentOutlinePage"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="priority" type="string" use="required">
+ <annotation>
+ <documentation>
+ An integer value representing the priority of the contentOutline.
+Only one contentOutline is shown. The one with the highest priority is choosen.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ /*******************************************************************************
+ * Copyright (c) 2008 CEA List.
+ * 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:
+ * CEA List - initial API and implementation
+ *******************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/core/org.eclipse.papyrus.core/schema/modelListener.exsd b/core/org.eclipse.papyrus.core/schema/modelListener.exsd
new file mode 100644
index 00000000000..5cc3436db8e
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/schema/modelListener.exsd
@@ -0,0 +1,133 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.papyrus.core" id="papyrus.backbone.modellistener" name="modelListener"/>
+ </appinfo>
+ <documentation>
+ This extension is used to plug a listener that will know all event in uml model di2 or notation.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="listener"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="listener">
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ name of the listener
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ Description of the job of this listener
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="realization" type="string" use="required">
+ <annotation>
+ <documentation>
+ Class that is realizes this listener
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.core.listenerservice.IPapyrusListener"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ /*******************************************************************************
+ * Copyright (c) 2008 CEA List.
+ * 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:
+ * CEA List - initial API and implementation
+ *******************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/core/org.eclipse.papyrus.core/schema/papyrusDiagram.exsd b/core/org.eclipse.papyrus.core/schema/papyrusDiagram.exsd
new file mode 100644
index 00000000000..7739e70b509
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/schema/papyrusDiagram.exsd
@@ -0,0 +1,197 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="papyrus.gmf.multipages" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="papyrus.gmf.multipages" id="nestedEditor" name="NestedEditor"/>
+ </appinfo>
+ <documentation>
+ Define a nested editor descriptor. This descriptor is used to add instance of the described editor to a multi diagram editor.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="editorDiagram" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="editorContext" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="creationCommand" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="editorDiagram">
+ <annotation>
+ <documentation>
+ A diagram suitable for Papyrus backbone.
+Such diagram is a Eclipse Editor.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="factoryClass" type="string" use="required">
+ <annotation>
+ <documentation>
+ The factory used to create an instance of the editor.
+The factory must implements org.eclipse.papyrus.sasheditor.extension.IEditorFactory
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.core.extension.IEditorFactory"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="contextId" type="string">
+ <annotation>
+ <documentation>
+ Id of the context required by the diagram editor. If no context is specified, the defaultContext will be provided.
+If specified, the context should be declared as another extension.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="editorContext">
+ <annotation>
+ <documentation>
+ A context provided to the editor.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Id of the context. Use to associate the context to editors.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="contextClass" type="string" use="required">
+ <annotation>
+ <documentation>
+ The class implementing the context.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.core.editor.IEditorContext"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="creationCommand">
+ <annotation>
+ <documentation>
+ A creation command use to create a new diagram.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ Id of the creation command.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+ Label of the creation command.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="creationCommandClass" type="string" use="required">
+ <annotation>
+ <documentation>
+ The class implementing the context.
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.core.extension.commands.ICreationCommand"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiInfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ /*******************************************************************************
+ * Copyright (c) 2008 CEA List.
+ * 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:
+ * CEA List - initial API and implementation
+ *******************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/core/org.eclipse.papyrus.core/schema/readme.txt b/core/org.eclipse.papyrus.core/schema/readme.txt
new file mode 100644
index 00000000000..381d7f1d4f0
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/schema/readme.txt
@@ -0,0 +1,5 @@
+nestedEditor.exsd is an example of schema that should be provided by plugin using
+the multidiagrams extension mechanism.
+Each multi-editor wanting to have auto plugable diagram should declare in its own plugin.xml the
+extension point referencing a copy of nestedEditor.exsd. This copy should be in the same plugin
+has the new multi-editor. \ No newline at end of file
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/Activator.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/Activator.java
new file mode 100644
index 00000000000..473d4aa61aa
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/Activator.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.core";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/IPapyrusUIConstants.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/IPapyrusUIConstants.java
new file mode 100644
index 00000000000..ad71658737a
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/IPapyrusUIConstants.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ * 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:
+ * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.core;
+
+/**
+ * interface that defines constants for Papyrus tool.
+ */
+public interface IPapyrusUIConstants {
+
+ public String PLUGIN_ID = "org.eclipse.papyrus.diagram.common";
+
+ /** Papyrus perspective ID. */
+ public final String PERSPECTIVE_ID = PLUGIN_ID + ".perspective";
+
+ /** Papyrus wizard ID. */
+ public final String WIZARD_ID = PLUGIN_ID + ".wizards";
+
+ /** File extension for papyrus model files. */
+ public final String MODEL_EXTENSION = "di2";
+
+ /** the id of the bird view. */
+ public final String BIRDVIEW_ID = "org.eclipse.papyrus.views.thumbnail";
+
+ /** the id of the creation model wizard */
+ public final String CREATE_MODEL_ID = "org.eclipse.papyrus.wizards.createmodel";
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/ContentOutlineRegistry.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/ContentOutlineRegistry.java
new file mode 100644
index 00000000000..c4c10adc5e3
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/ContentOutlineRegistry.java
@@ -0,0 +1,220 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.contentoutline;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.core.extension.BadClassNameException;
+import org.eclipse.papyrus.core.extension.diagrameditor.EditorDescriptorExtensionFactory;
+import org.osgi.framework.Bundle;
+
+public class ContentOutlineRegistry {
+
+ /** ID of the editor extension (schema filename) */
+ public static final String EDITOR_EXTENSION_ID = "papyrusContentOutline";
+
+ private static String classAttributeName = "class";
+
+ /** Namespace where to look for the extension points. */
+ protected String extensionPointNamespace;
+
+ /**
+ * The selected content outline.
+ */
+ protected IPapyrusContentOutlinePage contentOutline;
+
+ /**
+ * Associated editor.
+ */
+ private IMultiDiagramEditor multiEditor;
+
+ /**
+ * Constructor. defaultContext, input and site are explicitly required in order be sure that they are initialized. The multiEditor should be initialized. In particular, getEditorSite(),
+ * getEditorInput() and getDefaultContext() should return initialized values.
+ *
+ * @param multiEditor
+ * @param defaultContext
+ * @param input
+ * @param site
+ * @param extensionPointNamespace
+ */
+ public ContentOutlineRegistry(IMultiDiagramEditor multiEditor, String extensionPointNamespace) {
+ this.multiEditor = multiEditor;
+ this.extensionPointNamespace = extensionPointNamespace;
+ }
+
+ /**
+ * Returns the single instance of the content outline. Creates one if necessary.
+ *
+ * @return the contentOutline the single instance of the content outline
+ * @throws BackboneException
+ * exception thrown when the outline can not be created.
+ */
+ public IPapyrusContentOutlinePage getContentOutline() throws BackboneException {
+ if (contentOutline == null) {
+ createContentOutline();
+ }
+ return contentOutline;
+ }
+
+ /**
+ * Creates the content outline from the selected extension.
+ *
+ * @throws BackboneException
+ * exception thrown when the outline can not be created.
+ */
+ private void createContentOutline() throws BackboneException {
+
+ // Reading data from plugins
+
+ // TODO:For Cedric to verify
+ // IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(extensionPointNamespace,EDITOR_EXTENSION_ID);
+
+ IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(extensionPointNamespace, EDITOR_EXTENSION_ID);
+ ContentOutlineDescriptor found = null;
+
+ // look for the one with the highest priority
+ for (IConfigurationElement ele : configElements) {
+ ContentOutlineDescriptor desc = new ContentOutlineDescriptor(ele);
+ if (desc.isHigher(found))
+ found = desc;
+ }
+
+ // Instanciate the object
+ if (found != null) {
+ contentOutline = found.createContentOutlinePage();
+ }
+ }
+
+ /**
+ * Inner Descriptor for content outline.
+ */
+ protected class ContentOutlineDescriptor extends EditorDescriptorExtensionFactory {
+
+ private int priority;
+
+ private String className;
+
+ private IConfigurationElement element;
+
+ /**
+ * Instance is created when requested.
+ */
+ protected IPapyrusContentOutlinePage instance = null;
+
+ /**
+ * Create a descriptor backuped by the config element.
+ */
+ protected ContentOutlineDescriptor(IConfigurationElement element) throws BackboneException {
+ String tagName = "contentoutline";
+ checkTagName(element, tagName);
+ this.className = element.getAttribute(classAttributeName);
+ try {
+ this.priority = Integer.parseInt(element.getAttribute("priority"));
+ } catch (NumberFormatException e) {
+ this.priority = 0;
+ }
+
+ this.element = element;
+ // check parameters
+ if (className == null)
+ throw new BadClassNameException("Class name must be set", "contentoutline", classAttributeName);
+
+ }
+
+ /**
+ * Compare priority. The highest priority win.
+ */
+ public boolean isHigher(ContentOutlineDescriptor found) {
+ if (found == null) {
+ return true;
+ }
+ return this.getPriority() > found.getPriority();
+ }
+
+ /**
+ * Return the higher value of the descriptor. This value is used to order the contentOutline. The highest priority win.
+ */
+ private int getPriority() {
+ return priority;
+ }
+
+ /**
+ * Returns the content outline page instance (lazy initialization)
+ *
+ * @return the context outline page
+ * @throws BackboneException
+ * exception thrown when a problem occurs.
+ */
+ protected IPapyrusContentOutlinePage getContentOutline() throws BackboneException {
+ if (instance == null) {
+ instance = createContentOutlinePage();
+ }
+ return instance;
+ }
+
+ /**
+ * Create the class corresponding to the class attribute.
+ */
+ private Class<IPapyrusContentOutlinePage> loadClass() throws BadClassNameException {
+ if (className == null || className.length() == 0) {
+ throw new BadClassNameException("Classname should be set.", "contentoutline", classAttributeName);
+ }
+ Class<IPapyrusContentOutlinePage> factoryClass;
+ try {
+ factoryClass = (Class<IPapyrusContentOutlinePage>) Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ // try another way
+ try {
+ String declaringID = element.getContributor().getName();
+ Bundle bundle = Platform.getBundle(declaringID);
+ factoryClass = bundle.loadClass(className);
+ } catch (ClassNotFoundException e1) {
+ throw new BadClassNameException("", "contentoutline", classAttributeName, e1);
+ }
+ }
+ return factoryClass;
+ }
+
+ /**
+ * create the outlinepage by calling constructor without parameter and then call init method
+ *
+ * @return the outline.
+ * @throws BackboneException
+ */
+ protected IPapyrusContentOutlinePage createContentOutlinePage() throws BackboneException {
+ try {
+ IPapyrusContentOutlinePage outline = loadClass().newInstance();
+ outline.init(multiEditor);
+ return outline;
+
+ } catch (SecurityException e) {
+ // Lets propagate. This is an implementation problem that should be solved by programmer.
+ throw new RuntimeException(e);
+ }
+
+ catch (InstantiationException e) {
+ // Lets propagate. This is an implementation problem that should be solved by programmer.
+ // throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ // Lets propagate. This is an implementation problem that should be solved by programmer.
+ throw new RuntimeException(e);
+ }
+ return null;
+ }
+
+ } // end class
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/IPapyrusContentOutlinePage.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/IPapyrusContentOutlinePage.java
new file mode 100644
index 00000000000..0034f8ec408
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/contentoutline/IPapyrusContentOutlinePage.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.contentoutline;
+
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.editor.IMultiDiagramEditor;
+
+/**
+ * Extends the original interface to add the init method.
+ */
+public interface IPapyrusContentOutlinePage extends org.eclipse.ui.views.contentoutline.IContentOutlinePage {
+
+ /**
+ * Init the content outline.
+ *
+ * @param multiEditor
+ * the multiEditor is used to access to the context
+ * @throws BackboneException
+ * during research of the associated context.
+ */
+ void init(IMultiDiagramEditor multiEditor) throws BackboneException;
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneContext.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneContext.java
new file mode 100644
index 00000000000..1fbe18c88ac
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneContext.java
@@ -0,0 +1,127 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.editor;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.core.extension.editorcontext.AbstractEditorContext;
+import org.eclipse.papyrus.core.utils.BusinessModelResolver;
+import org.eclipse.papyrus.core.utils.DiResourceSet;
+import org.eclipse.ui.IEditorInput;
+
+/**
+ * Context used to load the base models and associated ResourceSet.
+ */
+public class BackboneContext extends AbstractEditorContext {
+
+ /**
+ * Object managing models lifeCycle.
+ */
+ protected DiResourceSet resourceSet;
+
+ /**
+ * Model resolver used to find model element from any graphical artefact.
+ */
+ protected BusinessModelResolver modelResolver;
+
+ /**
+ * Constructor.
+ */
+ public BackboneContext() {
+ modelResolver = BusinessModelResolver.getInstance();
+ resourceSet = new DiResourceSet();
+ }
+
+ /**
+ *
+ */
+ public void setInput(IEditorInput input) {
+ // TODO change resourceSet URIs ?
+ }
+
+ /**
+ * @return the resourceSet
+ */
+ public DiResourceSet getResourceSet() {
+ return resourceSet;
+ }
+
+ /**
+ *
+ * @param file
+ */
+ public void load(IFile file) {
+ resourceSet.loadResources(file);
+ }
+
+ public void save(IProgressMonitor monitor) throws IOException {
+ resourceSet.saveResources(monitor);
+ }
+
+ /**
+ * Save resources as specified path
+ *
+ * @param path
+ * @throws IOException
+ */
+ public void saveAs(IPath path) throws IOException {
+ resourceSet.saveAs(path);
+ }
+
+ /**
+ * @return Object
+ */
+ public List<?> getModels() {
+ return resourceSet.getVisibleDiagrams();
+ }
+
+ /**
+ *
+ */
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * @return the modelResolver
+ */
+ public BusinessModelResolver getModelResolver() {
+ return modelResolver;
+ }
+
+ /**
+ * Get the {@link TransactionalEditingDomain}.
+ *
+ * @return
+ */
+ public TransactionalEditingDomain getTransactionalEditingDomain() {
+ return resourceSet.getTransactionalEditingDomain();
+ }
+
+ /**
+ * Create a new {@link DiagramNotifier} listening to the graphical model containing the diagram roots.
+ *
+ * @TODO move diagram roots related stuff to appropriate service (to be defined)
+ * @return
+ */
+ public DiagramNotifier createDiagramNotifier() {
+ return new DiagramNotifier(resourceSet.getDiResource());
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneException.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneException.java
new file mode 100644
index 00000000000..731307eee32
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/BackboneException.java
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.editor;
+
+/**
+ * Root of Backbone Exception
+ *
+ * @author dumoulin
+ *
+ */
+public class BackboneException extends Exception {
+
+ /**
+ * serial version UID
+ *
+ * @generated
+ */
+ private static final long serialVersionUID = 4859634627616979417L;
+
+ /**
+ * Creates a new BackboneException.
+ */
+ public BackboneException() {
+ super();
+ }
+
+ /**
+ * Creates a new BackboneException with the specified message.
+ *
+ * @param message
+ * the message of the exception
+ */
+ public BackboneException(String message) {
+ super(message);
+ }
+
+ /**
+ * Creates a new BackboneException with the specified cause.
+ *
+ * @param cause
+ * the cause of the exception
+ */
+ public BackboneException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Creates a new BackboneException with a specified message and the specified cause.
+ *
+ * @param message
+ * the message of the exception
+ * @param cause
+ * the cause of the exception
+ */
+ public BackboneException(String arg0, Throwable arg1) {
+ super(arg0, arg1);
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/DiagramNotifier.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/DiagramNotifier.java
new file mode 100644
index 00000000000..96a8a13e3fe
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/DiagramNotifier.java
@@ -0,0 +1,149 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.editor;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+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.ecore.resource.Resource;
+import org.eclipse.papyrus.di.Diagram;
+
+/**
+ * Class notifying event when a diagram is added/moved/removed from the graphical model
+ *
+ * @author dumoulin
+ *
+ */
+public class DiagramNotifier {
+
+ public static final String DIAGRAM_ADDED = "DIAGRAM_ADDED";
+
+ public static final String DIAGRAM_MOVED = "DIAGRAM_MOVED";
+
+ public static final String DIAGRAM_REMOVED = "DIAGRAM_REMOVED";
+
+ /**
+ * Listener on diagram added/removed.
+ */
+ private PropertyChangeSupport diagramListListener = new PropertyChangeSupport(this);
+
+ /**
+ * Adapter listening to diagram addition/remove events
+ */
+ private Adapter adapter = new Adapter() {
+
+ Notifier notifier;
+
+ public Notifier getTarget() {
+ return notifier;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return false;
+ }
+
+ /**
+ * Notifies that a change to some feature has occurred.
+ *
+ * @param notification
+ * a description of the change.
+ */
+ public void notifyChanged(Notification notification) {
+ int eventType = notification.getEventType();
+ // Check if this is a diagram
+ Object newValue = notification.getNewValue();
+ System.out.println(this.getClass().getCanonicalName() + "notifyChanged(" + newValue + " - " + eventType + ")");
+ if (!isADiagram(newValue)) {
+ return;
+ }
+ // Check the type of event
+ if (eventType == Notification.ADD) {
+ diagramListListener.firePropertyChange(DIAGRAM_ADDED, null, newValue);
+ } else if (eventType == Notification.MOVE) {
+ diagramListListener.firePropertyChange(DIAGRAM_MOVED, null, newValue);
+
+ } else if (eventType == Notification.REMOVE) {
+ diagramListListener.firePropertyChange(DIAGRAM_REMOVED, null, newValue);
+ }
+ }
+
+ private boolean isADiagram(Object object) {
+ return object instanceof Diagram;
+ }
+
+ public void setTarget(Notifier newTarget) {
+ notifier = newTarget;
+
+ }
+
+ };
+
+ /** Resource source of the events */
+ private Resource eventSource;
+
+ public DiagramNotifier(Resource eventSource) {
+ this.eventSource = eventSource;
+ }
+
+ /**
+ * Add a listener that will be notified of diagram CRUD event in graphical model
+ *
+ * @param listener
+ */
+ public void addListener(PropertyChangeListener listener) {
+ // Check if the class is already listening to events source
+ boolean isListening = diagramListListener.hasListeners(null);
+ // register listener
+ diagramListListener.addPropertyChangeListener(listener);
+ // Listen to event source if needed
+ if (!isListening) {
+ activate();
+ }
+ diagramListListener.getPropertyChangeListeners();
+ }
+
+ /**
+ * Add a listener that will be notified of diagram CRUD event in graphical model
+ *
+ * @param listener
+ */
+ public void removeListener(PropertyChangeListener listener) {
+ diagramListListener.removePropertyChangeListener(listener);
+ // Deactivate listening to event source if none is registered.
+ if (!diagramListListener.hasListeners(null)) {
+ deactivate();
+ }
+ }
+
+ /**
+ * Called when the editor should be activated. Subclass should implements this method to register listeners to the model.
+ *
+ */
+ public void activate() {
+ eventSource.eAdapters().add(adapter);
+
+ }
+
+ /**
+ * Called when the editor is deactivated.
+ *
+ */
+ public void deactivate() {
+ eventSource.eAdapters().remove(adapter);
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/EditingDomainService.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/EditingDomainService.java
new file mode 100644
index 00000000000..4092d32c709
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/EditingDomainService.java
@@ -0,0 +1,199 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.editor;
+
+import java.util.EventObject;
+
+import org.eclipse.core.commands.operations.IOperationHistory;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.commands.operations.ObjectUndoContext;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.CommandStack;
+import org.eclipse.gef.commands.CommandStackListener;
+import org.eclipse.gmf.runtime.common.ui.action.ActionManager;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
+import org.eclipse.gmf.runtime.emf.commands.core.command.EditingDomainUndoContext;
+
+
+/**
+ * Initialize editing domain.
+ *
+ *
+ */
+public class EditingDomainService implements CommandStackListener, org.eclipse.emf.common.command.CommandStackListener{
+
+ /**
+ * undo context.
+ */
+ private IUndoContext undoContext;
+ private BackboneContext defaultContext;
+ private CommandStackListener commandStackListener;
+ /** gmf editing domain shared among all gmf editors */
+// private DiagramEditDomain diagramEditDomain;
+
+
+ /**
+ * @param defaultContext
+ * @param commandStackListener
+ */
+ public EditingDomainService(BackboneContext defaultContext) {
+ this.defaultContext = defaultContext;
+ configureDiagramEditDomain();
+ }
+
+// /**
+// * Sets the default edit domain, shared among all editors
+// *
+// * @param diagramEditDomain
+// * the diagramEditDomain to set
+// */
+// public void setDiagramEditDomain(DiagramEditDomain diagramEditDomain) {
+// this.diagramEditDomain = diagramEditDomain;
+// }
+
+ /**
+ * {@inheritDoc}
+ */
+ public DiagramEditDomain getDiagramEditDomain() {
+ return defaultContext.getDiagramEditDomain();
+ }
+
+
+ /**
+ * @overridable
+ * TODO move it to GmfContext ?
+ */
+ protected ActionManager createActionManager() {
+ return new ActionManager(createOperationHistory());
+ }
+
+ /**
+ * Gets the action manager for this diagram editor. The action manager's command manager is used by my edit domain's command stack when executing commands. This is the action manager that is
+ * returned when I am asked to adapt to an <code>ActionManager</code>.
+ *
+ * @return the action manager
+ */
+ protected ActionManager getActionManager() {
+ return getDiagramEditDomain().getActionManager();
+ }
+
+ /**
+ * Create my operation history.
+ *
+ * @return my operation history
+ * TODO move it to GmfContext ?
+ */
+ protected IOperationHistory createOperationHistory() {
+ return OperationHistoryFactory.getOperationHistory();
+ }
+
+ /**
+ * Gets my undo context. Lazily initializes my undo context if it has not been set.
+ *
+ * @return my undo context
+ * TODO move it to GmfContext ?
+ */
+ protected IUndoContext getUndoContext() {
+
+ if (undoContext == null) {
+ TransactionalEditingDomain domain = defaultContext.getTransactionalEditingDomain();
+
+ if (domain != null) {
+ undoContext = new EditingDomainUndoContext(domain);
+
+ } else {
+ undoContext = new ObjectUndoContext(this);
+ }
+ }
+ return undoContext;
+ }
+
+ /**
+ * Configures my diagram edit domain with its command stack.
+ *
+ * TODO move it to GmfContext ?
+ */
+ protected void configureDiagramEditDomain() {
+
+ DiagramEditDomain editDomain = getDiagramEditDomain();
+
+ if (editDomain != null) {
+ CommandStack stack = editDomain.getCommandStack();
+
+ if (stack != null) {
+ stack.removeCommandStackListener(this);
+ // dispose the old stack
+ stack.dispose();
+ }
+
+ // create and assign the new stack
+ DiagramCommandStack diagramStack = new DiagramCommandStack(getDiagramEditDomain());
+ editDomain.setActionManager(createActionManager());
+
+ diagramStack.setOperationHistory(getOperationHistory());
+
+ editDomain.setCommandStack(diagramStack);
+
+ diagramStack.addCommandStackListener(this);
+ defaultContext.getTransactionalEditingDomain().getCommandStack().addCommandStackListener(this);
+
+ // changes made on the stack can be undone from this editor
+ diagramStack.setUndoContext(getUndoContext());
+
+ }
+
+ }
+
+ /**
+ * Returns the operation history from my action manager.
+ *
+ * @return the operation history
+ */
+ protected IOperationHistory getOperationHistory() {
+ return getActionManager().getOperationHistory();
+ }
+
+ /**
+ * Add a command stack listener.
+ * Actual implementation only allows one listener. If we need more listener, change the implementation to allow it.
+ * @param listener
+ */
+ public void addCommandStackListener(CommandStackListener listener)
+ {
+ assert( this.commandStackListener == null);
+ this.commandStackListener = listener;
+ }
+
+ /**
+ * Remove the specified command stack listener.
+ * @param listener
+ */
+ public void removeCommandStackListener(CommandStackListener listener)
+ {
+ if(this.commandStackListener == listener)
+ this.commandStackListener = null;
+ }
+ /**
+ * Relay the event from the stack to the listeners.
+ *
+ * @param event
+ */
+ public void commandStackChanged(EventObject event) {
+ commandStackListener.commandStackChanged(event);
+ }
+
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/IMultiDiagramEditor.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/IMultiDiagramEditor.java
new file mode 100644
index 00000000000..1e80ae29388
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/IMultiDiagramEditor.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.editor;
+
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContextRegistry;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+
+/**
+ * Interface implemented by the main multipage editor. This interface list the methods available to diagram editors. Diagram editors can relies on this interface to retrieve services from the main
+ * multi diagram editor.
+ *
+ * @author dumoulin
+ *
+ */
+public interface IMultiDiagramEditor extends IEditorPart {
+
+ /**
+ * @return the defaultContext
+ */
+ public BackboneContext getDefaultContext();
+
+ /**
+ * Return the editor site.
+ *
+ * @return
+ */
+ public IEditorSite getEditorSite();
+
+ /**
+ * Get the editor input.
+ *
+ * @return
+ */
+ public IEditorInput getEditorInput();
+
+ /**
+ * Get the associated context registry.
+ */
+ public IEditorContextRegistry getContextRegistry();
+
+ /**
+ * Returns the edit domain shared among editors
+ *
+ * @return the edit domain shared among editors
+ */
+ public DiagramEditDomain getDiagramEditDomain();
+
+ /**
+ * Get the currently active Editor.
+ */
+ public IEditorPart getActiveEditor();
+} \ No newline at end of file
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/MultiDiagramEditor.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/MultiDiagramEditor.java
new file mode 100644
index 00000000000..1857013f0ba
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/MultiDiagramEditor.java
@@ -0,0 +1,508 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.editor;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.EventObject;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gef.commands.CommandStackListener;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.papyrus.core.Activator;
+import org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry;
+import org.eclipse.papyrus.core.extension.diagrameditor.EditorFactoryRegistry;
+import org.eclipse.papyrus.core.extension.diagrameditor.IEditorFactoryRegistry;
+import org.eclipse.papyrus.core.extension.editorcontext.EditorContextRegistry;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContextRegistry;
+import org.eclipse.papyrus.core.utils.PapyrusTrace;
+import org.eclipse.papyrus.sasheditor.gef.EditorNotFoundException;
+import org.eclipse.papyrus.sasheditor.gef.GefMultiPageEditorPart;
+import org.eclipse.papyrus.sasheditor.gef.MultiDiagramException;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+/**
+ * Multi diagram editor allowing to plug various kind of editors. Editors are registered with the help of the Eclipse extension mechanism. This implementation allows to register editors and context
+ * separately. An editor should specify which context it need to run.
+ *
+ * @author dumoulin
+ * @author Remi Schnekenburger
+ * @deprecated This class will be replaced by SashMultiDiagramEditor. Do not use methods from this class. Instead , define services accessible from the appropriate Context. If the service should
+ * belong to core, make it accessible from this class. It will be moved to SashMultiDiagramEditor.
+ *
+ */
+public class MultiDiagramEditor extends GefMultiPageEditorPart implements IMultiDiagramEditor, ITabbedPropertySheetPageContributor {
+
+ public static final String ID = "org.eclipse.papyrus.core.papyrusEditor"; //$NON-NLS-1$
+
+ /** Registry to store editor factories */
+ private IEditorFactoryRegistry editorRegistry;
+
+ /** Registry for editor contexts */
+ private IEditorContextRegistry editorContextRegistry;
+
+ /** ContentOutline registry */
+ private ContentOutlineRegistry contentOutlineRegistry;
+
+ /**
+ * Context associated to this backbone editor.
+ */
+ private BackboneContext defaultContext;
+
+ /**
+ * Diagram notifier notifying diagram CRUD events.
+ */
+ private DiagramNotifier diagramNotifier;
+
+ /** gef editing domain shared among all editors in this multi diagram editor */
+ private DiagramEditDomain diagramEditDomain;
+
+ /**
+ * sheet page associated to this editor
+ */
+ private TabbedPropertySheetPage tabbedPropertySheetPage = null;
+
+ /** Flag reflecting the editor state. The flag is set by listeners on model changes */
+ private boolean toSave = false;
+
+ /**
+ * Listening on diagram changes. Only listen on diagram add/delete
+ */
+ private PropertyChangeListener diagramChangeListener = new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ // refresh tabs.
+ refreshTabs();
+ }
+
+ };
+
+ /**
+ * Listen on change on commandStack. Mark editor as dirty if needed.
+ */
+ private CommandStackListener commandStackListener = new CommandStackListener() {
+
+ public void commandStackChanged(EventObject event) {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ markDirty();
+ }
+
+ };
+
+ /**
+ * Constructor.
+ */
+ public MultiDiagramEditor() {
+ super();
+
+ // create and stores a GMF editing domain that will be used by all editors.
+ // this edit domain is the GMF one, as it inherits from DefaultEditDomain from GEF used by old Papyrus diagram editors
+ // warning: there could be ClassCastException, as the default implementation cast the editor as a IDiagramWorkbenchPart
+ setDiagramEditDomain(new DiagramEditDomain(this));
+ // getDiagramEditDomain().setActionManager(createActionManager());
+ }
+
+ /**
+ * Create a PageEditor for the specified model. Default implementation delegates to pageEditorFactory.createPageEditorFor(model);
+ *
+ * @param model
+ * the diagram to be displayed
+ * @return the Graphical Editor that displays the specified diagram
+ * @throws EditorNotFoundException
+ * No editor handling the model can be found.
+ */
+ protected IEditorPart createPageEditor(Object model) throws MultiDiagramException {
+ IEditorPart part = getEditorRegistry().createEditorFor(getContextRegistry(), model);
+ return part;
+ }
+
+ /**
+ * Get the contextRegistry
+ *
+ * @return the associated context registry
+ */
+ public IEditorContextRegistry getContextRegistry() {
+ return editorContextRegistry;
+ }
+
+ /**
+ * Create the IEditorContextRegistry containing registered contexts. Subclass should implements this method in order to return the registry associated to the extension point namespace.
+ *
+ * @return the IEditorContextRegistry for nested editor descriptors
+ */
+ protected IEditorContextRegistry createEditorContextRegistry() {
+ IEditorContextRegistry registry = new EditorContextRegistry(this, Activator.PLUGIN_ID);
+ return registry;
+ }
+
+ /**
+ * Get the contentOutlineRegistry. Create it if needed.
+ *
+ * @return the contentOutlineRegistry
+ */
+ protected ContentOutlineRegistry getContentOutlineRegistry() {
+ if (contentOutlineRegistry == null)
+ createContentOutlineRegistry();
+
+ return contentOutlineRegistry;
+ }
+
+ /**
+ * Create the contentOutlineRegistry.
+ */
+ private void createContentOutlineRegistry() {
+ contentOutlineRegistry = new ContentOutlineRegistry(this, Activator.PLUGIN_ID);
+ }
+
+ /**
+ * Get the EditorRegistry used to create editor instances. This default implementation return the singleton eINSTANCE. This method can be subclassed to return another registry.
+ *
+ * @return the singleton eINSTANCE of editor registry
+ */
+ protected IEditorFactoryRegistry getEditorRegistry() {
+ if (editorRegistry == null) {
+ editorRegistry = createEditorRegistry();
+ }
+ return editorRegistry;
+ }
+
+ /**
+ * Return the EditorRegistry for nested editor descriptors. Subclass should implements this method in order to return the registry associated to the extension point namespace.
+ *
+ * @return the EditorRegistry for nested editor descriptors
+ */
+ protected IEditorFactoryRegistry createEditorRegistry() {
+ return new EditorFactoryRegistry(Activator.PLUGIN_ID);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySheetPage.class) {
+ // Do not test if tabbedPropertySheetPage is null before calling new
+ // this is managed by Eclipse which only call current method when necessary
+ tabbedPropertySheetPage = new TabbedPropertySheetPage(this);
+
+ return tabbedPropertySheetPage;
+ }
+
+ // Add a viewer
+ if (adapter == IContentOutlinePage.class) {
+ try {
+
+ IContentOutlinePage contentOutline = getContentOutlineRegistry().getContentOutline();
+ if (contentOutline != null)
+ return contentOutline;
+ } catch (BackboneException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // Add a viewer
+ // if (adapter == IOverviewPage.class) {
+ // if (overviewPage == null) {
+ // overviewPage = new GEFOverviewPage((ScalableFreeformRootEditPart) ((GraphicalEditor) getActiveEditor()).getAdapter(EditPart.class));
+ // }
+ // return overviewPage;
+ // }
+ if (adapter == BackboneContext.class) {
+ return defaultContext;
+ }
+
+ if (adapter == EditingDomain.class) {
+ return defaultContext.getTransactionalEditingDomain();
+ }
+
+ // TODO : following code is GMF dependant. It should be moved to adapter
+ // Do we really need it? Who use it ?
+ if (adapter == IDiagramGraphicalViewer.class) {
+ IEditorPart activeEditor = getActiveEditor();
+ if (activeEditor instanceof DiagramEditor) {
+ return ((DiagramEditor) activeEditor).getDiagramGraphicalViewer();
+ }
+ return null;
+ }
+
+ return super.getAdapter(adapter);
+ }
+
+ /**
+ * Creates actions for this editor. Subclasses should override this method to create and register actions with the {@link ActionRegistry}.
+ */
+ protected void createActions() {
+ ActionRegistry registry = getActionRegistry();
+ IAction action;
+
+ }
+
+ /**
+ * Init the editor.
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+
+ // Init super
+ super.init(site, input);
+
+ // Init this class
+ try {
+ defaultContext = createDefaultContext(site, input);
+ } catch (BackboneException e) {
+ throw new PartInitException("Can't create default context.", e);
+ }
+
+ // configureDiagramEditDomain();
+ EditingDomainService editingDomainService = new EditingDomainService(defaultContext);
+ editingDomainService.addCommandStackListener(commandStackListener);
+
+ // Load resources
+ IFile file = ((IFileEditorInput) input).getFile();
+ defaultContext.getResourceSet().loadResources(file);
+ diagramNotifier = defaultContext.createDiagramNotifier();
+
+ // Create registries
+ // editorContextRegistry should be created after site, input and defaultContext are created.
+ editorContextRegistry = createEditorContextRegistry();
+ editorContextRegistry.registerContext("defaultContext", defaultContext);
+ editorRegistry = createEditorRegistry();
+
+ // Set editor name
+ setPartName(file.getName());
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void activate() {
+ super.activate();
+ // Start listening on diagram CRUD
+ diagramNotifier.addListener(diagramChangeListener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void deactivate() {
+ // Stop listening on diagrams CRUD
+ diagramNotifier.removeListener(diagramChangeListener);
+ super.deactivate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setInput(IEditorInput input) {
+ // Create global actions from the nested editors.
+ createActions();
+ super.setInput(input);
+ }
+
+ /**
+ * Creates the default context used to control models life cycles.
+ *
+ * @param site
+ * the editor site in which multi diagram editor is created
+ * @param input
+ * the editor input
+ * @throws BackboneException
+ * the backbone context could not be created correctly
+ */
+ private BackboneContext createDefaultContext(IEditorSite site, IEditorInput input) throws BackboneException {
+ BackboneContext defaultContext = new BackboneContext();
+ defaultContext.init(this);
+ return defaultContext;
+ }
+
+ /**
+ * Get the root elements. This elements are used to create corresponding diagram.
+ */
+ @Override
+ public List<?> getModels() {
+ return defaultContext.getModels();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ // Save each associated resource
+ defaultContext.save(monitor);
+ markSaveLocation();
+ } catch (IOException ioe) {
+ PapyrusTrace.log(ioe);
+ }
+
+ }
+
+ /**
+ * Mark the command stack of all sub-editors. Default implementation do nothing.
+ */
+ protected void markSaveLocation() {
+ toSave = false;
+ getDiagramEditDomain().getCommandStack().markSaveLocation();
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ /**
+ * Mark the editor as dirty, and fire appropriate event.
+ */
+ protected void markDirty() {
+ toSave = true;
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isDirty() {
+ return toSave;
+ // return getDiagramEditDomain().getDiagramCommandStack().isDirty();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doSaveAs() {
+ // Show a SaveAs dialog
+ toSave = false;
+ super.firePropertyChange(PROP_DIRTY);
+ Shell shell = getSite().getWorkbenchWindow().getShell();
+ SaveAsDialog dialog = new SaveAsDialog(shell);
+ dialog.setOriginalFile(((IFileEditorInput) getEditorInput()).getFile());
+ dialog.open();
+ final IPath path = dialog.getResult();
+ if (path != null) {
+ // try to save the editor's contents under a different file name
+ final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ try {
+ new ProgressMonitorDialog(shell).run(false, // don't fork
+ false, // not cancelable
+ new WorkspaceModifyOperation() { // run this operation
+
+ @Override
+ public void execute(final IProgressMonitor monitor) {
+ try {
+ defaultContext.saveAs(path);
+ } catch (IOException ioe) {
+ PapyrusTrace.log(ioe);
+ }
+ }
+ });
+ // set input to the new file
+ setInput(new FileEditorInput(file));
+ markSaveLocation();
+ } catch (InterruptedException ie) {
+ // should not happen, since the monitor dialog is not cancelable
+ PapyrusTrace.log(ie);
+ } catch (InvocationTargetException ite) {
+ PapyrusTrace.log(ite);
+ }
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isSaveAsAllowed() {
+ return defaultContext.isSaveAsAllowed();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public BackboneContext getDefaultContext() {
+ return defaultContext;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getContributorId() {
+ // return Activator.PLUGIN_ID;
+ return "TreeOutlinePage";
+
+ }
+
+ // FIXME: Pour CÚdric modif
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IEditorPart getActiveEditor() {
+ return super.getActiveEditor();
+ }
+
+ /**
+ * Sets the default edit domain, shared among all editors
+ *
+ * @param diagramEditDomain
+ * the diagramEditDomain to set
+ */
+ public void setDiagramEditDomain(DiagramEditDomain diagramEditDomain) {
+ this.diagramEditDomain = diagramEditDomain;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public DiagramEditDomain getDiagramEditDomain() {
+ return diagramEditDomain;
+ }
+
+ @Override
+ protected void pageChange(int newPageIndex) {
+ super.pageChange(newPageIndex);
+
+ // The current page of the MultiPageEditor is changing - Update contents of the overview page
+ // if (overviewPage != null && overviewPage instanceof GEFOverviewPage) {
+ // ((GEFOverviewPage) overviewPage).updateContents((ScalableFreeformRootEditPart) ((GraphicalEditor) getActiveEditor()).getAdapter(EditPart.class));
+ // }
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/SashMultiDiagramEditor.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/SashMultiDiagramEditor.java
new file mode 100644
index 00000000000..03e853e6fac
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/editor/SashMultiDiagramEditor.java
@@ -0,0 +1,523 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.core.editor;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.EventObject;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gef.commands.CommandStackListener;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.papyrus.core.Activator;
+import org.eclipse.papyrus.core.contentoutline.ContentOutlineRegistry;
+import org.eclipse.papyrus.core.extension.diagrameditor.EditorFactoryRegistry;
+import org.eclipse.papyrus.core.extension.diagrameditor.IEditorFactoryRegistry;
+import org.eclipse.papyrus.core.extension.editorcontext.EditorContextRegistry;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContextRegistry;
+import org.eclipse.papyrus.core.multidiagram.SashDiagramModelManager;
+import org.eclipse.papyrus.core.multidiagram.SashWindowModelManagerWrapper;
+import org.eclipse.papyrus.sasheditor.gef.EditorNotFoundException;
+import org.eclipse.papyrus.sasheditor.gef.MultiDiagramEditorGefDelegate;
+import org.eclipse.papyrus.sasheditor.gef.MultiDiagramException;
+import org.eclipse.papyrus.sasheditor.gef.SelectionSynchronizer;
+import org.eclipse.papyrus.sasheditor.sash.ISashWindowsModelManager;
+import org.eclipse.papyrus.sasheditor.sash.SashMultiPageEditorPart;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+/**
+ * Multi diagram editor allowing to plug various kind of editors. Editors are registered with the help of the Eclipse extension mechanism. This implementation allows to register editors and context
+ * separately. An editor should specify which context it need to run. This multi diagram editor allows to show editor side by side in one or more sash windows.
+ *
+ * @author dumoulin
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public class SashMultiDiagramEditor extends SashMultiPageEditorPart implements IMultiDiagramEditor, ITabbedPropertySheetPageContributor, IDiagramWorkbenchPart {
+
+ /** Gef adapter */
+ private MultiDiagramEditorGefDelegate gefAdaptorDelegate;
+
+ /** Registry to store editor factories */
+ private IEditorFactoryRegistry editorRegistry;
+
+ /** Registry for editor contexts */
+ private IEditorContextRegistry editorContextRegistry;
+
+ /** ContentOutline registry */
+ private ContentOutlineRegistry contentOutlineRegistry;
+
+ /**
+ * Context associated to this backbone editor.
+ */
+ private BackboneContext defaultContext;
+
+ /**
+ * Diagram notifier notifying diagram CRUD events.
+ */
+ private DiagramNotifier diagramNotifier;
+
+ /**
+ *
+ */
+ private TabbedPropertySheetPage tabbedPropertySheetPage = null;
+
+ /** Flag reflecting the editor state. The flag is set by listeners on model changes */
+ private boolean toSave = false;
+
+ /** gef editing domain shared among all editors in this multi diagram editor */
+ private DiagramEditDomain diagramEditDomain;
+
+ /**
+ * Listening on diagram changes. Only listen on diagram add/delete
+ */
+ private PropertyChangeListener diagramChangeListener = new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ // refresh tabs.
+ refreshTabs();
+ }
+
+ };
+
+ /**
+ * Listen on change on commandStack. Mark editor as dirty if needed.
+ */
+ private CommandStackListener commandStackListener = new CommandStackListener() {
+
+ public void commandStackChanged(EventObject event) {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ markDirty();
+ }
+
+ };
+
+ /**
+ * Constructor.
+ */
+ public SashMultiDiagramEditor() {
+ super();
+ setDiagramEditDomain(new DiagramEditDomain(this));
+ }
+
+ /**
+ * Create a PageEditor for the specified model. Default implementation delegates to pageEditorFactory.createPageEditorFor(model); Not intended for external use.
+ *
+ * @param model
+ * the diagram to be displayed
+ * @return the Graphical Editor that displays the specified diagram
+ * @throws EditorNotFoundException
+ * No editor handling the model can be found.
+ */
+ public IEditorPart createPageEditor(Object model) throws MultiDiagramException {
+ IEditorPart part = getEditorRegistry().createEditorFor(getContextRegistry(), model);
+ return part;
+ }
+
+ /**
+ * Get the contextRegistry
+ *
+ * @return
+ */
+ public IEditorContextRegistry getContextRegistry() {
+ return editorContextRegistry;
+ }
+
+ /**
+ * Create the IEditorContextRegistry containing registered contexts. Subclass should implements this method in order to return the registry associated to the extension point namespace.
+ *
+ * @param defaultContext
+ * @param input
+ * @param site
+ * @param input
+ * @param site
+ * @return the IEditorContextRegistry for nested editor descriptors
+ */
+ protected IEditorContextRegistry createEditorContextRegistry() {
+ IEditorContextRegistry registry = new EditorContextRegistry(this, Activator.PLUGIN_ID);
+ return registry;
+ }
+
+ /**
+ * Get the contentOutlineRegistry. Create it if needed.
+ *
+ * @return the contentOutlineRegistry
+ */
+ protected ContentOutlineRegistry getContentOutlineRegistry() {
+ if (contentOutlineRegistry == null)
+ createContentOutlineRegistry();
+
+ return contentOutlineRegistry;
+ }
+
+ /**
+ * Create the contentOutlineRegistry.
+ */
+ private void createContentOutlineRegistry() {
+ contentOutlineRegistry = new ContentOutlineRegistry(this, Activator.PLUGIN_ID);
+ }
+
+ /**
+ * Get the EditorRegistry used to create editor instances. This default implementation return the singleton eINSTANCE. This method can be subclassed to return another registry.
+ *
+ * @return the singleton eINSTANCE of editor registry
+ */
+ protected IEditorFactoryRegistry getEditorRegistry() {
+ if (editorRegistry == null) {
+ editorRegistry = createEditorRegistry();
+ }
+ return editorRegistry;
+ }
+
+ /**
+ * Return the EditorRegistry for nested editor descriptors. Subclass should implements this method in order to return the registry associated to the extension point namespace.
+ *
+ * @return the EditorRegistry for nested editor descriptors
+ */
+ protected IEditorFactoryRegistry createEditorRegistry() {
+ return new EditorFactoryRegistry(Activator.PLUGIN_ID);
+ }
+
+ /**
+ *
+ *
+ * @param adapter
+ *
+ * @return
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IPropertySheetPage.class == adapter) {
+ // Do not test if tabbedPropertySheetPage is null before calling new
+ // this is managed by Eclipse which only call current method when necessary
+ tabbedPropertySheetPage = new TabbedPropertySheetPage(this);
+
+ return tabbedPropertySheetPage;
+ }
+
+ // Add a viewer
+ if (IContentOutlinePage.class == adapter) {
+ try {
+ IContentOutlinePage contentOutline = getContentOutlineRegistry().getContentOutline();
+ if (contentOutline != null)
+ return contentOutline;
+ } catch (BackboneException e) {
+ // TODO change next exception to more appropriate one
+ throw new RuntimeException(e);
+ }
+ }
+
+ if (BackboneContext.class == adapter) {
+ return defaultContext;
+ }
+
+ if (EditingDomain.class == adapter) {
+ return defaultContext.getTransactionalEditingDomain();
+ }
+
+ // GEF diagram requirements
+ if (adapter == ActionRegistry.class) {
+ return gefAdaptorDelegate.getActionRegistry();
+ }
+
+ // GEF diagram requirements
+ if (adapter == SelectionSynchronizer.class) {
+ return gefAdaptorDelegate.getSelectionSynchronizer();
+ }
+
+ // TODO : following code is GMF dependant. It should be moved to adapter
+ // Do we really need it? Who use it ?
+ if (adapter == IDiagramGraphicalViewer.class) {
+ IEditorPart activeEditor = getActiveEditor();
+ if (activeEditor instanceof DiagramEditor) {
+ return ((DiagramEditor) activeEditor).getDiagramGraphicalViewer();
+ }
+ return null;
+ }
+
+ return super.getAdapter(adapter);
+ }
+
+ /**
+ * Init the editor.
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+
+ // Init super
+ super.init(site, input);
+
+ // Init this class
+ try {
+ defaultContext = createDefaultContext(site, input);
+ } catch (BackboneException e) {
+ throw new PartInitException("Can't create default context.", e);
+ }
+
+ // configureDiagramEditDomain();
+ EditingDomainService editingDomainService = new EditingDomainService(defaultContext);
+ editingDomainService.addCommandStackListener(commandStackListener);
+
+ // Load resources
+ IFile file = ((IFileEditorInput) input).getFile();
+ defaultContext.getResourceSet().loadResources(file);
+ diagramNotifier = defaultContext.createDiagramNotifier();
+
+ // Create Gef adaptor
+ gefAdaptorDelegate = new MultiDiagramEditorGefDelegate();
+
+ // Create registries
+ // editorContextRegistry should be created after site, input and defaultContext are created.
+ editorContextRegistry = createEditorContextRegistry();
+ editorContextRegistry.registerContext("defaultContext", defaultContext);
+ editorRegistry = createEditorRegistry();
+
+ // Set editor name
+ setPartName(file.getName());
+
+ }
+
+ /**
+ *
+ */
+ @Override
+ protected void activate() {
+ super.activate();
+ // Start listening on diagram CRUD
+ diagramNotifier.addListener(diagramChangeListener);
+ }
+
+ @Override
+ protected void deactivate() {
+ // Stop listening on diagrams CRUD
+ diagramNotifier.removeListener(diagramChangeListener);
+ super.deactivate();
+ }
+
+ /**
+ * Create the default context used to control models life cycles.
+ *
+ * @param site
+ * @param input
+ * @throws BackboneException
+ */
+ private BackboneContext createDefaultContext(IEditorSite site, IEditorInput input) throws BackboneException {
+ BackboneContext defaultContext = new BackboneContext();
+ defaultContext.init(this);
+
+ return defaultContext;
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ // Save each associated resource
+ defaultContext.save(monitor);
+ markSaveLocation();
+ } catch (IOException ioe) {
+ }
+
+ }
+
+ /**
+ * Mark the command stack of all sub-editors. Default implementation do nothing.
+ */
+ protected void markSaveLocation() {
+ toSave = false;
+ getDiagramEditDomain().getCommandStack().markSaveLocation();
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ /**
+ * Mark the editor as dirty, and fire appropriate event.
+ */
+ protected void markDirty() {
+ toSave = true;
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isDirty() {
+ return toSave;
+ // return getDiagramEditDomain().getDiagramCommandStack().isDirty();
+ }
+
+ @Override
+ public void doSaveAs() {
+ // Show a SaveAs dialog
+ toSave = false;
+ super.firePropertyChange(PROP_DIRTY);
+ Shell shell = getEditorSite().getWorkbenchWindow().getShell();
+ SaveAsDialog dialog = new SaveAsDialog(shell);
+ dialog.setOriginalFile(((IFileEditorInput) getEditorInput()).getFile());
+ dialog.open();
+ final IPath path = dialog.getResult();
+ if (path != null) {
+ // try to save the editor's contents under a different file name
+ final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ try {
+ new ProgressMonitorDialog(shell).run(false, // don't fork
+ false, // not cancelable
+ new WorkspaceModifyOperation() { // run this operation
+
+ @Override
+ public void execute(final IProgressMonitor monitor) {
+ try {
+ defaultContext.saveAs(path);
+ } catch (IOException ioe) {
+ // Debug.log(ioe);
+ }
+ }
+ });
+ // set input to the new file
+ setInput(new FileEditorInput(file));
+ markSaveLocation();
+ } catch (InterruptedException ie) {
+ // should not happen, since the monitor dialog is not cancelable
+ ie.printStackTrace();
+ } catch (InvocationTargetException ite) {
+ ite.printStackTrace();
+ }
+ }
+
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return defaultContext.isSaveAsAllowed();
+ }
+
+ /**
+ * @see org.eclipse.papyrus.core.editor.IMultiDiagramEditor#getDefaultContext()
+ */
+ public BackboneContext getDefaultContext() {
+ return defaultContext;
+ }
+
+ public String getContributorId() {
+ // return Activator.PLUGIN_ID;
+ return "TreeOutlinePage";
+
+ }
+
+ // FIXME: Pour C´┐Żdric modif
+ public IEditorPart getActiveEditor() {
+ return super.getActiveEditor();
+ }
+
+ /**
+ * @TODO To be removed
+ */
+ // public class Test {
+ // MultiEditor mEditor;
+ // WorkbenchPage wpage;
+ // org.eclipse.ui.internal.EditorAreaHelper areaHelper;
+ // org.eclipse.ui.internal.EditorSashContainer sashContainer;
+ //
+ // TabbedStackPresentation tStackPresentation;
+ // }
+ /**
+ *
+ * @see org.eclipse.papyrus.sasheditor.sash.SashMultiPageEditorPart#createTilePartContainerModel()
+ */
+ @Override
+ protected ISashWindowsModelManager createTilePartContainerModel() {
+ SashDiagramModelManager mngr = new SashDiagramModelManager(getDefaultContext().getTransactionalEditingDomain(), getDefaultContext().getResourceSet().getDiResource());
+ return new SashWindowModelManagerWrapper(mngr);
+ }
+
+ /**
+ * Sets the default edit domain, shared among all editors
+ *
+ * @param diagramEditDomain
+ * the diagramEditDomain to set
+ */
+ public void setDiagramEditDomain(DiagramEditDomain diagramEditDomain) {
+ this.diagramEditDomain = diagramEditDomain;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public DiagramEditDomain getDiagramEditDomain() {
+ return diagramEditDomain;
+ }
+
+ // implements IDiagramWorkbenchPart to restore GMF standard behavior
+ // and delegate to the activeEditor
+ /**
+ * {@inheritDoc}
+ */
+ public Diagram getDiagram() {
+ IEditorPart activeEditor = getActiveEditor();
+ if (activeEditor instanceof DiagramEditor) {
+ return ((DiagramEditor) activeEditor).getDiagram();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public DiagramEditPart getDiagramEditPart() {
+ IEditorPart activeEditor = getActiveEditor();
+ if (activeEditor instanceof DiagramEditor) {
+ return ((DiagramEditor) activeEditor).getDiagramEditPart();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IDiagramGraphicalViewer getDiagramGraphicalViewer() {
+ IEditorPart activeEditor = getActiveEditor();
+ if (activeEditor instanceof DiagramEditor) {
+ return ((DiagramEditor) activeEditor).getDiagramGraphicalViewer();
+ } else {
+ return null;
+ }
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadClassNameException.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadClassNameException.java
new file mode 100644
index 00000000000..4c32fcb59aa
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadClassNameException.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+
+/**
+ * Exception thrown as an extension point is parsed at runtime. More accurately, it is thrown when one attribute of an extension point that should describe a class name does not correspond to a class
+ * in the classpath.
+ *
+ * @author Cedric Dumoulin
+ * @author Patrick Tessier
+ * @author schnekenburger
+ */
+public class BadClassNameException extends ExtensionException {
+
+ /**
+ * the name of{@link IConfigurationElement} that is bad build
+ */
+ private String iconfigurationElementName;
+
+ /**
+ * the name of the attribute of the {@link IConfigurationElement}
+ */
+ private String attributeName;
+
+ private Exception e = null;
+
+ /**
+ * serial version UID
+ *
+ * @generated
+ */
+ private static final long serialVersionUID = 1161426240944647521L;
+
+ /**
+ * constructor with an exception
+ *
+ * @param element
+ * the IConfigurationElement that raised the error
+ * @param attributeName
+ * the bad construct attibute
+ * @param e
+ * the associated exception
+ */
+ public BadClassNameException(String msg, String iConfigurationElementName, String attributeName, final Exception e) {
+ super(msg);
+ this.iconfigurationElementName = iConfigurationElementName;
+ this.attributeName = attributeName;
+ this.e = e;
+ }
+
+ /**
+ * constructor without an exception
+ *
+ * @param element
+ * the IConfigurationElement that raised the error
+ * @param attributeName
+ * the bad construct attibute
+ */
+ public BadClassNameException(String msg, String iConfigurationElementName, String attributeName) {
+ super(msg);
+ this.iconfigurationElementName = iConfigurationElementName;
+ this.attributeName = attributeName;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String toString() {
+ return super.toString() + " for the extension point " + iconfigurationElementName + "." + attributeName + " " + e;
+ }
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadNameExtensionException.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadNameExtensionException.java
new file mode 100644
index 00000000000..0fd70a654c5
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/BadNameExtensionException.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension;
+
+/**
+ * Exception thrown when a bad name is encountered in extension processing.
+ *
+ * @author dumoulin
+ * @author schnekenburger
+ */
+public class BadNameExtensionException extends ExtensionException {
+
+ /**
+ * serial version UID
+ *
+ * @generated
+ */
+ private static final long serialVersionUID = -2063118856033217385L;
+
+ /**
+ * Creates a simple BadNameExtensionException
+ */
+ public BadNameExtensionException() {
+ }
+
+ /**
+ * Creates a BadNameExtensionException with a specific message.
+ *
+ * @param message
+ * the message of the exception
+ */
+ public BadNameExtensionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Creates a BadNameExtensionException with a specific cause.
+ *
+ * @param cause
+ * the cause of the exception
+ */
+ public BadNameExtensionException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Creates a BadNameExtensionException with a specific cause and a specific message.
+ *
+ * @param message
+ * the message of the exception
+ * @param cause
+ * the cause of the exception
+ */
+ public BadNameExtensionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/DescriptorExtensionFactory.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/DescriptorExtensionFactory.java
new file mode 100644
index 00000000000..2989843a453
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/DescriptorExtensionFactory.java
@@ -0,0 +1,76 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.InvalidRegistryObjectException;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+
+/**
+ * This is a factory in charge to create descriptor
+ *
+ * @author Patrick Tessier
+ */
+public abstract class DescriptorExtensionFactory {
+
+ /**
+ * used to verify if the name of the {@link IConfigurationElement} is the same as the given name
+ *
+ * @param element
+ * an {@link IConfigurationElement} see eclipse extension point
+ * @param tagName
+ * the name of the {@link IConfigurationElement} that has to be verified
+ * @throws InvalidRegistryObjectException
+ * @throws BadNameExtensionException
+ */
+ protected void checkTagName(IConfigurationElement element, String tagName) throws BadNameExtensionException {
+ String name = element.getName();
+ if (!tagName.equals(name))
+ throw new BadNameExtensionException("Expected '" + tagName + "', found '" + name + "'.");
+ }
+
+ /**
+ * Retrieves the value of a specific attribute in a configuration element
+ *
+ * @param element
+ * the configuration element to parse
+ * @param attributeName
+ * the name of the attribute to read
+ * @return the class, result of the parsing
+ * @throws InvalidRegistryObjectException
+ * @throws BadClassNameException
+ */
+ protected Class<?> parseClass(IConfigurationElement element, String attributeName, String extensionPointName) throws BadClassNameException {
+ String className = element.getAttribute(attributeName);
+ if (className == null || className.length() == 0) {
+ throw new BadClassNameException(attributeName + "=null ", extensionPointName, attributeName);
+ }
+ Class<?> factoryClass;
+ try {
+ factoryClass = Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ // try another way
+ try {
+ String declaringID = element.getContributor().getName();
+ Bundle bundle = Platform.getBundle(declaringID);
+ factoryClass = bundle.loadClass(className);
+ } catch (ClassNotFoundException e1) {
+ throw new BadClassNameException(className + " can not be loaded ", extensionPointName, attributeName, e1);
+ }
+ }
+ return factoryClass;
+ }
+
+} \ No newline at end of file
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/ExtensionException.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/ExtensionException.java
new file mode 100644
index 00000000000..2368bfa4de8
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/ExtensionException.java
@@ -0,0 +1,84 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.papyrus.core.editor.BackboneException;
+
+/**
+ * Base class for extension exceptions
+ *
+ * @author dumoulin
+ * @author schnekenburger
+ */
+public class ExtensionException extends BackboneException {
+
+ /**
+ * serial version UID
+ *
+ * @generated
+ */
+ private static final long serialVersionUID = -9144153309491137046L;
+
+ /**
+ * Creates a simple ExtensionException.
+ */
+ public ExtensionException() {
+ }
+
+ /**
+ * Creates a ExtensionException with a specific message.
+ *
+ * @param message
+ * the message of the exception
+ */
+ public ExtensionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Creates a ExtensionException with a specific cause.
+ *
+ * @param cause
+ * the cause of the exception
+ */
+ public ExtensionException(Throwable cause) {
+ super(cause);
+
+ }
+
+ /**
+ * Creates a ExtensionException with a specific cause and a specific message.
+ *
+ * @param message
+ * the message of the exception
+ * @param cause
+ * the cause of the exception
+ */
+ public ExtensionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Return the name of the plugin and extension declaring the extension.
+ *
+ * @param element
+ * the configuration element corresponding to the extension
+ * @return a string containing the name of the plugin and the name of the extension
+ */
+ protected static String declaringExtensionToString(IConfigurationElement element) {
+ return "plugin:" + element.getContributor().getName() + " extension:" + element.getName();
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/NotFoundException.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/NotFoundException.java
new file mode 100644
index 00000000000..37f64eb0ae0
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/NotFoundException.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension;
+
+/**
+ * Exception thrown when something is not found when parsing a configuration element.
+ *
+ * @author dumoulin
+ * @author schnekenburger
+ */
+public class NotFoundException extends ExtensionException {
+
+ /**
+ * serial version UID
+ *
+ * @generated
+ */
+ private static final long serialVersionUID = -130754574538610199L;
+
+ /**
+ * Creates a simple NotFoundException.
+ */
+ public NotFoundException() {
+ }
+
+ /**
+ * Creates a NotFoundException with a specific message.
+ *
+ * @param message
+ * the message of the exception
+ */
+ public NotFoundException(String message) {
+ super(message);
+ }
+
+ /**
+ * Creates a NotFoundException with a specific cause.
+ *
+ * @param cause
+ * the cause of the exception
+ */
+ public NotFoundException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Creates a NotFoundException with a specific cause and a specific message.
+ *
+ * @param message
+ * the message of the exception
+ * @param cause
+ * the cause of the exception
+ */
+ public NotFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandDescriptor.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandDescriptor.java
new file mode 100644
index 00000000000..23eca44acb5
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandDescriptor.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Jerome Benois (Obeo) jerome.benois@obeo.fr - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.core.extension.commands;
+
+import org.eclipse.papyrus.core.editor.BackboneException;
+
+/**
+ * Creation Command Descriptor used to create a new diagram
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public class CreationCommandDescriptor {
+
+ protected Class<? extends ICreationCommand> creationCommandClass;
+
+ protected String commandId;
+
+ protected String label;
+
+ public String getCommandId() {
+ return commandId;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * Instance is created when requested.
+ */
+ protected ICreationCommand instance = null;
+
+ /**
+ * constructor.
+ *
+ * @return the creation command
+ * @throws BackboneException
+ */
+ protected ICreationCommand getCommand() throws BackboneException {
+ if (instance == null)
+ instance = createCommand();
+
+ return instance;
+ }
+
+ private ICreationCommand createCommand() throws BackboneException {
+ try {
+ ICreationCommand command = creationCommandClass.newInstance();
+ return command;
+ } catch (SecurityException e) {
+ // Lets propagate. This is an implementation problem that should be solved by programmer.
+ throw new RuntimeException(e);
+ } catch (InstantiationException e) {
+ // Lets propagate. This is an implementation problem that should be solved by programmer.
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ // Lets propagate. This is an implementation problem that should be solved by programmer.
+ throw new RuntimeException(e);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandExtensionFactory.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandExtensionFactory.java
new file mode 100644
index 00000000000..56b14834b84
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandExtensionFactory.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Jerome Benois (Obeo) jerome.benois@obeo.fr - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.core.extension.commands;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.papyrus.core.extension.BadNameExtensionException;
+import org.eclipse.papyrus.core.extension.DescriptorExtensionFactory;
+import org.eclipse.papyrus.core.extension.ExtensionException;
+import org.eclipse.papyrus.core.utils.IDebugChannel;
+import org.eclipse.papyrus.core.utils.PapyrusTrace;
+
+/**
+ * A factory used to create CreationCommand object from Eclipse extensions points elements.
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public class CreationCommandExtensionFactory extends DescriptorExtensionFactory {
+
+ /** singleton eINSTANCE of this class */
+ public final static CreationCommandExtensionFactory eINSTANCE = new CreationCommandExtensionFactory();
+
+ /** constant for the creation command **/
+ public final static String CREATION_COMMAND_EXTENSIONPOINT = "creationCommand";
+
+ /** constant for the attribute creationCommandClass **/
+ public final static String CREATION_COMMAND_CLASS_ATTR = "creationCommandClass";
+
+ /** constant for the attribute label **/
+ public final static String LABEL_ATTR = "label";
+
+ /** constant for the attribute contextId **/
+ public final static String ID_ATTRIBUTE = "id";
+
+ /**
+ * @return the eINSTANCE
+ */
+ public static CreationCommandExtensionFactory getInstance() {
+ return eINSTANCE;
+ }
+
+ /**
+ * Create a CreationCommand instance corresponding to the ConfigurationElement.
+ *
+ * @param element
+ * an {@link IConfigurationElement} see eclipse extension point
+ * @return a CreationCommandDescriptor structure that contains information to the creation diagram command
+ * @throws BadNameExtensionException
+ **/
+ public CreationCommandDescriptor createCreationCommand(IConfigurationElement element) throws ExtensionException {
+ CreationCommandDescriptor res;
+
+ checkTagName(element, CREATION_COMMAND_EXTENSIONPOINT);
+
+ res = new CreationCommandDescriptor();
+ res.creationCommandClass = (Class<ICreationCommand>) parseClass(element, CREATION_COMMAND_CLASS_ATTR, CREATION_COMMAND_EXTENSIONPOINT);
+ res.commandId = element.getAttribute(ID_ATTRIBUTE);
+ res.label = element.getAttribute(LABEL_ATTR);
+ PapyrusTrace.trace(IDebugChannel.PAPYRUS_EXTENSIONPOINT_LOADING, this, "a creation command ready " + res);
+
+ return res;
+ }
+
+} \ No newline at end of file
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandRegistry.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandRegistry.java
new file mode 100644
index 00000000000..53acc97173f
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/CreationCommandRegistry.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Jerome Benois (Obeo) jerome.benois@obeo.fr - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.core.extension.commands;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.papyrus.core.extension.ExtensionException;
+import org.eclipse.papyrus.core.extension.NotFoundException;
+import org.eclipse.papyrus.core.utils.IDebugChannel;
+import org.eclipse.papyrus.core.utils.PapyrusTrace;
+import org.eclipse.papyrus.sasheditor.Activator;
+
+/**
+ * {@inheritDoc}
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public class CreationCommandRegistry implements ICreationCommandRegistry {
+
+ /** ID of the editor extension (schema filename) */
+ public static final String EDITOR_EXTENSION_ID = "papyrusDiagram";
+
+ /** Namespace where to look for the extension points. */
+ protected String extensionPointNamespace;
+
+ /**
+ * Registered creation command descriptors.
+ */
+ private Map<Object, CreationCommandDescriptor> creationCommandDescriptors;
+
+ public CreationCommandRegistry(String extensionPointNamespace) {
+ this.extensionPointNamespace = extensionPointNamespace;
+ initializeCreationCommandDescriptors();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<CreationCommandDescriptor> getCommandDescriptors() {
+ return creationCommandDescriptors.values();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @throws NotFoundException
+ */
+ public ICreationCommand getCommand(String commandId) throws NotFoundException {
+ try {
+ CreationCommandDescriptor desc = creationCommandDescriptors.get(commandId);
+ return desc.getCommand();
+ } catch (Exception e) {
+ throw new NotFoundException("No creation command registered under id '" + commandId + "'.");
+ }
+ }
+
+ /**
+ * Read command descriptors from extension points.
+ */
+ private void initializeCreationCommandDescriptors() {
+
+ creationCommandDescriptors = new HashMap<Object, CreationCommandDescriptor>();
+ // Reading data from plugins
+ IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(extensionPointNamespace, EDITOR_EXTENSION_ID);
+
+ CreationCommandExtensionFactory extensionReader = new CreationCommandExtensionFactory();
+
+ for (IConfigurationElement ele : configElements) {
+ CreationCommandDescriptor desc;
+ try {
+ if (CreationCommandExtensionFactory.CREATION_COMMAND_EXTENSIONPOINT.equals(ele.getName())) {
+ desc = extensionReader.createCreationCommand(ele);
+ creationCommandDescriptors.put(desc.commandId, desc);
+ }
+ } catch (ExtensionException e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage(), e));
+ PapyrusTrace.error(IDebugChannel.PAPYRUS_EXTENSIONPOINT_LOADING, this, "Initialization creation command problem " + e);
+ }
+ }
+ PapyrusTrace.trace(IDebugChannel.PAPYRUS_EXTENSIONPOINT_LOADING, this, "" + creationCommandDescriptors.size() + " creationCommands loaded");
+
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommand.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommand.java
new file mode 100644
index 00000000000..bec3af78701
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommand.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Jerome Benois (Obeo) jerome.benois@obeo.fr - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.core.extension.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.core.utils.DiResourceSet;
+
+/**
+ * Define a command use to create new diagram. It use to provide Eclipse extension @see {@link PapyrusDiagram#creationCommand} It used by the creation model wizard.
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public interface ICreationCommand {
+
+ /**
+ * Create a new diagram in diResourceSet with the given name.
+ *
+ * @param diResourceSet
+ * the resourceSet containing all diagrams
+ * @param container
+ * of the diagram, if container is null, the diagram is contained by the top level container
+ * @param name
+ * the name of the new diagram
+ */
+ public void createDiagram(DiResourceSet diResourceSet, EObject container, String name);
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommandRegistry.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommandRegistry.java
new file mode 100644
index 00000000000..19a8a61bcba
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/commands/ICreationCommandRegistry.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Obeo.
+ * 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:
+ * Jerome Benois (Obeo) jerome.benois@obeo.fr - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.core.extension.commands;
+
+import java.util.Collection;
+
+import org.eclipse.papyrus.core.extension.NotFoundException;
+
+/**
+ * Registry containing CreationCommand registered by Eclipse extension.
+ *
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public interface ICreationCommandRegistry {
+
+ /**
+ * Get all registered creation command descriptors
+ *
+ * @return collection of command descriptors
+ */
+ public Collection<CreationCommandDescriptor> getCommandDescriptors();
+
+ /**
+ * Get registered creation with given identifier
+ *
+ * @param commandId
+ * the command id
+ * @return the registered command
+ * @throws NotFoundException
+ * if command not registered
+ */
+ ICreationCommand getCommand(String commandId) throws NotFoundException;
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/AbstractEditorFactory.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/AbstractEditorFactory.java
new file mode 100644
index 00000000000..12fdf2688ee
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/AbstractEditorFactory.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension.diagrameditor;
+
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContext;
+import org.eclipse.papyrus.di.Diagram;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * @author Remi Schnekenburger
+ * @author Patrick Tessier
+ */
+public abstract class AbstractEditorFactory implements IEditorFactory {
+
+ /**
+ * Expected Class of the diagram to create.
+ */
+ private Class<?> diagramClass;
+
+ /** Expected diagram type (@see {@link Diagram#getType()}) */
+ private String expectedType;
+
+ /**
+ * Creates a new AbstractEditorFactory.
+ *
+ * @param diagramClass
+ * expected Class of the diagram to create.
+ * @param expectedType
+ * expected diagram type (@see {@link Diagram#getType()})
+ */
+ public AbstractEditorFactory(Class<?> diagramClass, String expectedType) {
+ assert (expectedType != null);
+ this.diagramClass = diagramClass;
+ this.expectedType = expectedType;
+ }
+
+ /**
+ * Returns the expected class for the diagram implementation
+ *
+ * @return the expected class for the diagram implementation
+ */
+ public Class<?> getDiagramClass() {
+ return diagramClass;
+ }
+
+ /**
+ * Returns the expected type of the diagram
+ *
+ * @return the expected diagram type (@see {@link Diagram#getType()})
+ */
+ public String getExpectedType() {
+ return expectedType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract IEditorPart createEditorFor(IEditorContext context, Object root) throws BackboneException;
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEditorFor(Object root) {
+ if (root instanceof Diagram) {
+ Diagram diagram = (Diagram) root;
+ final String type = diagram.getType();
+ return expectedType.equals(type);
+ }
+ // no
+ return false;
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptor.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptor.java
new file mode 100644
index 00000000000..2c6454e235d
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptor.java
@@ -0,0 +1,151 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension.diagrameditor;
+
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContext;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * This descriptor describes a nested diagram. It is used by MultiDiagramEditor to know about the nested diagram. It is fill by an extension.
+ *
+ * @author Cedric Dumoulin
+ *
+ */
+public class EditorDescriptor {
+
+ /**
+ * Editor factory implementation class.
+ */
+ private Class<IEditorFactory> editorFactoryClass;
+
+ /**
+ * Context Id used to search the context requested by the editor.
+ */
+ private String requestedContextId;
+
+ /**
+ * Cached factory. Initialized by first call to getXxx
+ */
+ private IEditorFactory editorFactory;
+
+ /**
+ * Constructor.
+ */
+ public EditorDescriptor() {
+
+ }
+
+ /**
+ * to obtain the requestedContextId
+ *
+ * @return the requestedContextId
+ */
+ public String getRequestedContextId() {
+ return requestedContextId;
+ }
+
+ /**
+ * set the requestedContextId
+ *
+ * @param requestedContextId
+ * the requestedContextId to set
+ */
+ public void setRequestedContextId(String requestedContextId) {
+ this.requestedContextId = requestedContextId;
+ }
+
+ /**
+ * Get associated editorFactory. The editorFactoryClass should be set, otherwise an error is thrown.
+ *
+ * @return the IEditorFactory
+ */
+ public IEditorFactory getEditorFactory() {
+ if (editorFactory != null)
+ return editorFactory;
+
+ if (editorFactoryClass == null) { // error
+ throw new IllegalStateException("EditorFactory class should be set.");
+ }
+
+ // Create it
+ try {
+ editorFactory = (IEditorFactory) editorFactoryClass.newInstance();
+ return editorFactory;
+ } catch (InstantiationException e) {
+ // Lets propagate. This is an implementation problem that should be
+ // solved by programmer.
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ // Lets propagate. This is an implementation problem that should be
+ // solved by programmer.
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * This method is used in order to know if the editor associated to this description can edit the root object. example a diagram di2 or notation
+ *
+ * @param root
+ * the element that can be edited
+ * @return boolean true if the editor can edit it.
+ */
+ public boolean isEditorFor(Object root) {
+ return getEditorFactory().isEditorFor(root);
+ }
+
+ /**
+ * Create a new editor for the specified root object.
+ *
+ * @param context
+ * the context used to init the editor
+ * @param root
+ * the element to launch the editor (diagram for instance)
+ * @throws BackboneException
+ * Editor could not be created
+ */
+ public IEditorPart createEditorFor(IEditorContext context, Object root) throws BackboneException {
+ return getEditorFactory().createEditorFor(context, root);
+ }
+
+ /**
+ * get the class of the editor factory
+ *
+ * @return the class of the editor
+ */
+ public Class<IEditorFactory> getEditorFactoryClass() {
+ return editorFactoryClass;
+ }
+
+ /**
+ * set the editor facoty to this descriptor
+ *
+ * @param editorFactoryClass
+ * the class that represents the editor factory
+ */
+ public void setEditorFactoryClass(Class<IEditorFactory> editorFactoryClass) {
+ this.editorFactoryClass = editorFactoryClass;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String toString() {
+ if (editorFactoryClass == null || editorFactoryClass.getName() == null) {
+ return "[nestedEditor editorFactory:" + editorFactoryClass + "(null) requestedContextID:" + requestedContextId + "]";
+ }
+ return "[nestedEditor editorFactory:" + editorFactoryClass.getName() + " requestedContextID:" + requestedContextId + "]";
+ }
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptorExtensionFactory.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptorExtensionFactory.java
new file mode 100644
index 00000000000..4aa14f7918f
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorDescriptorExtensionFactory.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension.diagrameditor;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.papyrus.core.extension.BadNameExtensionException;
+import org.eclipse.papyrus.core.extension.DescriptorExtensionFactory;
+import org.eclipse.papyrus.core.extension.ExtensionException;
+import org.eclipse.papyrus.core.utils.IDebugChannel;
+import org.eclipse.papyrus.core.utils.PapyrusTrace;
+
+/**
+ * A factory used to create editor descriptor object from Eclipse extensions points elements.
+ *
+ *@author Cedric Dumoulin
+ *@author Patrick Tessier
+ */
+public class EditorDescriptorExtensionFactory extends DescriptorExtensionFactory {
+
+ /** singleton eINSTANCE of this class */
+ public final static EditorDescriptorExtensionFactory eINSTANCE = new EditorDescriptorExtensionFactory();
+
+ /** constant for the editor diagram **/
+ public final static String EDITOR_DIAGRAM_EXTENSIONPOINT = "editorDiagram";
+
+ /** constant for the attribute factoryClass **/
+ public final static String FACTORYCLASS_ATTRIBUTE = "factoryClass";
+
+ /** constant for the attribute contextId **/
+ public final static String CONTEXTID_ATTRIBUTE = "contextId";
+
+ /**
+ * @return the eINSTANCE
+ */
+ public static EditorDescriptorExtensionFactory getInstance() {
+ return eINSTANCE;
+ }
+
+ /**
+ * Create a descriptor instance corresponding to the ConfigurationElement.
+ *
+ * @param element
+ * an {@link IConfigurationElement} see eclipse extension point
+ * @return a nestedEditorDescriptor strucure that contains information to create diagrams
+ * @throws BadNameExtensionException
+ */
+ public EditorDescriptor createNestedEditorDescriptor(IConfigurationElement element) throws ExtensionException {
+ EditorDescriptor res;
+
+ checkTagName(element, EDITOR_DIAGRAM_EXTENSIONPOINT);
+
+ res = new EditorDescriptor();
+ res.setEditorFactoryClass((Class<IEditorFactory>) parseClass(element, FACTORYCLASS_ATTRIBUTE, EDITOR_DIAGRAM_EXTENSIONPOINT));
+ res.setRequestedContextId(element.getAttribute(CONTEXTID_ATTRIBUTE));
+ PapyrusTrace.trace(IDebugChannel.PAPYRUS_EXTENSIONPOINT_LOADING, this, "a nested editor ready " + res);
+ return res;
+ }
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorFactoryRegistry.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorFactoryRegistry.java
new file mode 100644
index 00000000000..0a619a937af
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/EditorFactoryRegistry.java
@@ -0,0 +1,133 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.core.extension.diagrameditor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.papyrus.core.editor.BackboneException;
+import org.eclipse.papyrus.core.extension.ExtensionException;
+import org.eclipse.papyrus.core.extension.NotFoundException;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContext;
+import org.eclipse.papyrus.core.extension.editorcontext.IEditorContextRegistry;
+import org.eclipse.papyrus.core.utils.IDebugChannel;
+import org.eclipse.papyrus.core.utils.PapyrusTrace;
+import org.eclipse.papyrus.sasheditor.gef.EditorNotFoundException;
+import org.eclipse.papyrus.sasheditor.gef.MultiDiagramException;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * A registry recording possible editor descriptors. This class use the eclipse extension mechanism.
+ */
+public class EditorFactoryRegistry implements IEditorFactoryRegistry {
+
+ /** ID of the editor extension (schema filename) */
+ public static final String EDITOR_EXTENSION_ID = "papyrusDiagram";
+
+ /** Namespace where to look for the extension points. */
+ protected String extensionPointNamespace;
+
+ /** list of editor descriptors */
+ protected List<EditorDescriptor> editorDescriptors;
+
+ /** indicates if extension is loaded or not */
+ private boolean isExtensionLoaded = false;
+
+ /**
+ * Create a new Registry reading extension from the specified namespace. The namespace is usually the name of the plugin owning the registry.
+ *
+ * @param extensionPointNamespace
+ */
+ public EditorFactoryRegistry(String extensionPointNamespace) {
+ super();
+ this.extensionPointNamespace = extensionPointNamespace;
+ editorDescriptors = new ArrayList<EditorDescriptor>();
+ }
+
+ /**
+ * Create a new editor for the specified diagram root.
+ *
+ * @throws EditorNotFoundException
+ * No editor handling the model can be found.
+ */
+ public IEditorPart createEditorFor(IEditorContextRegistry contextFactoryRegistry, Object model) throws MultiDiagramException {
+ for (EditorDescriptor desc : getEditorDescriptors()) {
+ if (desc.isEditorFor(model)) {
+ {
+ // Get requested context
+ IEditorContext context;
+ try {
+ PapyrusTrace.trace(IDebugChannel.PAPYRUS_CORE, this, "creation of an editor");
+ context = contextFactoryRegistry.getContext(desc.getRequestedContextId());
+ return desc.createEditorFor(context, model);
+ } catch (NotFoundException e) {
+ throw new EditorNotFoundException(e);
+ } catch (ExtensionException e) {
+ throw new EditorNotFoundException(e);
+ } catch (BackboneException e) {
+ throw new MultiDiagramException(e);
+ }
+ }
+ }
+ }
+ // no editor found !
+ throw new EditorNotFoundException("No editor registered for '" + model + "'.");
+ }
+
+ /**
+ * Get the list of editor descriptor.
+ *
+ * @return the list of editor descriptor.
+ */
+ public List<EditorDescriptor> getEditorDescriptors() {
+ if (!isExtensionLoaded) {
+ isExtensionLoaded = true;
+ initializeEditorDescriptors();
+ }
+ return editorDescriptors;
+ }
+
+ /**
+ * Read editor descriptors from extension points.
+ */
+ private void initializeEditorDescriptors() {
+ // Reading data from plugins
+ IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(extensionPointNamespace, EDITOR_EXTENSION_ID);
+
+ for (IConfigurationElement ele : configElements) {
+ EditorDescriptor desc;
+ try {
+ if (EditorDescriptorExtensionFactory.EDITOR_DIAGRAM_EXTENSIONPOINT.equals(ele.getName())) {
+ desc = EditorDescriptorExtensionFactory.eINSTANCE.createNestedEditorDescriptor(ele);
+ editorDescriptors.add(desc);
+ }
+ } catch (ExtensionException e) {
+ PapyrusTrace.error(IDebugChannel.PAPYRUS_EXTENSIONPOINT_LOADING, this, "Initialization editor problem " + e);
+ }
+ }
+ PapyrusTrace.trace(IDebugChannel.PAPYRUS_EXTENSIONPOINT_LOADING, this, "" + editorDescriptors.size() + " editorDescriptions loaded");
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return "EditorFactoryRegistry: " + editorDescriptors.toString();
+ }
+
+}
diff --git a/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/IEditorFactory.java b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/IEditorFactory.java
new file mode 100644
index 00000000000..01b27d6fc93
--- /dev/null
+++ b/core/org.eclipse.papyrus.core/src/org/eclipse/papyrus/core/extension/diagrameditor/IEditorFactory.java
@@ -0,0 +1,49 @@
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * 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:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ *