Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Le Fevre - CEA2016-03-23 08:37:44 -0400
committerFrancois Le Fevre - CEA2016-12-02 09:22:45 -0500
commit80a748cad3053b544719a88bc169df66346c083e (patch)
treea9f35bca86fa4c59c485cb10010ba74105f79443 /examples
parent941bb615fd965cab791ab55c37a57dd3337de21a (diff)
downloadorg.eclipse.papyrus-80a748cad3053b544719a88bc169df66346c083e.tar.gz
org.eclipse.papyrus-80a748cad3053b544719a88bc169df66346c083e.tar.xz
org.eclipse.papyrus-80a748cad3053b544719a88bc169df66346c083e.zip
Bug 476222: [examples] how to add the examples
- trying to integrate examples as a separate features - creation of intermediate poms Change-Id: I20af1ad53555a9256a2590fdd84fb0e8d60627e4 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=476222 Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
Diffstat (limited to 'examples')
-rw-r--r--examples/core/org.eclipse.papyrus.example.core.lifecycleevents/META-INF/MANIFEST.MF5
-rw-r--r--examples/core/org.eclipse.papyrus.example.core.lifecycleevents/pom.xml5
-rw-r--r--examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/LifeCycleEventsMonitorService.java8
-rw-r--r--examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/pom.xml8
-rw-r--r--examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/pom.xml8
-rw-r--r--examples/core/pom.xml16
-rw-r--r--examples/emf/org.eclipse.papyrus.outline.emftree/META-INF/MANIFEST.MF1
-rw-r--r--examples/emf/org.eclipse.papyrus.outline.emftree/plugin.xml24
-rw-r--r--examples/emf/org.eclipse.papyrus.outline.emftree/pom.xml9
-rw-r--r--examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/ContentOutline.java508
-rw-r--r--examples/emf/pom.xml14
-rw-r--r--examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/pom.xml7
-rw-r--r--examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/plugin.xml26
-rw-r--r--examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/pom.xml7
-rw-r--r--examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/Activator.java141
-rw-r--r--examples/infra/pom.xml15
-rw-r--r--examples/others/org.eclipse.papyrus.example.diagram.simplediagram/pom.xml7
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/.classpath (renamed from examples/org.eclipse.papyrus.example.text.instance/.classpath)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/.project (renamed from examples/org.eclipse.papyrus.example.text.instance/.project)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/META-INF/MANIFEST.MF (renamed from examples/org.eclipse.papyrus.example.text.instance/META-INF/MANIFEST.MF)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/about.html (renamed from examples/org.eclipse.papyrus.example.text.instance/about.html)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/build.properties (renamed from examples/org.eclipse.papyrus.example.text.instance/build.properties)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore (renamed from examples/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel (renamed from examples/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/plugin.properties (renamed from examples/org.eclipse.papyrus.example.text.instance/plugin.properties)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/plugin.xml (renamed from examples/org.eclipse.papyrus.example.text.instance/plugin.xml)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/pom.xml (renamed from examples/org.eclipse.papyrus.example.text.instance/pom.xml)7
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrusTextInstance.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrusTextInstance.java)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstanceFactory.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstanceFactory.java)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstancePackage.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstancePackage.java)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrusTextInstanceImpl.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrusTextInstanceImpl.java)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstanceFactoryImpl.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstanceFactoryImpl.java)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstancePackageImpl.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstancePackageImpl.java)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceAdapterFactory.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceAdapterFactory.java)0
-rw-r--r--examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceSwitch.java (renamed from examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceSwitch.java)0
-rw-r--r--examples/others/pom.xml15
-rw-r--r--examples/pom.xml54
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.settings/org.eclipse.jdt.core.prefs (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.settings/org.eclipse.jdt.core.prefs)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/META-INF/MANIFEST.MF (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/META-INF/MANIFEST.MF)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/icons/texteditorv2.bmp (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/icons/texteditorv2.bmp)bin822 -> 822 bytes
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.properties (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.properties)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.xml (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.xml)134
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/pom.xml (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/pom.xml)7
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/Activator.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/Activator.java)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/editor/PapyrusCommentEditor.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/editor/PapyrusCommentEditor.java)441
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/factory/CommentEditorFactory.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/factory/CommentEditorFactory.java)6
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/handler/CommentEditorHandler.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/handler/CommentEditorHandler.java)354
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/modelresource/TextEditorModelCommentResource.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/modelresource/TextEditorModelCommentResource.java)191
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.settings/org.eclipse.jdt.core.prefs (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.settings/org.eclipse.jdt.core.prefs)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/META-INF/MANIFEST.MF (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/META-INF/MANIFEST.MF)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/build.properties (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/build.properties)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/icons/texteditor.bmp (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/icons/texteditor.bmp)bin1078 -> 1078 bytes
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.properties (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.properties)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.xml (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.xml)134
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/pom.xml (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/pom.xml)7
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/Activator.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/Activator.java)0
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/editor/PapyrusCommentEditor.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/editor/PapyrusCommentEditor.java)442
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/factory/CommentEditorFactory.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/factory/CommentEditorFactory.java)4
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/handler/CommentEditorHandler.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/handler/CommentEditorHandler.java)354
-rw-r--r--examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/modelresource/TextEditorModelSharedResource.java (renamed from examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/modelresource/TextEditorModelSharedResource.java)0
-rw-r--r--examples/uml/org.eclipse.papyrus.thousandcreation/pom.xml7
-rw-r--r--examples/uml/org.eclipse.papyrus.thousandcreation/test/thousandcreation/HugeModelGenerationAction.java204
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.classpath (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/.classpath)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.project (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/.project)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.core.prefs (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.core.prefs)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.ui.prefs (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.ui.prefs)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.pde.api.tools.prefs (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.pde.api.tools.prefs)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF)2
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/about.html (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/about.html)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/build.properties (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/build.properties)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/icons/EmfTree.gif (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/icons/EmfTree.gif)bin369 -> 369 bytes
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/pom.xml (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/pom.xml)6
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/Activator.java (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/Activator.java)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/CreateEMFTreeDiagramHandler.java (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/CreateEMFTreeDiagramHandler.java)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/EmfTreeDiagramEditorFactory.java (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/EmfTreeDiagramEditorFactory.java)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/UMLEditor.java (renamed from examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/UMLEditor.java)0
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF1
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml7
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java15
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java16
-rw-r--r--examples/uml/org.eclipse.papyrus.uml.textual.editors.example/pom.xml7
-rw-r--r--examples/uml/pom.xml19
-rw-r--r--examples/user/pom.xml15
-rw-r--r--examples/user/referencediagrams/pom.xml16
94 files changed, 1701 insertions, 1587 deletions
diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/META-INF/MANIFEST.MF b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/META-INF/MANIFEST.MF
index 5b74056ed94..6965c2e4f15 100644
--- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/META-INF/MANIFEST.MF
+++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/META-INF/MANIFEST.MF
@@ -2,11 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.papyrus.example.core.lifecycleevents;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Activator: org.eclipse.papyrus.example.core.lifecycleevents.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.papyrus.infra.core;bundle-version="1.1.0"
+ org.eclipse.papyrus.infra.core,
+ org.eclipse.papyrus.infra.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/pom.xml b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/pom.xml
index 032789c897d..2a19d6bb685 100644
--- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/pom.xml
+++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/pom.xml
@@ -2,10 +2,9 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.core</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.example.core.lifecycleevents</artifactId>
<groupId>org.eclipse.papyrus</groupId>
diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/LifeCycleEventsMonitorService.java b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/LifeCycleEventsMonitorService.java
index 7acf5db4f13..ab2bae7b2ee 100644
--- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/LifeCycleEventsMonitorService.java
+++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/LifeCycleEventsMonitorService.java
@@ -13,10 +13,10 @@
*****************************************************************************/
package org.eclipse.papyrus.example.core.lifecycleevents;
-import org.eclipse.papyrus.infra.core.lifecycleevents.DoSaveEvent;
-import org.eclipse.papyrus.infra.core.lifecycleevents.ILifeCycleEventsProvider;
-import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveEventListener;
-import org.eclipse.papyrus.infra.core.lifecycleevents.LifeCycleEventsProvider;
+import org.eclipse.papyrus.infra.ui.lifecycleevents.DoSaveEvent;
+import org.eclipse.papyrus.infra.ui.lifecycleevents.ILifeCycleEventsProvider;
+import org.eclipse.papyrus.infra.ui.lifecycleevents.ISaveEventListener;
+import org.eclipse.papyrus.infra.ui.lifecycleevents.LifeCycleEventsProvider;
import org.eclipse.papyrus.infra.core.services.IService;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/pom.xml b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/pom.xml
index f055712b954..87f26333893 100644
--- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/pom.xml
+++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/pom.xml
@@ -2,13 +2,11 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.core</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.eclipse.papyrus</groupId>
<artifactId>org.eclipse.papyrus.example.core.sashwindows.fulleditor</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/pom.xml b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/pom.xml
index cb9ae5538e5..2556c4cb50d 100644
--- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/pom.xml
+++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/pom.xml
@@ -2,13 +2,11 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.core</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.example.core.sashwindows.simpleeditor</artifactId>
- <groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/core/pom.xml b/examples/core/pom.xml
new file mode 100644
index 00000000000..a6e10f2898d
--- /dev/null
+++ b/examples/core/pom.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.examples.core</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.eclipse.papyrus.example.core.lifecycleevents</module>
+ <module>org.eclipse.papyrus.example.core.sashwindows.fulleditor</module>
+ <module>org.eclipse.papyrus.example.core.sashwindows.simpleeditor</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/META-INF/MANIFEST.MF b/examples/emf/org.eclipse.papyrus.outline.emftree/META-INF/MANIFEST.MF
index c3cea1cf703..ba569604806 100644
--- a/examples/emf/org.eclipse.papyrus.outline.emftree/META-INF/MANIFEST.MF
+++ b/examples/emf/org.eclipse.papyrus.outline.emftree/META-INF/MANIFEST.MF
@@ -1,5 +1,6 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.ui,
org.eclipse.emf.ecore.editor;bundle-version="2.5.0",
org.eclipse.uml2.uml.edit;bundle-version="3.0.0",
org.eclipse.core.runtime;bundle-version="3.7.0",
diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.xml b/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.xml
index add958c9cbb..b56066c5a7f 100644
--- a/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.xml
+++ b/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.xml
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.infra.core.papyrusContentOutline">
- <contentoutline
- class="org.eclipse.papyrus.outline.emftree.ContentOutline"
- priority="1">
- </contentoutline>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.ui.papyrusContentOutline">
+ <contentoutline
+ class="org.eclipse.papyrus.outline.emftree.ContentOutline"
+ priority="1">
+ </contentoutline>
+ </extension>
+
+</plugin>
diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/pom.xml b/examples/emf/org.eclipse.papyrus.outline.emftree/pom.xml
index 401adb773b9..7774594b139 100644
--- a/examples/emf/org.eclipse.papyrus.outline.emftree/pom.xml
+++ b/examples/emf/org.eclipse.papyrus.outline.emftree/pom.xml
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>org.eclipse.papyrus</artifactId>
+ <parent>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.emf</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.outline.emftree</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/ContentOutline.java b/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/ContentOutline.java
index 35685f11be5..b6ff2f637ea 100644
--- a/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/ContentOutline.java
+++ b/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/ContentOutline.java
@@ -1,254 +1,254 @@
-/*****************************************************************************
- * 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.outline.emftree;
-
-import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
-import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
-import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
-import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.infra.core.contentoutline.IPapyrusContentOutlinePage;
-import org.eclipse.papyrus.infra.core.editor.BackboneException;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.outline.emftree.internal.OutlineDragAdapter;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-
-/**
- * A Content outline based on the one generated from the DI2 metamodel. This ContentOutlinePage can
- * be used by the multi editor page.
- *
- * @author dumoulin
- *
- */
-public class ContentOutline extends ContentOutlinePage implements IMenuListener, IPapyrusContentOutlinePage {
-
- /**
- * This keeps track of the editing domain that is used to track all changes to the model. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected EditingDomain editingDomain;
-
- /**
- * This is the one adapter factory used for providing views of the model. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected ComposedAdapterFactory adapterFactory;
-
- /**
- * This is the content outline page's viewer. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected TreeViewer contentOutlineViewer;
-
- private IEditorSite editorSite;
-
- public ContentOutline() {
- super();
- };
-
- /**
- * Constructor.
- *
- * @param editorSite
- * @param editingDomain
- * @param adapterFactory
- */
- public ContentOutline(IEditorSite editorSite, EditingDomain editingDomain, ComposedAdapterFactory adapterFactory) {
- super();
- this.editorSite = editorSite;
- this.editingDomain = editingDomain;
- this.adapterFactory = adapterFactory;
- }
-
- /**
- * Constructor.
- *
- * @param editorSite
- * @param editingDomain
- * @param adapterFactory
- */
- public ContentOutline(IEditorSite editorSite, EditingDomain editingDomain) {
- super();
- this.editorSite = editorSite;
- this.editingDomain = editingDomain;
- initAdapterFactory();
- }
-
- /**
- * Init the outline. This method is used by the MultiPageEditor to initialize the Outline.
- *
- * @param multiEditor
- * @param site
- * @throws BackboneException
- */
- public void init(IMultiDiagramEditor multiEditor) throws BackboneException {
-
- // Get the EditorActionBarContributor requested by this particular EMF editor.
- // The EditorActionBarContributor should be registered in extensions under the specified name
- // String EditorActionBarContributorId = "DiActionBarContributor";
- // EditorActionBarContributor actionBarContributor = multiEditor.getActionBarContributorRegistry().getActionBarContributor(EditorActionBarContributorId);
- // IEditorSite site = new MultiPageAdapterSite(multiEditor.getEditorSite(), actionBarContributor);
- this.editorSite = multiEditor.getEditorSite();
- try {
- this.editingDomain = multiEditor.getServicesRegistry().getService(TransactionalEditingDomain.class);
- } catch (ServiceException e) {
- throw new BackboneException("Can't get TransactionalEditingDomain", e);
- }
- initAdapterFactory();
-
- }
-
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
- contentOutlineViewer = getTreeViewer();
- contentOutlineViewer.addSelectionChangedListener(this);
-
- // Set up the tree viewer.
- //
- contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- contentOutlineViewer.setInput(editingDomain.getResourceSet());
-
- // Make sure our popups work.
- //
- createContextMenuFor(contentOutlineViewer);
-
- if(!editingDomain.getResourceSet().getResources().isEmpty()) {
- // Select the root object in the view.
- //
- contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
- }
- // initDragAndDrop();
- }
-
- /**
- * Add drag and drop ability between the outline to the editor.
- */
- protected void initDragAndDrop() {
- int ops = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
- // Enable Drag
- OutlineDragAdapter dragAdapter = new OutlineDragAdapter(contentOutlineViewer);
- contentOutlineViewer.addDragSupport(ops, dragAdapter.getSupportedDragTransfers(), dragAdapter);
- }
-
- @Override
- public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
- super.makeContributions(menuManager, toolBarManager, statusLineManager);
- // contentOutlineStatusLineManager = statusLineManager;
- }
-
- @Override
- public void setActionBars(IActionBars actionBars) {
- super.setActionBars(actionBars);
- if(getActionBarContributor() != null) {
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- }
-
- private EditingDomainActionBarContributor getActionBarContributor() {
- if(editorSite.getActionBarContributor() instanceof EditingDomainActionBarContributor) {
- return (EditingDomainActionBarContributor)editorSite.getActionBarContributor();
- }
- return null;
- }
-
- /**
- * This creates a context menu for the viewer and adds a listener as well registering the menu
- * for extension. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private void createContextMenuFor(StructuredViewer viewer) {
- MenuManager contextMenu = new MenuManager("#PopUp");
- contextMenu.add(new Separator("additions"));
- contextMenu.setRemoveAllWhenShown(true);
- contextMenu.addMenuListener(this);
- Menu menu = contextMenu.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getEditorSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
-
- int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
- Transfer[] transfers = new Transfer[]{ LocalTransfer.getInstance() };
- viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
-
- }
-
- /**
- * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus
- * with contributions from the Edit menu. <!-- begin-user-doc --> <!-- end-user-doc -->
- */
- public void menuAboutToShow(IMenuManager menuManager) {
- ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- */
- // private EditingDomainActionBarContributor getActionBarContributor() {
- // return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
- // }
- /**
- *
- * @return
- */
- private IEditorSite getEditorSite() {
- return editorSite;
- }
-
- /**
- *
- */
- private void initAdapterFactory() {
- adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
-
- }
-
-}
+/*****************************************************************************
+ * 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.outline.emftree;
+
+import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.papyrus.infra.ui.contentoutline.IPapyrusContentOutlinePage;
+import org.eclipse.papyrus.infra.core.editor.BackboneException;
+import org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.outline.emftree.internal.OutlineDragAdapter;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+
+/**
+ * A Content outline based on the one generated from the DI2 metamodel. This ContentOutlinePage can
+ * be used by the multi editor page.
+ *
+ * @author dumoulin
+ *
+ */
+public class ContentOutline extends ContentOutlinePage implements IMenuListener, IPapyrusContentOutlinePage {
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected EditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page's viewer. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ private IEditorSite editorSite;
+
+ public ContentOutline() {
+ super();
+ };
+
+ /**
+ * Constructor.
+ *
+ * @param editorSite
+ * @param editingDomain
+ * @param adapterFactory
+ */
+ public ContentOutline(IEditorSite editorSite, EditingDomain editingDomain, ComposedAdapterFactory adapterFactory) {
+ super();
+ this.editorSite = editorSite;
+ this.editingDomain = editingDomain;
+ this.adapterFactory = adapterFactory;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param editorSite
+ * @param editingDomain
+ * @param adapterFactory
+ */
+ public ContentOutline(IEditorSite editorSite, EditingDomain editingDomain) {
+ super();
+ this.editorSite = editorSite;
+ this.editingDomain = editingDomain;
+ initAdapterFactory();
+ }
+
+ /**
+ * Init the outline. This method is used by the MultiPageEditor to initialize the Outline.
+ *
+ * @param multiEditor
+ * @param site
+ * @throws BackboneException
+ */
+ public void init(IMultiDiagramEditor multiEditor) throws BackboneException {
+
+ // Get the EditorActionBarContributor requested by this particular EMF editor.
+ // The EditorActionBarContributor should be registered in extensions under the specified name
+ // String EditorActionBarContributorId = "DiActionBarContributor";
+ // EditorActionBarContributor actionBarContributor = multiEditor.getActionBarContributorRegistry().getActionBarContributor(EditorActionBarContributorId);
+ // IEditorSite site = new MultiPageAdapterSite(multiEditor.getEditorSite(), actionBarContributor);
+ this.editorSite = multiEditor.getEditorSite();
+ try {
+ this.editingDomain = multiEditor.getServicesRegistry().getService(TransactionalEditingDomain.class);
+ } catch (ServiceException e) {
+ throw new BackboneException("Can't get TransactionalEditingDomain", e);
+ }
+ initAdapterFactory();
+
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if(!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ // initDragAndDrop();
+ }
+
+ /**
+ * Add drag and drop ability between the outline to the editor.
+ */
+ protected void initDragAndDrop() {
+ int ops = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ // Enable Drag
+ OutlineDragAdapter dragAdapter = new OutlineDragAdapter(contentOutlineViewer);
+ contentOutlineViewer.addDragSupport(ops, dragAdapter.getSupportedDragTransfers(), dragAdapter);
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ // contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ if(getActionBarContributor() != null) {
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ private EditingDomainActionBarContributor getActionBarContributor() {
+ if(editorSite.getActionBarContributor() instanceof EditingDomainActionBarContributor) {
+ return (EditingDomainActionBarContributor)editorSite.getActionBarContributor();
+ }
+ return null;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu
+ * for extension. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu = contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getEditorSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[]{ LocalTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus
+ * with contributions from the Edit menu. <!-- begin-user-doc --> <!-- end-user-doc -->
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ */
+ // private EditingDomainActionBarContributor getActionBarContributor() {
+ // return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ // }
+ /**
+ *
+ * @return
+ */
+ private IEditorSite getEditorSite() {
+ return editorSite;
+ }
+
+ /**
+ *
+ */
+ private void initAdapterFactory() {
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ }
+
+}
diff --git a/examples/emf/pom.xml b/examples/emf/pom.xml
new file mode 100644
index 00000000000..d13d00e68f9
--- /dev/null
+++ b/examples/emf/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.examples.emf</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.eclipse.papyrus.outline.emftree</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/pom.xml b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/pom.xml
index 1a474e84ad6..28c27a40959 100644
--- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/pom.xml
+++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.infra</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.example.infra.servicesregistry.retrieval</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.settings/org.eclipse.jdt.core.prefs b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.settings/org.eclipse.jdt.core.prefs
index f287d53cf45..af0f20f97a5 100644
--- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,7 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/plugin.xml b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/plugin.xml
index 855bbcc82b5..8b582792d99 100644
--- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/plugin.xml
+++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/plugin.xml
@@ -1,15 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences.CustomPreferenceInitializer">
- </initializer>
- </extension>
- <extension
- point="org.eclipse.ui.startup">
- <startup></startup>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences.CustomPreferenceInitializer">
+ </initializer>
+ </extension>
+
+</plugin>
diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/pom.xml b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/pom.xml
index e4d3d4c6e5d..11e3caa9a41 100644
--- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/pom.xml
+++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.infra</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/Activator.java b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/Activator.java
index 54bf01264cc..09689bdf479 100644
--- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/Activator.java
+++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/Activator.java
@@ -1,71 +1,70 @@
-/*****************************************************************************
- * Copyright (c) 2013 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences;
-
-import org.eclipse.ui.IStartup;
-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 implements IStartup {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences"; //$NON-NLS-1$
-
- // 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;
- }
-
- @Override
- public void earlyStartup() {
- new CustomPreferenceInitializer().initializeDefaultPreferences();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences;
+
+import org.eclipse.ui.IStartup;
+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 implements IStartup {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences"; //$NON-NLS-1$
+
+ // 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;
+ }
+
+ public void earlyStartup() {
+ new CustomPreferenceInitializer().initializeDefaultPreferences();
+ }
+
+}
diff --git a/examples/infra/pom.xml b/examples/infra/pom.xml
new file mode 100644
index 00000000000..b33eb5ee72f
--- /dev/null
+++ b/examples/infra/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.examples.infra</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <!-- module>org.eclipse.papyrus.example.infra.servicesregistry.retrieval</module-->
+ <module>org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/pom.xml b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/pom.xml
index fa08ff4ef2b..e1ac123cb6f 100644
--- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/pom.xml
+++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.others</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.example.diagram.simplediagram</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/org.eclipse.papyrus.example.text.instance/.classpath b/examples/others/org.eclipse.papyrus.example.text.instance/.classpath
index 45f024e850e..45f024e850e 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/.classpath
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/.classpath
diff --git a/examples/org.eclipse.papyrus.example.text.instance/.project b/examples/others/org.eclipse.papyrus.example.text.instance/.project
index 1f1bbbf348a..1f1bbbf348a 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/.project
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/.project
diff --git a/examples/org.eclipse.papyrus.example.text.instance/META-INF/MANIFEST.MF b/examples/others/org.eclipse.papyrus.example.text.instance/META-INF/MANIFEST.MF
index 118a54ecb88..118a54ecb88 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/META-INF/MANIFEST.MF
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/META-INF/MANIFEST.MF
diff --git a/examples/org.eclipse.papyrus.example.text.instance/about.html b/examples/others/org.eclipse.papyrus.example.text.instance/about.html
index 82d49bf5f81..82d49bf5f81 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/about.html
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/about.html
diff --git a/examples/org.eclipse.papyrus.example.text.instance/build.properties b/examples/others/org.eclipse.papyrus.example.text.instance/build.properties
index 83183307edb..83183307edb 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/build.properties
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/build.properties
diff --git a/examples/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore
index 1efefbcdd3e..1efefbcdd3e 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore
diff --git a/examples/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel
index 02d981047ff..02d981047ff 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel
diff --git a/examples/org.eclipse.papyrus.example.text.instance/plugin.properties b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.properties
index 6cb01adb217..6cb01adb217 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/plugin.properties
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.properties
diff --git a/examples/org.eclipse.papyrus.example.text.instance/plugin.xml b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.xml
index 35c4d727312..35c4d727312 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/plugin.xml
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.xml
diff --git a/examples/org.eclipse.papyrus.example.text.instance/pom.xml b/examples/others/org.eclipse.papyrus.example.text.instance/pom.xml
index 690c1c3dbde..e90eee59933 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/pom.xml
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.others</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.example.text.instance</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrusTextInstance.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrusTextInstance.java
index bfc86b555f1..bfc86b555f1 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrusTextInstance.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrusTextInstance.java
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstanceFactory.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstanceFactory.java
index b63d4820bdc..b63d4820bdc 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstanceFactory.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstanceFactory.java
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstancePackage.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstancePackage.java
index 098e6014f2e..098e6014f2e 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstancePackage.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/PapyrustextinstancePackage.java
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrusTextInstanceImpl.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrusTextInstanceImpl.java
index ac9c90a6d53..ac9c90a6d53 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrusTextInstanceImpl.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrusTextInstanceImpl.java
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstanceFactoryImpl.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstanceFactoryImpl.java
index 109a41b16f6..109a41b16f6 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstanceFactoryImpl.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstanceFactoryImpl.java
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstancePackageImpl.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstancePackageImpl.java
index 88af35e9cfc..88af35e9cfc 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstancePackageImpl.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/impl/PapyrustextinstancePackageImpl.java
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceAdapterFactory.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceAdapterFactory.java
index 43e0df23636..43e0df23636 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceAdapterFactory.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceAdapterFactory.java
diff --git a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceSwitch.java b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceSwitch.java
index 9807eb9bf56..9807eb9bf56 100644
--- a/examples/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceSwitch.java
+++ b/examples/others/org.eclipse.papyrus.example.text.instance/src/org/eclipse/papyrus/example/text/instance/papyrustextinstance/util/PapyrustextinstanceSwitch.java
diff --git a/examples/others/pom.xml b/examples/others/pom.xml
new file mode 100644
index 00000000000..6b8071cc98c
--- /dev/null
+++ b/examples/others/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.examples.others</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <!-- FIXME compilation error <module>org.eclipse.papyrus.example.diagram.simplediagram</module>-->
+ <module>org.eclipse.papyrus.example.text.instance</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/examples/pom.xml b/examples/pom.xml
index dbc6b08ed0f..f303340a35f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -1,30 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
- <groupId>org.eclipse.papyrus</groupId>
- <version>1.0.1-SNAPSHOT</version>
- <relativePath>../releng/top-pom-main.xml</relativePath>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.releng</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../releng/main/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.papyrus.examples</artifactId>
- <groupId>org.eclipse.papyrus</groupId>
+ <name>Papyrus Examples Plugins</name>
<version>1.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
- <module>./core/org.eclipse.papyrus.example.core.lifecycleevents</module>
- <module>./core/org.eclipse.papyrus.example.core.sashwindows.fulleditor</module>
- <module>./core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor</module>
- <!-- FIXME compilation error <module>./others/org.eclipse.papyrus.example.diagram.simplediagram</module> -->
- <module>./infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval</module>
- <module>./org.eclipse.papyrus.example.text.instance</module>
- <module>./org.eclipse.papyrus.example.uml.comment.editor.newresource</module>
- <module>./org.eclipse.papyrus.example.uml.comment.editor.sharedresource</module>
- <module>./infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences</module>
- <module>./emf/org.eclipse.papyrus.outline.emftree</module>
- <module>./uml/org.eclipse.papyrus.thousandcreation</module>
- <module>./uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation</module>
- <module>org.eclipse.papyrus.uml.diagram.emftree</module>
- <!-- <module>../examples/uml/org.eclipse.papyrus.uml.textual.editors.example</module> -->
+ <module>core</module>
+ <module>emf</module>
+ <module>infra</module>
+ <module>others</module>
+ <module>uml</module>
+ <module>user</module>
</modules>
+
+ <profiles>
+ <profile>
+ <id>defaultProfile</id>
+ <repositories>
+ <repository>
+ <id>papyrus-main</id>
+ <layout>p2</layout>
+ <url>${papyrus.repo.main}</url>
+ </repository>
+ <repository>
+ <id>papyrus-extra</id>
+ <layout>p2</layout>
+ <url>${papyrus.repo.extra}</url>
+ </repository>
+ </repositories>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ </profile>
+ </profiles>
</project> \ No newline at end of file
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath
index 2d1a4302f04..2d1a4302f04 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project
index 8a94e000222..8a94e000222 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.settings/org.eclipse.jdt.core.prefs b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.settings/org.eclipse.jdt.core.prefs
index 44217f8c068..44217f8c068 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.settings/org.eclipse.jdt.core.prefs
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/META-INF/MANIFEST.MF b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/META-INF/MANIFEST.MF
index 35871a92f13..35871a92f13 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/META-INF/MANIFEST.MF
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/META-INF/MANIFEST.MF
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html
index 82d49bf5f81..82d49bf5f81 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties
index 274b1327ea1..274b1327ea1 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/icons/texteditorv2.bmp b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/icons/texteditorv2.bmp
index 1376f03a47e..1376f03a47e 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/icons/texteditorv2.bmp
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/icons/texteditorv2.bmp
Binary files differ
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.properties b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.properties
index 0bf1dafb010..0bf1dafb010 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.properties
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.properties
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.xml b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.xml
index 33ccade6695..c0e4f5d6e0d 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.xml
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/plugin.xml
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.infra.core.model">
- <model
- classname="org.eclipse.papyrus.example.uml.comment.editor.newresource.modelresource.TextEditorModelCommentResource">
- </model>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- description="Open a Comment Editor (Comment Resource)"
- id="org.eclipse.papyrus.example.uml.comment.editor.command.newresource"
- name="Open a Comment Editor (Comment Resource)">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.example.uml.comment.editor.newresource.handler.CommentEditorHandler"
- commandId="org.eclipse.papyrus.example.uml.comment.editor.command.newresource">
- <activeWhen>
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </and>
- </activeWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.core.papyrusDiagram">
- <editorDiagram
- factoryClass="org.eclipse.papyrus.example.uml.comment.editor.newresource.factory.CommentEditorFactory"
- icon="icons/texteditorv2.bmp">
- </editorDiagram>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
- <command
- commandId="org.eclipse.papyrus.example.uml.comment.editor.command.newresource"
- icon="icons/texteditorv2.bmp"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.core.model">
+ <model
+ classname="org.eclipse.papyrus.example.uml.comment.editor.newresource.modelresource.TextEditorModelCommentResource">
+ </model>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ description="Open a Comment Editor (Comment Resource)"
+ id="org.eclipse.papyrus.example.uml.comment.editor.command.newresource"
+ name="Open a Comment Editor (Comment Resource)">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.example.uml.comment.editor.newresource.handler.CommentEditorHandler"
+ commandId="org.eclipse.papyrus.example.uml.comment.editor.command.newresource">
+ <activeWhen>
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.ui.papyrusDiagram">
+ <editorDiagram
+ factoryClass="org.eclipse.papyrus.example.uml.comment.editor.newresource.factory.CommentEditorFactory"
+ icon="icons/texteditorv2.bmp">
+ </editorDiagram>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
+ <command
+ commandId="org.eclipse.papyrus.example.uml.comment.editor.command.newresource"
+ icon="icons/texteditorv2.bmp"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+
+</plugin>
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/pom.xml b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/pom.xml
index fd22e468e46..4b1742ab2ba 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/pom.xml
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.example.uml.comment.editor.newresource</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/Activator.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/Activator.java
index 5f975ee9b57..5f975ee9b57 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/Activator.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/Activator.java
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/editor/PapyrusCommentEditor.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/editor/PapyrusCommentEditor.java
index 14d2b3edb7b..f6e6e894653 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/editor/PapyrusCommentEditor.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/editor/PapyrusCommentEditor.java
@@ -1,221 +1,220 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.example.uml.comment.editor.newresource.editor;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.ITextListener;
-import org.eclipse.jface.text.TextEvent;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.example.uml.comment.editor.newresource.Activator;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.uml2.uml.Comment;
-
-public class PapyrusCommentEditor extends TextEditor {
-
- /** the service registry */
- protected final ServicesRegistry registry;
-
- /** the papyrus text instance */
- protected final PapyrusTextInstance papyrusTextInstance;
-
- /** the text listener */
- protected ITextListener listener;
-
- /** the editing domain */
- protected TransactionalEditingDomain domain;
-
- public static final String EDITOR_DEFAULT_NAME = "Comment Editor New Resource";
-
- public static final String EDITOR_TYPE = "CommentEditorNewResource";
-
- /**
- *
- * Constructor.
- *
- * @param registry
- * @param papyrusTextInstance
- */
- public PapyrusCommentEditor(final ServicesRegistry registry, final PapyrusTextInstance papyrusTextInstance) {
- super();
- this.registry = registry;
- this.papyrusTextInstance = papyrusTextInstance;
- try {
- domain = ServiceUtils.getInstance().getTransactionalEditingDomain(registry);
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
- }
-
-
- /**
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jface.text.source.IVerticalRuler, int)
- *
- * @param parent
- * @param ruler
- * @param styles
- * @return
- */
- @Override
- protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
- ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles);
- //we add a listener on the viewer to be notified when the text is edited
- //TODO try to improve, because we execute a command for each character
- listener = new ITextListener() {
-
- //we edit the uml.Comment
- public void textChanged(TextEvent event) {
- String currentText = getSourceViewer().getTextWidget().getText();
- Comment cmt = (Comment)papyrusTextInstance.getEditedObject();
- EStructuralFeature feature = cmt.eClass().getEStructuralFeature("body");
- IElementEditService elementEditService = ElementEditServiceUtils.getCommandProvider(cmt);
- SetRequest request = new SetRequest(domain, cmt, feature, currentText);
- ICommand command = elementEditService.getEditCommand(request);
- if(command.canExecute()) {
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- }
- }
- };
-
- viewer.addTextListener(listener);
-
- return viewer;
- }
-
- /**
- * We override this method because setInput can't be overriden for TextEditor.
- * We replace the default papyrus input by our input for Comment
- *
- * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
- *
- * @param input
- * @throws CoreException
- */
- @Override
- protected void doSetInput(IEditorInput input) throws CoreException {
- String string = ((Comment)papyrusTextInstance.getEditedObject()).getBody();
- if(string == null) {
- string = "";
- }
- IStorage storage = new TextStorage(string);
- super.doSetInput(new TextInput(storage));
- }
-
- /**
- *
- * @see org.eclipse.ui.editors.text.TextEditor#dispose()
- *
- */
- @Override
- public void dispose() {
- //we remove the listener
- getSourceViewer().removeTextListener(listener);
- super.dispose();
- }
-
-
- //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
- class TextStorage implements IStorage {
-
- private String string;
-
- TextStorage(String input) {
- this.string = input;
- }
-
- public InputStream getContents() throws CoreException {
- return new ByteArrayInputStream(string.getBytes());
- }
-
- public IPath getFullPath() {
- return null;
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public String getName() {
- int len = Math.min(5, string.length());
- return string.substring(0, len).concat("..."); //$NON-NLS-1$
- }
-
- public boolean isReadOnly() {
- return false;
- }
- }
-
- //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
- class TextInput implements IStorageEditorInput {
-
- private IStorage storage;
-
- TextInput(IStorage storage) {
- this.storage = storage;
- }
-
- public boolean exists() {
- return true;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public String getName() {
- return storage.getName();
- }
-
- public IPersistableElement getPersistable() {
- return null;
- }
-
- public IStorage getStorage() {
- return storage;
- }
-
- public String getToolTipText() {
- return "String-based file: " + storage.getName();
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.example.uml.comment.editor.newresource.editor;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.ITextListener;
+import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
+import org.eclipse.papyrus.example.uml.comment.editor.newresource.Activator;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.uml2.uml.Comment;
+
+public class PapyrusCommentEditor extends TextEditor {
+
+ /** the service registry */
+ protected final ServicesRegistry registry;
+
+ /** the papyrus text instance */
+ protected final PapyrusTextInstance papyrusTextInstance;
+
+ /** the text listener */
+ protected ITextListener listener;
+
+ /** the editing domain */
+ protected TransactionalEditingDomain domain;
+
+ public static final String EDITOR_DEFAULT_NAME = "Comment Editor New Resource";
+
+ public static final String EDITOR_TYPE = "CommentEditorNewResource";
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param registry
+ * @param papyrusTextInstance
+ */
+ public PapyrusCommentEditor(final ServicesRegistry registry, final PapyrusTextInstance papyrusTextInstance) {
+ super();
+ this.registry = registry;
+ this.papyrusTextInstance = papyrusTextInstance;
+ try {
+ domain = ServiceUtils.getInstance().getTransactionalEditingDomain(registry);
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ }
+ }
+
+
+ /**
+ *
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
+ * org.eclipse.jface.text.source.IVerticalRuler, int)
+ *
+ * @param parent
+ * @param ruler
+ * @param styles
+ * @return
+ */
+ @Override
+ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
+ ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles);
+ //we add a listener on the viewer to be notified when the text is edited
+ //TODO try to improve, because we execute a command for each character
+ listener = new ITextListener() {
+
+ //we edit the uml.Comment
+ public void textChanged(TextEvent event) {
+ String currentText = getSourceViewer().getTextWidget().getText();
+ Comment cmt = (Comment)papyrusTextInstance.getEditedObject();
+ EStructuralFeature feature = cmt.eClass().getEStructuralFeature("body");
+ IElementEditService elementEditService = ElementEditServiceUtils.getCommandProvider(cmt);
+ SetRequest request = new SetRequest(domain, cmt, feature, currentText);
+ ICommand command = elementEditService.getEditCommand(request);
+ if(command.canExecute()) {
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
+ }
+ }
+ };
+
+ viewer.addTextListener(listener);
+
+ return viewer;
+ }
+
+ /**
+ * We override this method because setInput can't be overriden for TextEditor.
+ * We replace the default papyrus input by our input for Comment
+ *
+ * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
+ *
+ * @param input
+ * @throws CoreException
+ */
+ @Override
+ protected void doSetInput(IEditorInput input) throws CoreException {
+ String string = ((Comment)papyrusTextInstance.getEditedObject()).getBody();
+ if(string == null) {
+ string = "";
+ }
+ IStorage storage = new TextStorage(string);
+ super.doSetInput(new TextInput(storage));
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.editors.text.TextEditor#dispose()
+ *
+ */
+ @Override
+ public void dispose() {
+ //we remove the listener
+ getSourceViewer().removeTextListener(listener);
+ super.dispose();
+ }
+
+
+ //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
+ class TextStorage implements IStorage {
+
+ private String string;
+
+ TextStorage(String input) {
+ this.string = input;
+ }
+
+ public InputStream getContents() throws CoreException {
+ return new ByteArrayInputStream(string.getBytes());
+ }
+
+ public IPath getFullPath() {
+ return null;
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public String getName() {
+ int len = Math.min(5, string.length());
+ return string.substring(0, len).concat("..."); //$NON-NLS-1$
+ }
+
+ public boolean isReadOnly() {
+ return false;
+ }
+ }
+
+ //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
+ class TextInput implements IStorageEditorInput {
+
+ private IStorage storage;
+
+ TextInput(IStorage storage) {
+ this.storage = storage;
+ }
+
+ public boolean exists() {
+ return true;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return storage.getName();
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public IStorage getStorage() {
+ return storage;
+ }
+
+ public String getToolTipText() {
+ return "String-based file: " + storage.getName();
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ }
+
+}
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/factory/CommentEditorFactory.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/factory/CommentEditorFactory.java
index aa2c7aca472..251d18c11b7 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/factory/CommentEditorFactory.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/factory/CommentEditorFactory.java
@@ -13,15 +13,13 @@
*****************************************************************************/
package org.eclipse.papyrus.example.uml.comment.editor.newresource.factory;
-import java.lang.reflect.Constructor;
-
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
import org.eclipse.papyrus.example.uml.comment.editor.newresource.Activator;
import org.eclipse.papyrus.example.uml.comment.editor.newresource.editor.PapyrusCommentEditor;
import org.eclipse.papyrus.infra.core.editor.BackboneException;
-import org.eclipse.papyrus.infra.core.extension.diagrameditor.AbstractEditorFactory;
-import org.eclipse.papyrus.infra.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
+import org.eclipse.papyrus.infra.ui.extension.diagrameditor.AbstractEditorFactory;
+import org.eclipse.papyrus.infra.ui.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel;
import org.eclipse.papyrus.infra.core.services.ServiceException;
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/handler/CommentEditorHandler.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/handler/CommentEditorHandler.java
index 52857fd9f45..9c568b671eb 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/handler/CommentEditorHandler.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/handler/CommentEditorHandler.java
@@ -1,177 +1,177 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.example.uml.comment.editor.newresource.handler;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.CheckedOperationHistory;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory;
-import org.eclipse.papyrus.example.uml.comment.editor.newresource.Activator;
-import org.eclipse.papyrus.example.uml.comment.editor.newresource.editor.PapyrusCommentEditor;
-import org.eclipse.papyrus.example.uml.comment.editor.newresource.modelresource.TextEditorModelCommentResource;
-import org.eclipse.papyrus.infra.core.resource.NotFoundException;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Comment;
-
-
-public class CommentEditorHandler extends AbstractHandler {
-
-
- public CommentEditorHandler(){
- }
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
- */
- @Override
- public boolean isEnabled() {
- return getSelection().size() == 1;
- }
-
- /**
- *
- * @return
- * the current selection
- */
- protected List<EObject> getSelection() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- List<EObject> currentSelection = new ArrayList<EObject>();
- Iterator<?> iter = ((IStructuredSelection)selection).iterator();
- while(iter.hasNext()) {
- Object current = iter.next();
- if(current instanceof IAdaptable){
- EObject tmp = (EObject)((IAdaptable)current).getAdapter(EObject.class);
- if(tmp!=null){
- if(tmp instanceof Comment){
- currentSelection.add(tmp);
- }
- }
- }
- }
- return currentSelection;
- }
-
- /**
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
- public Object execute(final ExecutionEvent event) throws ExecutionException {
- try {
-
- runAsTransaction();
- } catch (ServiceException e) {
- throw new ExecutionException("I can't create CompareEditor", e); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Run the command as a transaction.
- * Create a Transaction and delegate the command to {@link #doExecute(ServicesRegistry)}.
- *
- * @throws ServiceException
- *
- */
- public void runAsTransaction() throws ServiceException {
- final ServicesRegistry serviceRegistry = ServiceUtilsForActionHandlers.getInstance().getServiceRegistry();
- TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
-
- //Create the transactional command
- AbstractEMFOperation command = new AbstractEMFOperation(domain, "Create CompareEditor") { //$NON-NLS-1$
-
- @Override
- protected IStatus doExecute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- try {
- CommentEditorHandler.this.doExecute(serviceRegistry);
- } catch (ServiceException e) {
- Activator.log.error(e);
- return Status.CANCEL_STATUS;
- } catch (NotFoundException e) {
- Activator.log.error(e);
- return Status.CANCEL_STATUS;
- }
- return Status.OK_STATUS;
- }
- };
-
- // Execute the command
- try {
- CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- Activator.log.error("I can't create CompareEditor", e); //$NON-NLS-1$
- }
-
- }
-
-
- /**
- * Do the execution of the command.
- *
- * @param serviceRegistry
- * @throws ServiceException
- * @throws NotFoundException
- */
- public void doExecute(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
- Object editorModel = createEditorModel(serviceRegistry);
- // Get the mngr allowing to add/open new editor.
- IPageMngr pageMngr = ServiceUtils.getInstance().getIPageMngr(serviceRegistry);
- // add the new editor model to the sash.
- pageMngr.openPage(editorModel);
-
- }
-
- /**
- * Create a model identifying the editor. This model will be saved with the sash
- *
- * @return
- * @throws ServiceException
- * @throws NotFoundException
- * The model where to save the TableInstance is not found.
- */
- protected Object createEditorModel(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
- PapyrusTextInstance editorModel = PapyrustextinstanceFactory.eINSTANCE.createPapyrusTextInstance();
- editorModel.setEditedObject(getSelection().get(0));
- editorModel.setType(PapyrusCommentEditor.EDITOR_TYPE);
- editorModel.setName(PapyrusCommentEditor.EDITOR_DEFAULT_NAME);
- TextEditorModelCommentResource model = (TextEditorModelCommentResource)ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelCommentResource.MODEL_ID);
- model.addPapyrusTextInstance(editorModel);
- return editorModel;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.example.uml.comment.editor.newresource.handler;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.commands.CheckedOperationHistory;
+import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
+import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory;
+import org.eclipse.papyrus.example.uml.comment.editor.newresource.Activator;
+import org.eclipse.papyrus.example.uml.comment.editor.newresource.editor.PapyrusCommentEditor;
+import org.eclipse.papyrus.example.uml.comment.editor.newresource.modelresource.TextEditorModelCommentResource;
+import org.eclipse.papyrus.infra.core.resource.NotFoundException;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Comment;
+
+
+public class CommentEditorHandler extends AbstractHandler {
+
+
+ public CommentEditorHandler(){
+ }
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ return getSelection().size() == 1;
+ }
+
+ /**
+ *
+ * @return
+ * the current selection
+ */
+ protected List<EObject> getSelection() {
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ List<EObject> currentSelection = new ArrayList<EObject>();
+ Iterator<?> iter = ((IStructuredSelection)selection).iterator();
+ while(iter.hasNext()) {
+ Object current = iter.next();
+ if(current instanceof IAdaptable){
+ EObject tmp = (EObject)((IAdaptable)current).getAdapter(EObject.class);
+ if(tmp!=null){
+ if(tmp instanceof Comment){
+ currentSelection.add(tmp);
+ }
+ }
+ }
+ }
+ return currentSelection;
+ }
+
+ /**
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ try {
+
+ runAsTransaction();
+ } catch (ServiceException e) {
+ throw new ExecutionException("I can't create CompareEditor", e); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ /**
+ * Run the command as a transaction.
+ * Create a Transaction and delegate the command to {@link #doExecute(ServicesRegistry)}.
+ *
+ * @throws ServiceException
+ *
+ */
+ public void runAsTransaction() throws ServiceException {
+ final ServicesRegistry serviceRegistry = ServiceUtilsForActionHandlers.getInstance().getServiceRegistry();
+ TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
+
+ //Create the transactional command
+ AbstractEMFOperation command = new AbstractEMFOperation(domain, "Create CompareEditor") { //$NON-NLS-1$
+
+ @Override
+ protected IStatus doExecute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ try {
+ CommentEditorHandler.this.doExecute(serviceRegistry);
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ return Status.CANCEL_STATUS;
+ } catch (NotFoundException e) {
+ Activator.log.error(e);
+ return Status.CANCEL_STATUS;
+ }
+ return Status.OK_STATUS;
+ }
+ };
+
+ // Execute the command
+ try {
+ CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ Activator.log.error("I can't create CompareEditor", e); //$NON-NLS-1$
+ }
+
+ }
+
+
+ /**
+ * Do the execution of the command.
+ *
+ * @param serviceRegistry
+ * @throws ServiceException
+ * @throws NotFoundException
+ */
+ public void doExecute(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
+ Object editorModel = createEditorModel(serviceRegistry);
+ // Get the mngr allowing to add/open new editor.
+ IPageManager pageMngr = ServiceUtils.getInstance().getIPageManager(serviceRegistry);
+ // add the new editor model to the sash.
+ pageMngr.openPage(editorModel);
+
+ }
+
+ /**
+ * Create a model identifying the editor. This model will be saved with the sash
+ *
+ * @return
+ * @throws ServiceException
+ * @throws NotFoundException
+ * The model where to save the TableInstance is not found.
+ */
+ protected Object createEditorModel(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
+ PapyrusTextInstance editorModel = PapyrustextinstanceFactory.eINSTANCE.createPapyrusTextInstance();
+ editorModel.setEditedObject(getSelection().get(0));
+ editorModel.setType(PapyrusCommentEditor.EDITOR_TYPE);
+ editorModel.setName(PapyrusCommentEditor.EDITOR_DEFAULT_NAME);
+ TextEditorModelCommentResource model = (TextEditorModelCommentResource)ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelCommentResource.MODEL_ID);
+ model.addPapyrusTextInstance(editorModel);
+ return editorModel;
+ }
+}
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/modelresource/TextEditorModelCommentResource.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/modelresource/TextEditorModelCommentResource.java
index 4a20d8eb412..3df157f7cc5 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/modelresource/TextEditorModelCommentResource.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/src/org/eclipse/papyrus/example/uml/comment/editor/newresource/modelresource/TextEditorModelCommentResource.java
@@ -1,89 +1,102 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.example.uml.comment.editor.newresource.modelresource;
-
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.infra.core.resource.AbstractDynamicModel;
-import org.eclipse.papyrus.infra.core.resource.IModel;
-
-
-public class TextEditorModelCommentResource extends AbstractDynamicModel<PapyrusTextInstance> implements IModel {
-
- /**
- * File extension used for comment.
- */
- public static final String COMMENT_FILE_EXTENSION = "comment"; //$NON-NLS-1$
-
- /**
- * Model ID.
- */
- public static final String MODEL_ID = "org.eclipse.papyrus.example.text.TextEditorModelCommentResource"; //$NON-NLS-1$
-
-
- /**
- *
- * Constructor.
- *
- */
- public TextEditorModelCommentResource() {
-
- }
-
-
- /**
- * Get the file extension used for this model.
- *
- * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension()
- *
- * @return
- */
- @Override
- protected String getModelFileExtension() {
- return COMMENT_FILE_EXTENSION;
- }
-
- /**
- * Get the identifier used to register this model.
- *
- * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier()
- *
- * @return
- */
- @Override
- public String getIdentifier() {
- return MODEL_ID;
- }
-
-
- /**
- * Add a new initialized {@link PapyrusEMFCompareInstance} to the model.
- *
- * @param compareInstance
- * The compareInstance to add.
- */
- public void addPapyrusTextInstance(PapyrusTextInstance compareInstance) {
- addModelRoot(compareInstance);
- }
-
- /**
- * Add a new initialized {@link PapyrusEMFCompareInstance} to the model.
- *
- * @param compareInstance
- * The compareInstance to add.
- */
- public void removePapyrusTextInstance(PapyrusTextInstance compareInstance) {
- getResource().getContents().remove(compareInstance);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.example.uml.comment.editor.newresource.modelresource;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
+import org.eclipse.papyrus.infra.core.resource.AbstractDynamicModel;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+
+
+public class TextEditorModelCommentResource extends AbstractDynamicModel<PapyrusTextInstance> implements IModel {
+
+ /**
+ * File extension used for comment.
+ */
+ public static final String COMMENT_FILE_EXTENSION = "comment"; //$NON-NLS-1$
+
+ /**
+ * Model ID.
+ */
+ public static final String MODEL_ID = "org.eclipse.papyrus.example.text.TextEditorModelCommentResource"; //$NON-NLS-1$
+
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public TextEditorModelCommentResource() {
+
+ }
+
+
+ /**
+ * Get the file extension used for this model.
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension()
+ *
+ * @return
+ */
+ @Override
+ protected String getModelFileExtension() {
+ return COMMENT_FILE_EXTENSION;
+ }
+
+ /**
+ * Get the identifier used to register this model.
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier()
+ *
+ * @return
+ */
+ @Override
+ public String getIdentifier() {
+ return MODEL_ID;
+ }
+
+
+ /**
+ * Add a new initialized {@link PapyrusEMFCompareInstance} to the model.
+ *
+ * @param compareInstance
+ * The compareInstance to add.
+ */
+ public void addPapyrusTextInstance(PapyrusTextInstance compareInstance) {
+ addModelRoot(compareInstance);
+ }
+
+ /**
+ * Add a new initialized {@link PapyrusEMFCompareInstance} to the model.
+ *
+ * @param compareInstance
+ * The compareInstance to add.
+ */
+ public void removePapyrusTextInstance(PapyrusTextInstance compareInstance) {
+ getResource().getContents().remove(compareInstance);
+ }
+
+
+ public boolean canPersist(EObject object) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+ public void persist(EObject object) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath
index 2d1a4302f04..2d1a4302f04 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project
index fc3da8cd541..fc3da8cd541 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.settings/org.eclipse.jdt.core.prefs b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.settings/org.eclipse.jdt.core.prefs
index 44217f8c068..44217f8c068 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.settings/org.eclipse.jdt.core.prefs
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/META-INF/MANIFEST.MF b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/META-INF/MANIFEST.MF
index e3c5f28a918..e3c5f28a918 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/META-INF/MANIFEST.MF
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/META-INF/MANIFEST.MF
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html
index 82d49bf5f81..82d49bf5f81 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/build.properties b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/build.properties
index 1bf7b240421..1bf7b240421 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/build.properties
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/build.properties
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/icons/texteditor.bmp b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/icons/texteditor.bmp
index 79df55de06b..79df55de06b 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/icons/texteditor.bmp
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/icons/texteditor.bmp
Binary files differ
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.properties b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.properties
index 239f4eed2c8..239f4eed2c8 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.properties
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.properties
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.xml b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.xml
index cb5d3c3b68e..4595bebec0a 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.xml
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/plugin.xml
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.infra.core.model">
- <model
- classname="org.eclipse.papyrus.example.uml.comment.editor.sharedresource.modelresource.TextEditorModelSharedResource">
- </model>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- description="Open a Comment Editor (Shared Resource)"
- id="org.eclipse.papyrus.example.uml.comment.editor.command.sharedresource"
- name="Open a Comment Editor (Shared Resource)">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.example.uml.comment.editor.sharedresource.handler.CommentEditorHandler"
- commandId="org.eclipse.papyrus.example.uml.comment.editor.command.sharedresource">
- <activeWhen>
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </and>
- </activeWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.core.papyrusDiagram">
- <editorDiagram
- factoryClass="org.eclipse.papyrus.example.uml.comment.editor.sharedresource.factory.CommentEditorFactory"
- icon="icons/texteditor.bmp">
- </editorDiagram>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
- <command
- commandId="org.eclipse.papyrus.example.uml.comment.editor.command.sharedresource"
- icon="icons/texteditor.bmp"
- style="push">
- <visibleWhen
- checkEnabled="false">
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.core.model">
+ <model
+ classname="org.eclipse.papyrus.example.uml.comment.editor.sharedresource.modelresource.TextEditorModelSharedResource">
+ </model>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ description="Open a Comment Editor (Shared Resource)"
+ id="org.eclipse.papyrus.example.uml.comment.editor.command.sharedresource"
+ name="Open a Comment Editor (Shared Resource)">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.example.uml.comment.editor.sharedresource.handler.CommentEditorHandler"
+ commandId="org.eclipse.papyrus.example.uml.comment.editor.command.sharedresource">
+ <activeWhen>
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.papyrus.infra.ui.papyrusDiagram">
+ <editorDiagram
+ factoryClass="org.eclipse.papyrus.example.uml.comment.editor.sharedresource.factory.CommentEditorFactory"
+ icon="icons/texteditor.bmp">
+ </editorDiagram>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
+ <command
+ commandId="org.eclipse.papyrus.example.uml.comment.editor.command.sharedresource"
+ icon="icons/texteditor.bmp"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+
+</plugin>
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/pom.xml b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/pom.xml
index 3d2f7669f84..e3c1fa27640 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/pom.xml
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.example.uml.comment.editor.sharedresource</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/Activator.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/Activator.java
index 0195681d372..0195681d372 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/Activator.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/Activator.java
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/editor/PapyrusCommentEditor.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/editor/PapyrusCommentEditor.java
index 02bc18d994d..90faad4d747 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/editor/PapyrusCommentEditor.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/editor/PapyrusCommentEditor.java
@@ -1,221 +1,221 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.example.uml.comment.editor.sharedresource.editor;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.ITextListener;
-import org.eclipse.jface.text.TextEvent;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.Activator;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.editors.text.TextEditor;
-import org.eclipse.uml2.uml.Comment;
-
-public class PapyrusCommentEditor extends TextEditor {
-
- /** the service registry */
- protected final ServicesRegistry registry;
-
- /** the papyrus text instance */
- protected final PapyrusTextInstance papyrusTextInstance;
-
- /** the text listener */
- protected ITextListener listener;
-
- /** the editing domain */
- protected TransactionalEditingDomain domain;
-
- public static final String EDITOR_DEFAULT_NAME = "Comment Editor Shared Resource";
-
- public static final String EDITOR_TYPE = "CommentEditorSharedResource";
-
- /**
- *
- * Constructor.
- *
- * @param registry
- * @param papyrusTextInstance
- */
- public PapyrusCommentEditor(final ServicesRegistry registry, final PapyrusTextInstance papyrusTextInstance) {
- super();
- this.registry = registry;
- this.papyrusTextInstance = papyrusTextInstance;
- try {
- domain = ServiceUtils.getInstance().getTransactionalEditingDomain(registry);
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
- }
-
-
- /**
- *
- * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
- * org.eclipse.jface.text.source.IVerticalRuler, int)
- *
- * @param parent
- * @param ruler
- * @param styles
- * @return
- */
- @Override
- protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
- ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles);
- //we add a listener on the viewer to be notified when the text is edited
- //TODO try to improve, because we execute a command for each character
- listener = new ITextListener() {
-
- //we edit the uml.Comment
- public void textChanged(TextEvent event) {
- String currentText = getSourceViewer().getTextWidget().getText();
- Comment cmt = (Comment)papyrusTextInstance.getEditedObject();
- EStructuralFeature feature = cmt.eClass().getEStructuralFeature("body");
- IElementEditService elementEditService = ElementEditServiceUtils.getCommandProvider(cmt);
- SetRequest request = new SetRequest(domain, cmt, feature, currentText);
- ICommand command = elementEditService.getEditCommand(request);
- if(command.canExecute()) {
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- }
- }
- };
-
- viewer.addTextListener(listener);
-
- return viewer;
- }
-
- /**
- * We override this method because setInput can't be overriden for TextEditor.
- * We replace the default papyrus input by our input for Comment
- *
- * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
- *
- * @param input
- * @throws CoreException
- */
- @Override
- protected void doSetInput(IEditorInput input) throws CoreException {
- String string = ((Comment)papyrusTextInstance.getEditedObject()).getBody();
- if(string == null) {
- string = "";
- }
- IStorage storage = new TextStorage(string);
- super.doSetInput(new TextInput(storage));
- }
-
- /**
- *
- * @see org.eclipse.ui.editors.text.TextEditor#dispose()
- *
- */
- @Override
- public void dispose() {
- //we remove the listener
- getSourceViewer().removeTextListener(listener);
- super.dispose();
- }
-
-
- //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
- class TextStorage implements IStorage {
-
- private String string;
-
- TextStorage(String input) {
- this.string = input;
- }
-
- public InputStream getContents() throws CoreException {
- return new ByteArrayInputStream(string.getBytes());
- }
-
- public IPath getFullPath() {
- return null;
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public String getName() {
- int len = Math.min(5, string.length());
- return string.substring(0, len).concat("..."); //$NON-NLS-1$
- }
-
- public boolean isReadOnly() {
- return false;
- }
- }
-
- //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
- class TextInput implements IStorageEditorInput {
-
- private IStorage storage;
-
- TextInput(IStorage storage) {
- this.storage = storage;
- }
-
- public boolean exists() {
- return true;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public String getName() {
- return storage.getName();
- }
-
- public IPersistableElement getPersistable() {
- return null;
- }
-
- public IStorage getStorage() {
- return storage;
- }
-
- public String getToolTipText() {
- return "String-based file: " + storage.getName();
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.example.uml.comment.editor.sharedresource.editor;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.ITextListener;
+import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
+import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.Activator;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.uml2.uml.Comment;
+
+public class PapyrusCommentEditor extends TextEditor {
+
+ /** the service registry */
+ protected final ServicesRegistry registry;
+
+ /** the papyrus text instance */
+ protected final PapyrusTextInstance papyrusTextInstance;
+
+ /** the text listener */
+ protected ITextListener listener;
+
+ /** the editing domain */
+ protected TransactionalEditingDomain domain;
+
+ public static final String EDITOR_DEFAULT_NAME = "Comment Editor Shared Resource";
+
+ public static final String EDITOR_TYPE = "CommentEditorSharedResource";
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param registry
+ * @param papyrusTextInstance
+ */
+ public PapyrusCommentEditor(final ServicesRegistry registry, final PapyrusTextInstance papyrusTextInstance) {
+ super();
+ this.registry = registry;
+ this.papyrusTextInstance = papyrusTextInstance;
+ try {
+ domain = ServiceUtils.getInstance().getTransactionalEditingDomain(registry);
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ }
+ }
+
+
+ /**
+ *
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
+ * org.eclipse.jface.text.source.IVerticalRuler, int)
+ *
+ * @param parent
+ * @param ruler
+ * @param styles
+ * @return
+ */
+ @Override
+ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
+ ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles);
+ //we add a listener on the viewer to be notified when the text is edited
+ //TODO try to improve, because we execute a command for each character
+ listener = new ITextListener() {
+
+ //we edit the uml.Comment
+ public void textChanged(TextEvent event) {
+ String currentText = getSourceViewer().getTextWidget().getText();
+ Comment cmt = (Comment)papyrusTextInstance.getEditedObject();
+ EStructuralFeature feature = cmt.eClass().getEStructuralFeature("body");
+ IElementEditService elementEditService = ElementEditServiceUtils.getCommandProvider(cmt);
+ SetRequest request = new SetRequest(domain, cmt, feature, currentText);
+ ICommand command = elementEditService.getEditCommand(request);
+ if(command.canExecute()) {
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
+ }
+ }
+ };
+
+ viewer.addTextListener(listener);
+
+ return viewer;
+ }
+
+ /**
+ * We override this method because setInput can't be overriden for TextEditor.
+ * We replace the default papyrus input by our input for Comment
+ *
+ * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
+ *
+ * @param input
+ * @throws CoreException
+ */
+ @Override
+ protected void doSetInput(IEditorInput input) throws CoreException {
+ String string = ((Comment)papyrusTextInstance.getEditedObject()).getBody();
+ if(string == null) {
+ string = "";
+ }
+ IStorage storage = new TextStorage(string);
+ super.doSetInput(new TextInput(storage));
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.editors.text.TextEditor#dispose()
+ *
+ */
+ @Override
+ public void dispose() {
+ //we remove the listener
+ getSourceViewer().removeTextListener(listener);
+ super.dispose();
+ }
+
+
+ //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
+ class TextStorage implements IStorage {
+
+ private String string;
+
+ TextStorage(String input) {
+ this.string = input;
+ }
+
+ public InputStream getContents() throws CoreException {
+ return new ByteArrayInputStream(string.getBytes());
+ }
+
+ public IPath getFullPath() {
+ return null;
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public String getName() {
+ int len = Math.min(5, string.length());
+ return string.substring(0, len).concat("..."); //$NON-NLS-1$
+ }
+
+ public boolean isReadOnly() {
+ return false;
+ }
+ }
+
+ //for this classes , see : http://wiki.eclipse.org/FAQ_How_do_I_open_an_editor_on_something_that_is_not_a_file%3F
+ class TextInput implements IStorageEditorInput {
+
+ private IStorage storage;
+
+ TextInput(IStorage storage) {
+ this.storage = storage;
+ }
+
+ public boolean exists() {
+ return true;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return storage.getName();
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public IStorage getStorage() {
+ return storage;
+ }
+
+ public String getToolTipText() {
+ return "String-based file: " + storage.getName();
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ }
+
+}
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/factory/CommentEditorFactory.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/factory/CommentEditorFactory.java
index 4dffd8c8c12..bce2f93e84e 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/factory/CommentEditorFactory.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/factory/CommentEditorFactory.java
@@ -18,8 +18,8 @@ import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusText
import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.Activator;
import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.editor.PapyrusCommentEditor;
import org.eclipse.papyrus.infra.core.editor.BackboneException;
-import org.eclipse.papyrus.infra.core.extension.diagrameditor.AbstractEditorFactory;
-import org.eclipse.papyrus.infra.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
+import org.eclipse.papyrus.infra.ui.extension.diagrameditor.AbstractEditorFactory;
+import org.eclipse.papyrus.infra.ui.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel;
import org.eclipse.papyrus.infra.core.services.ServiceException;
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/handler/CommentEditorHandler.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/handler/CommentEditorHandler.java
index c557a58933c..b34859ca5eb 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/handler/CommentEditorHandler.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/handler/CommentEditorHandler.java
@@ -1,177 +1,177 @@
-/*****************************************************************************
- * Copyright (c) 2012 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:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.example.uml.comment.editor.sharedresource.handler;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.CheckedOperationHistory;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory;
-import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.Activator;
-import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.editor.PapyrusCommentEditor;
-import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.modelresource.TextEditorModelSharedResource;
-import org.eclipse.papyrus.infra.core.resource.NotFoundException;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Comment;
-
-
-public class CommentEditorHandler extends AbstractHandler {
-
-
- public CommentEditorHandler(){
- }
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
- */
- @Override
- public boolean isEnabled() {
- return getSelection().size() == 1;
- }
-
- /**
- *
- * @return
- * the current selection
- */
- protected List<EObject> getSelection() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- List<EObject> currentSelection = new ArrayList<EObject>();
- Iterator<?> iter = ((IStructuredSelection)selection).iterator();
- while(iter.hasNext()) {
- Object current = iter.next();
- if(current instanceof IAdaptable){
- EObject tmp = (EObject)((IAdaptable)current).getAdapter(EObject.class);
- if(tmp!=null){
- if(tmp instanceof Comment){
- currentSelection.add(tmp);
- }
- }
- }
- }
- return currentSelection;
- }
-
- /**
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
- public Object execute(final ExecutionEvent event) throws ExecutionException {
- try {
-
- runAsTransaction();
- } catch (ServiceException e) {
- throw new ExecutionException("I can't create CompareEditor", e); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Run the command as a transaction.
- * Create a Transaction and delegate the command to {@link #doExecute(ServicesRegistry)}.
- *
- * @throws ServiceException
- *
- */
- public void runAsTransaction() throws ServiceException {
- final ServicesRegistry serviceRegistry = ServiceUtilsForActionHandlers.getInstance().getServiceRegistry();
- TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
-
- //Create the transactional command
- AbstractEMFOperation command = new AbstractEMFOperation(domain, "Create CompareEditor") { //$NON-NLS-1$
-
- @Override
- protected IStatus doExecute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
- try {
- CommentEditorHandler.this.doExecute(serviceRegistry);
- } catch (ServiceException e) {
- Activator.log.error(e);
- return Status.CANCEL_STATUS;
- } catch (NotFoundException e) {
- Activator.log.error(e);
- return Status.CANCEL_STATUS;
- }
- return Status.OK_STATUS;
- }
- };
-
- // Execute the command
- try {
- CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- Activator.log.error("I can't create CompareEditor", e); //$NON-NLS-1$
- }
-
- }
-
-
- /**
- * Do the execution of the command.
- *
- * @param serviceRegistry
- * @throws ServiceException
- * @throws NotFoundException
- */
- public void doExecute(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
- Object editorModel = createEditorModel(serviceRegistry);
- // Get the mngr allowing to add/open new editor.
- IPageMngr pageMngr = ServiceUtils.getInstance().getIPageMngr(serviceRegistry);
- // add the new editor model to the sash.
- pageMngr.openPage(editorModel);
-
- }
-
- /**
- * Create a model identifying the editor. This model will be saved with the sash
- *
- * @return
- * @throws ServiceException
- * @throws NotFoundException
- * The model where to save the TableInstance is not found.
- */
- protected Object createEditorModel(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
- PapyrusTextInstance editorModel = PapyrustextinstanceFactory.eINSTANCE.createPapyrusTextInstance();
- editorModel.setEditedObject(getSelection().get(0));
- editorModel.setType(PapyrusCommentEditor.EDITOR_TYPE);
- editorModel.setName(PapyrusCommentEditor.EDITOR_DEFAULT_NAME);
- TextEditorModelSharedResource model = (TextEditorModelSharedResource)ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID);
- model.addPapyrusTextInstance(editorModel);
- return editorModel;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.example.uml.comment.editor.sharedresource.handler;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.commands.CheckedOperationHistory;
+import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
+import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory;
+import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.Activator;
+import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.editor.PapyrusCommentEditor;
+import org.eclipse.papyrus.example.uml.comment.editor.sharedresource.modelresource.TextEditorModelSharedResource;
+import org.eclipse.papyrus.infra.core.resource.NotFoundException;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForActionHandlers;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Comment;
+
+
+public class CommentEditorHandler extends AbstractHandler {
+
+
+ public CommentEditorHandler(){
+ }
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ return getSelection().size() == 1;
+ }
+
+ /**
+ *
+ * @return
+ * the current selection
+ */
+ protected List<EObject> getSelection() {
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ List<EObject> currentSelection = new ArrayList<EObject>();
+ Iterator<?> iter = ((IStructuredSelection)selection).iterator();
+ while(iter.hasNext()) {
+ Object current = iter.next();
+ if(current instanceof IAdaptable){
+ EObject tmp = (EObject)((IAdaptable)current).getAdapter(EObject.class);
+ if(tmp!=null){
+ if(tmp instanceof Comment){
+ currentSelection.add(tmp);
+ }
+ }
+ }
+ }
+ return currentSelection;
+ }
+
+ /**
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ try {
+
+ runAsTransaction();
+ } catch (ServiceException e) {
+ throw new ExecutionException("I can't create CompareEditor", e); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ /**
+ * Run the command as a transaction.
+ * Create a Transaction and delegate the command to {@link #doExecute(ServicesRegistry)}.
+ *
+ * @throws ServiceException
+ *
+ */
+ public void runAsTransaction() throws ServiceException {
+ final ServicesRegistry serviceRegistry = ServiceUtilsForActionHandlers.getInstance().getServiceRegistry();
+ TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
+
+ //Create the transactional command
+ AbstractEMFOperation command = new AbstractEMFOperation(domain, "Create CompareEditor") { //$NON-NLS-1$
+
+ @Override
+ protected IStatus doExecute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ try {
+ CommentEditorHandler.this.doExecute(serviceRegistry);
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ return Status.CANCEL_STATUS;
+ } catch (NotFoundException e) {
+ Activator.log.error(e);
+ return Status.CANCEL_STATUS;
+ }
+ return Status.OK_STATUS;
+ }
+ };
+
+ // Execute the command
+ try {
+ CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ Activator.log.error("I can't create CompareEditor", e); //$NON-NLS-1$
+ }
+
+ }
+
+
+ /**
+ * Do the execution of the command.
+ *
+ * @param serviceRegistry
+ * @throws ServiceException
+ * @throws NotFoundException
+ */
+ public void doExecute(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
+ Object editorModel = createEditorModel(serviceRegistry);
+ // Get the mngr allowing to add/open new editor.
+ IPageManager pageMngr = ServiceUtils.getInstance().getIPageManager(serviceRegistry);
+ // add the new editor model to the sash.
+ pageMngr.openPage(editorModel);
+
+ }
+
+ /**
+ * Create a model identifying the editor. This model will be saved with the sash
+ *
+ * @return
+ * @throws ServiceException
+ * @throws NotFoundException
+ * The model where to save the TableInstance is not found.
+ */
+ protected Object createEditorModel(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
+ PapyrusTextInstance editorModel = PapyrustextinstanceFactory.eINSTANCE.createPapyrusTextInstance();
+ editorModel.setEditedObject(getSelection().get(0));
+ editorModel.setType(PapyrusCommentEditor.EDITOR_TYPE);
+ editorModel.setName(PapyrusCommentEditor.EDITOR_DEFAULT_NAME);
+ TextEditorModelSharedResource model = (TextEditorModelSharedResource)ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID);
+ model.addPapyrusTextInstance(editorModel);
+ return editorModel;
+ }
+}
diff --git a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/modelresource/TextEditorModelSharedResource.java b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/modelresource/TextEditorModelSharedResource.java
index 608e4b0e868..608e4b0e868 100644
--- a/examples/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/modelresource/TextEditorModelSharedResource.java
+++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/src/org/eclipse/papyrus/example/uml/comment/editor/sharedresource/modelresource/TextEditorModelSharedResource.java
diff --git a/examples/uml/org.eclipse.papyrus.thousandcreation/pom.xml b/examples/uml/org.eclipse.papyrus.thousandcreation/pom.xml
index 2a8ce92c66e..f4f7262ecd8 100644
--- a/examples/uml/org.eclipse.papyrus.thousandcreation/pom.xml
+++ b/examples/uml/org.eclipse.papyrus.thousandcreation/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.thousandcreation</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/uml/org.eclipse.papyrus.thousandcreation/test/thousandcreation/HugeModelGenerationAction.java b/examples/uml/org.eclipse.papyrus.thousandcreation/test/thousandcreation/HugeModelGenerationAction.java
index 5c348eea1e1..3f0fefe7d47 100644
--- a/examples/uml/org.eclipse.papyrus.thousandcreation/test/thousandcreation/HugeModelGenerationAction.java
+++ b/examples/uml/org.eclipse.papyrus.thousandcreation/test/thousandcreation/HugeModelGenerationAction.java
@@ -1,102 +1,102 @@
-/*****************************************************************************
- * Copyright (c) 2010 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 thousandcreation;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.uml2.uml.Package;
-
-
-public class HugeModelGenerationAction implements IActionDelegate {
-
- protected Package selectedPackage;
- protected final static int packageNumber=200;
- protected final static int classNumber=1000;
- protected final static String chars = "abcdefghijklmnopqrstuvwxyz";
- protected final static String mchars="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- public HugeModelGenerationAction() {
- // TODO Auto-generated constructor stub
- }
-
-/**
- * generate a string
- * @param length the length of the string
- * @return a string
- */
- public static String generateName(int length)
- {
-
- String pass = "";
- for(int i=0;i<length;i++)
- {
- if( i==0){
- int integer = (int)Math.floor(Math.random() * 26);
- pass += mchars.charAt(integer);
- }
- else{
- int integer = (int)Math.floor(Math.random() * 26);
- pass += chars.charAt(integer);
- }
- }
- return pass;
- }
-
-
- public void run(IAction action) {
- TransactionalEditingDomain editingDomain = EditorUtils
- .getTransactionalEditingDomain();
- if (editingDomain != null && selectedPackage!=null) {
- Command command = new RecordingCommand(editingDomain) {
-
- @Override
- protected void doExecute() {
- for(int i=0; i<packageNumber;i++){
- //create packages
- Package currentPackage=selectedPackage.createNestedPackage(generateName(10));
- for( int j=0; j<classNumber;j++){
- //create classes
- currentPackage.createOwnedClass(generateName(10), false);
- }
- System.out.println("package "+i +"/"+packageNumber+" done.");
- }
- }
- };
- editingDomain.getCommandStack().execute(command);
- }
-
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- if (selection instanceof IStructuredSelection){
- if( ((IStructuredSelection)selection).getFirstElement() instanceof IAdaptable){
- EObject eObject=(EObject)((IAdaptable)((IStructuredSelection)selection).getFirstElement()).getAdapter(EObject.class);
- if( eObject instanceof Package){
- selectedPackage=(org.eclipse.uml2.uml.Package)eObject;
- }
- }
-
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 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 thousandcreation;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.ui.util.EditorUtils;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.uml2.uml.Package;
+
+
+public class HugeModelGenerationAction implements IActionDelegate {
+
+ protected Package selectedPackage;
+ protected final static int packageNumber=200;
+ protected final static int classNumber=1000;
+ protected final static String chars = "abcdefghijklmnopqrstuvwxyz";
+ protected final static String mchars="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ public HugeModelGenerationAction() {
+ // TODO Auto-generated constructor stub
+ }
+
+/**
+ * generate a string
+ * @param length the length of the string
+ * @return a string
+ */
+ public static String generateName(int length)
+ {
+
+ String pass = "";
+ for(int i=0;i<length;i++)
+ {
+ if( i==0){
+ int integer = (int)Math.floor(Math.random() * 26);
+ pass += mchars.charAt(integer);
+ }
+ else{
+ int integer = (int)Math.floor(Math.random() * 26);
+ pass += chars.charAt(integer);
+ }
+ }
+ return pass;
+ }
+
+
+ public void run(IAction action) {
+ TransactionalEditingDomain editingDomain = EditorUtils
+ .getTransactionalEditingDomain();
+ if (editingDomain != null && selectedPackage!=null) {
+ Command command = new RecordingCommand(editingDomain) {
+
+ @Override
+ protected void doExecute() {
+ for(int i=0; i<packageNumber;i++){
+ //create packages
+ Package currentPackage=selectedPackage.createNestedPackage(generateName(10));
+ for( int j=0; j<classNumber;j++){
+ //create classes
+ currentPackage.createOwnedClass(generateName(10), false);
+ }
+ System.out.println("package "+i +"/"+packageNumber+" done.");
+ }
+ }
+ };
+ editingDomain.getCommandStack().execute(command);
+ }
+
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if (selection instanceof IStructuredSelection){
+ if( ((IStructuredSelection)selection).getFirstElement() instanceof IAdaptable){
+ EObject eObject=(EObject)((IAdaptable)((IStructuredSelection)selection).getFirstElement()).getAdapter(EObject.class);
+ if( eObject instanceof Package){
+ selectedPackage=(org.eclipse.uml2.uml.Package)eObject;
+ }
+ }
+
+ }
+
+ }
+
+}
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/.classpath b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.classpath
index 2d1a4302f04..2d1a4302f04 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/.classpath
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.classpath
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/.project b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.project
index 515b3812d81..515b3812d81 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/.project
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.project
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.core.prefs b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..4759947300a 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.core.prefs
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.ui.prefs b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.ui.prefs
index 954281dbc31..954281dbc31 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.ui.prefs
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.jdt.ui.prefs
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.pde.api.tools.prefs b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.pde.api.tools.prefs
index 23fb95e120f..23fb95e120f 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.pde.api.tools.prefs
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.settings/org.eclipse.pde.api.tools.prefs
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF
index 1a079fe90ef..d331539e3e0 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.emftree
Require-Bundle: org.eclipse.uml2.uml.editor;bundle-version="[5.2.0,6.0.0)";visibility:=reexport,
org.eclipse.gmf.runtime.notation;bundle-version="[1.8.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.emf.diagram.common;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.ui;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.core.sasheditor
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/about.html b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/about.html
index 82d49bf5f81..82d49bf5f81 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/about.html
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/about.html
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/build.properties b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/build.properties
index 87464c141b5..87464c141b5 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/build.properties
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/build.properties
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/icons/EmfTree.gif b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/icons/EmfTree.gif
index d07712589ae..d07712589ae 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/icons/EmfTree.gif
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/icons/EmfTree.gif
Binary files differ
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties
index 906e7b71ec0..906e7b71ec0 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml
index 1a42a4f00f2..1a42a4f00f2 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/pom.xml b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/pom.xml
index b65813a9748..1cc885d3352 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/pom.xml
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/pom.xml
@@ -2,9 +2,9 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.eclipse.papyrus</groupId>
- <artifactId>org.eclipse.papyrus.examples</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.diagram.emftree</artifactId>
<version>1.2.0-SNAPSHOT</version>
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/Activator.java b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/Activator.java
index 699b363b9a4..699b363b9a4 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/Activator.java
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/Activator.java
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/CreateEMFTreeDiagramHandler.java b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/CreateEMFTreeDiagramHandler.java
index 7594893fe91..7594893fe91 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/CreateEMFTreeDiagramHandler.java
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/CreateEMFTreeDiagramHandler.java
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/EmfTreeDiagramEditorFactory.java b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/EmfTreeDiagramEditorFactory.java
index ed4e8ae6085..ed4e8ae6085 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/EmfTreeDiagramEditorFactory.java
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/EmfTreeDiagramEditorFactory.java
diff --git a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/UMLEditor.java b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/UMLEditor.java
index 9e4d085a03d..9e4d085a03d 100644
--- a/examples/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/UMLEditor.java
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/src/org/eclipse/papyrus/uml/diagram/emftree/UMLEditor.java
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF
index a0685ac1aba..0656075699f 100644
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/META-INF/MANIFEST.MF
@@ -7,6 +7,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.emf.ecore;bundle-version="2.9.0",
org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.ui,
org.eclipse.papyrus.uml.diagram.composite;bundle-version="1.1.0",
org.eclipse.papyrus.uml.diagram.sequence;bundle-version="1.1.0",
org.eclipse.uml2.uml;bundle-version="4.1.0",
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml
index d774667f25b..1bde7c09627 100644
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.papyrus</groupId>
<artifactId>org.eclipse.papyrus.uml.diagram.example.programmaticcreation</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java
index 5beaccdd388..61fad175c9c 100644
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateCompositeDiagramElementsCommand.java
@@ -26,7 +26,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers;
+import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForHandlers;
import org.eclipse.papyrus.uml.diagram.composite.providers.UMLViewProvider;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.uml2.uml.Class;
@@ -52,9 +52,9 @@ public class CreateCompositeDiagramElementsCommand extends AbstractEMFOperation
protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- try {
- ISashWindowsContainer windowsContainer =
- ServiceUtilsForHandlers.getInstance().getISashWindowsContainer(m_event);
+
+ ISashWindowsContainer windowsContainer = null;
+ //ServiceUtilsForHandlers.getInstance().getISashWindowsContainer(m_event);
Object model = windowsContainer.getActiveSashWindowsPage().getRawModel();
if(model instanceof PageRef) {
EObject diagramEObj = ((PageRef)model).getEmfPageIdentifier();
@@ -73,10 +73,7 @@ public class CreateCompositeDiagramElementsCommand extends AbstractEMFOperation
addCuToCompositeDiagram((Class) m_context, (Class) m_context, cu, view, diagram);
}
}
- }
- catch (ServiceException svcE) {
- System.err.println(svcE.toString());
- }
+
return Status.OK_STATUS;
}
@@ -84,7 +81,7 @@ public class CreateCompositeDiagramElementsCommand extends AbstractEMFOperation
{
// add CU to compartment
Object compartment = view.getChildren().get(1);
- View roleBindingView = compViewProvider.createCollaborationUse_3071(cu, (BasicCompartment)compartment, -1, true,
+ View roleBindingView = compViewProvider.createCollaborationUse_Shape(cu, (BasicCompartment)compartment, -1, true,
UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
Location location = NotationFactory.eINSTANCE.createLocation();
location.setX(50);
diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java
index 9880ef8edc6..dfc4263ecef 100644
--- a/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java
+++ b/examples/uml/org.eclipse.papyrus.uml.diagram.example.programmaticcreation/src/org/eclipse/papyrus/uml/diagram/example/programmaticcreation/CreateSequenceDiagramElementsCommand.java
@@ -31,7 +31,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers;
+import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForHandlers;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLVisualIDRegistry;
import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLViewProvider;
@@ -61,9 +61,9 @@ public class CreateSequenceDiagramElementsCommand extends AbstractEMFOperation {
protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
- try {
- ISashWindowsContainer windowsContainer =
- ServiceUtilsForHandlers.getInstance().getISashWindowsContainer(m_event);
+ //try {
+ ISashWindowsContainer windowsContainer = null;
+ //ServiceUtilsForHandlers.getInstance().getISashWindowsContainer(m_event);
Object model = windowsContainer.getActiveSashWindowsPage().getRawModel();
if(model instanceof PageRef) {
EObject diagramEObj = ((PageRef)model).getEmfPageIdentifier();
@@ -109,10 +109,10 @@ public class CreateSequenceDiagramElementsCommand extends AbstractEMFOperation {
addMessage(message, diagram, lifelineV1, lifelineV2);
}
}
- }
+ /*}
catch (ServiceException svcE) {
System.err.println(svcE.toString());
- }
+ }*/
return Status.OK_STATUS;
}
@@ -158,7 +158,7 @@ public class CreateSequenceDiagramElementsCommand extends AbstractEMFOperation {
{
// get first compartment of view
Object compartment = interactionView.getChildren().get(1);
- Node lifelineView = sequenceDiagViewProvider.createDurationConstraint_3021(durationContraint, (View) compartment, -1, true,
+ Node lifelineView = sequenceDiagViewProvider.createDurationConstraint_Shape(durationContraint, (View) compartment, -1, true,
UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
Bounds location = NotationFactory.eINSTANCE.createBounds();
location.setX(x);
@@ -178,7 +178,7 @@ public class CreateSequenceDiagramElementsCommand extends AbstractEMFOperation {
*/
public void addMessage(Message message, Diagram diagram, View lifelineSrcV, View lifelineDstV)
{
- View messageView = sequenceDiagViewProvider.createMessage_4004(message, diagram, -1, true,
+ View messageView = sequenceDiagViewProvider.createMessage_AsynchEdge(message, diagram, -1, true,
UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
if(messageView instanceof Edge) {
Edge messageEdge = (Edge) messageView;
diff --git a/examples/uml/org.eclipse.papyrus.uml.textual.editors.example/pom.xml b/examples/uml/org.eclipse.papyrus.uml.textual.editors.example/pom.xml
index cf605599461..0160e8208af 100644
--- a/examples/uml/org.eclipse.papyrus.uml.textual.editors.example/pom.xml
+++ b/examples/uml/org.eclipse.papyrus.uml.textual.editors.example/pom.xml
@@ -2,13 +2,12 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>org.eclipse.papyrus</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../../../releng/top-pom-main.xml</relativePath>
+ <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.textual.editors.example</artifactId>
<groupId>org.eclipse.papyrus</groupId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/examples/uml/pom.xml b/examples/uml/pom.xml
new file mode 100644
index 00000000000..3c40b40dd88
--- /dev/null
+++ b/examples/uml/pom.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.examples.uml</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.eclipse.papyrus.example.uml.comment.editor.newresource</module>
+ <module>org.eclipse.papyrus.example.uml.comment.editor.sharedresource</module>
+ <module>org.eclipse.papyrus.uml.diagram.emftree</module>
+ <module>org.eclipse.papyrus.thousandcreation</module>
+ <module>org.eclipse.papyrus.uml.diagram.example.programmaticcreation</module>
+ <!-- module>org.eclipse.papyrus.uml.textual.editors.example</module-->
+ </modules>
+</project> \ No newline at end of file
diff --git a/examples/user/pom.xml b/examples/user/pom.xml
new file mode 100644
index 00000000000..7038253844f
--- /dev/null
+++ b/examples/user/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.examples.user</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <!-- non maven project module>org.eclipse.papyrus.examples.user.QVToExamples</module-->
+ <module>referencediagrams</module>
+ </modules>
+</project> \ No newline at end of file
diff --git a/examples/user/referencediagrams/pom.xml b/examples/user/referencediagrams/pom.xml
new file mode 100644
index 00000000000..69153ba5199
--- /dev/null
+++ b/examples/user/referencediagrams/pom.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.papyrus</groupId>
+ <artifactId>org.eclipse.papyrus.examples.user</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.examples.user.referencediagrams</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <!-- module>org.eclipse.papyrus.examples.user.referencediagrams.ClassDiagramTestEditor</module>
+ <module>org.eclipse.papyrus.examples.user.referencediagrams.TC1</module>
+ <module>org.eclipse.papyrus.examples.user.referencediagrams.UseCaseTestEditor</module-->
+ </modules>
+</project> \ No newline at end of file

Back to the top