diff options
author | Quentin Le Menez | 2018-01-09 10:09:46 +0000 |
---|---|---|
committer | Quentin Le Menez | 2018-01-09 13:18:15 +0000 |
commit | d98116b5b376f18b6cf626ba4158a35fe9a4a64e (patch) | |
tree | 4458c9c5ada0a216b385813a56ea9a9b8c7b6509 /examples | |
parent | 453e99bc2dcbd5fabad100f9d0d5f682013c3b19 (diff) | |
download | org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.gz org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.tar.xz org.eclipse.papyrus-d98116b5b376f18b6cf626ba4158a35fe9a4a64e.zip |
Bug 515367 - [releng] Uniformization of the end of lines to Unix standard
- Format the EOL of all the files matched by: grep -rIUs . | xargs -Ifile dos2unix -k 'file'
Change-Id: I5c41d540a9a67b50de9b912ab35e16cc9a912961
Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
Diffstat (limited to 'examples')
105 files changed, 7565 insertions, 7565 deletions
diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.classpath b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.classpath +++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.project b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.project index a165d6f55aa..2f4cccd69e8 100644 --- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.project +++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.example.core.lifecycleevents</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.example.core.lifecycleevents</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/about.html b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/about.html +++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/build.properties b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/build.properties index c659c55e85e..ae22b3b40a0 100644 --- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/build.properties +++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/build.properties @@ -1,7 +1,7 @@ -source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.properties,\
- plugin.xml
+source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.properties b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.properties index 92fb944ece9..8639dfa7d41 100644 --- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.properties +++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.properties @@ -1,12 +1,12 @@ -#################################################################################
-# Copyright (c) 2008 CEA LIST.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
-##################################################################################
-pluginName=Papyrus Editor Life Cycle Example
-providerName=Eclipse Modeling Project
+################################################################################# +# Copyright (c) 2008 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation +################################################################################## +pluginName=Papyrus Editor Life Cycle Example +providerName=Eclipse Modeling Project diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.xml b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.xml index 440f62d150d..b443b5e486d 100644 --- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.xml +++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/plugin.xml @@ -1,14 +1,14 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.infra.core.service">
- <service
- classname="org.eclipse.papyrus.example.core.lifecycleevents.LifeCycleEventsMonitorService"
- priority="1"
- startKind="startup"
- useClassTypeAsKey="true">
- </service>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.papyrus.infra.core.service"> + <service + classname="org.eclipse.papyrus.example.core.lifecycleevents.LifeCycleEventsMonitorService" + priority="1" + startKind="startup" + useClassTypeAsKey="true"> + </service> + </extension> + +</plugin> diff --git a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/Activator.java b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/Activator.java index 609e586337e..797fe9ddc7f 100644 --- a/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/Activator.java +++ b/examples/core/org.eclipse.papyrus.example.core.lifecycleevents/src/org/eclipse/papyrus/example/core/lifecycleevents/Activator.java @@ -1,50 +1,50 @@ -package org.eclipse.papyrus.example.core.lifecycleevents;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.example.core.lifecycleevents";
-
- // 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;
- }
-
-}
+package org.eclipse.papyrus.example.core.lifecycleevents; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.example.core.lifecycleevents"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.classpath b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.classpath +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.project b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.project index b58a111b857..1f85d50b3ec 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.project +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.example.core.sashwindows.fulleditor</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.example.core.sashwindows.fulleditor</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/about.html b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/about.html +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/build.properties b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/build.properties index d4e63335e69..74f4c7d7af6 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/build.properties +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/build.properties @@ -1,8 +1,8 @@ -source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- about.html,\
- plugin.properties
+source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + about.html,\ + plugin.properties diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.properties b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.properties index 3f6aa859af3..0797e9ffbde 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.properties +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.properties @@ -1,14 +1,14 @@ -#################################################################################
-# Copyright (c) 2008 CEA LIST.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
-##################################################################################
-pluginName=Papyrus sashwindows full editor example
-providerName=Eclipse Modeling Project
-
-wizardSash= Sash Windows Full Editor
+################################################################################# +# Copyright (c) 2008 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation +################################################################################## +pluginName=Papyrus sashwindows full editor example +providerName=Eclipse Modeling Project + +wizardSash= Sash Windows Full Editor diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.xml b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.xml index e8baf5a9809..d4ed4311242 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.xml +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/plugin.xml @@ -1,132 +1,132 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="Sash Windows Full Editor"
- extensions="fullEditor"
- icon="icons/sample.gif"
- contributorClass="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.MultiTextEditorContributor"
- class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.MultiTextEditor"
- id="org.eclipse.papyrus.example.sashwindows.FullEditor">
- </editor>
- <editor
- class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.DiMultiTextEditor"
- contributorClass="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.MultiTextEditorContributor"
- extensions="fullEditor"
- icon="icons/sample.gif"
- id="org.eclipse.papyrus.example.sashwindows.DiFullEditor"
- name="Sash Windows Full Editor (Di ContentProvider)">
- </editor>
- </extension>
- <extension
- point="org.eclipse.ui.newWizards">
- <!-- @generated NOT -->
- <wizard
- name="%wizardSash"
- icon="icons/sample.gif"
- category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.examples"
- class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.wizards.MultiTextNewWizard"
- id="org.eclipse.papyrus.example.sashwindows.wizards.FullEditor">
- </wizard>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="popup:org.eclipse.papyrus.dev.ui.menu">
- <menu
- id="org.eclipse.example.multitext.ui.menu"
- label="Sash Windows Full Editor">
- <menu
- id="org.eclipse.example.multitext.ui.menu.create"
- label="Create Tab">
- <command
- commandId="org.eclipse.example.multitext.ui.command.createTestEditor"
- icon="icons/TextEditor.gif"
- label="Create New Text Editor"
- style="push">
- </command>
- <command
- commandId="org.eclipse.example.multitext.ui.command.createMsgControl"
- icon="icons/MsgTab.gif"
- label="Create Msg Tab"
- style="push">
- </command>
- </menu>
- </menu>
- </menuContribution>
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar
- id="org.eclipse.example.multitext.ui.toolbar">
- <command
- commandId="org.eclipse.example.multitext.ui.command.createTestEditor"
- icon="icons/TextEditor.gif"
- style="push">
- </command>
- <command
- commandId="org.eclipse.example.multitext.ui.command.createMsgControl"
- icon="icons/MsgTab.gif"
- style="push">
- </command>
- </toolbar>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- id="org.eclipse.example.multitext.ui.command.createTestEditor"
- name="Create New Text Editor">
- </command>
- <command
- id="org.eclipse.example.multitext.ui.command.createMsgControl"
- name="Create Msg Tab">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.texteditor.CreateTextEditorCommandHandler"
- commandId="org.eclipse.example.multitext.ui.command.createTestEditor">
- <activeWhen>
- <or>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.example.sashwindows.FullEditor">
- </equals>
- </with>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.example.sashwindows.DiFullEditor">
- </equals>
- </with>
- </or>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.msgpage.CreateMessageCommandHandler"
- commandId="org.eclipse.example.multitext.ui.command.createMsgControl">
- <activeWhen>
- <or>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.example.sashwindows.FullEditor">
- </equals>
- </with>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.example.sashwindows.DiFullEditor">
- </equals>
- </with>
- </or>
- </activeWhen>
- </handler>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.2"?> +<plugin> + + <extension + point="org.eclipse.ui.editors"> + <editor + name="Sash Windows Full Editor" + extensions="fullEditor" + icon="icons/sample.gif" + contributorClass="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.MultiTextEditorContributor" + class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.MultiTextEditor" + id="org.eclipse.papyrus.example.sashwindows.FullEditor"> + </editor> + <editor + class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.DiMultiTextEditor" + contributorClass="org.eclipse.papyrus.example.core.sashwindows.fulleditor.editor.MultiTextEditorContributor" + extensions="fullEditor" + icon="icons/sample.gif" + id="org.eclipse.papyrus.example.sashwindows.DiFullEditor" + name="Sash Windows Full Editor (Di ContentProvider)"> + </editor> + </extension> + <extension + point="org.eclipse.ui.newWizards"> + <!-- @generated NOT --> + <wizard + name="%wizardSash" + icon="icons/sample.gif" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.examples" + class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.wizards.MultiTextNewWizard" + id="org.eclipse.papyrus.example.sashwindows.wizards.FullEditor"> + </wizard> + </extension> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + locationURI="popup:org.eclipse.papyrus.dev.ui.menu"> + <menu + id="org.eclipse.example.multitext.ui.menu" + label="Sash Windows Full Editor"> + <menu + id="org.eclipse.example.multitext.ui.menu.create" + label="Create Tab"> + <command + commandId="org.eclipse.example.multitext.ui.command.createTestEditor" + icon="icons/TextEditor.gif" + label="Create New Text Editor" + style="push"> + </command> + <command + commandId="org.eclipse.example.multitext.ui.command.createMsgControl" + icon="icons/MsgTab.gif" + label="Create Msg Tab" + style="push"> + </command> + </menu> + </menu> + </menuContribution> + <menuContribution + locationURI="toolbar:org.eclipse.ui.main.toolbar"> + <toolbar + id="org.eclipse.example.multitext.ui.toolbar"> + <command + commandId="org.eclipse.example.multitext.ui.command.createTestEditor" + icon="icons/TextEditor.gif" + style="push"> + </command> + <command + commandId="org.eclipse.example.multitext.ui.command.createMsgControl" + icon="icons/MsgTab.gif" + style="push"> + </command> + </toolbar> + </menuContribution> + </extension> + <extension + point="org.eclipse.ui.commands"> + <command + id="org.eclipse.example.multitext.ui.command.createTestEditor" + name="Create New Text Editor"> + </command> + <command + id="org.eclipse.example.multitext.ui.command.createMsgControl" + name="Create Msg Tab"> + </command> + </extension> + <extension + point="org.eclipse.ui.handlers"> + <handler + class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.texteditor.CreateTextEditorCommandHandler" + commandId="org.eclipse.example.multitext.ui.command.createTestEditor"> + <activeWhen> + <or> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.example.sashwindows.FullEditor"> + </equals> + </with> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.example.sashwindows.DiFullEditor"> + </equals> + </with> + </or> + </activeWhen> + </handler> + <handler + class="org.eclipse.papyrus.example.core.sashwindows.fulleditor.msgpage.CreateMessageCommandHandler" + commandId="org.eclipse.example.multitext.ui.command.createMsgControl"> + <activeWhen> + <or> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.example.sashwindows.FullEditor"> + </equals> + </with> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.example.sashwindows.DiFullEditor"> + </equals> + </with> + </or> + </activeWhen> + </handler> + </extension> + +</plugin> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/Activator.java b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/Activator.java index a4abea49c3c..3ae91d6e1cf 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/Activator.java +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/Activator.java @@ -1,77 +1,77 @@ -/*****************************************************************************
- * Copyright (c) 2009 CEA LIST & LIFL
- *
- *
- * 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.example.core.sashwindows.fulleditor;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.example.core.sashwindows.fulleditor";
-
- // 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;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path
- * the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
+/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * 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.example.core.sashwindows.fulleditor; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.example.core.sashwindows.fulleditor"; + + // 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; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path + * the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/msgpage/CreateMessageCommandHandler.java b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/msgpage/CreateMessageCommandHandler.java index 769abe80d3f..1600e144b3c 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/msgpage/CreateMessageCommandHandler.java +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/msgpage/CreateMessageCommandHandler.java @@ -1,90 +1,90 @@ -/*****************************************************************************
- * 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.example.core.sashwindows.fulleditor.msgpage;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IComponentModel;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Command to create a new TextEditor.
- * The command create a new IEditorModel and add it to the Sashwindow repository model.
- *
- * @author dumoulin
- */
-public class CreateMessageCommandHandler extends AbstractHandler implements IHandler {
-
- /**
- * Method called when the command is invoked.
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- // Create the Editor Model
- IComponentModel model = new MessagePartModel("Message !!!");
- // Get the Sashwindow model
- ISashWindowsContentProvider contentProvider = getSashWindowsContentProvider();
- if(contentProvider == null) {
- showErrorDialog("Can't create Editor. Reason: Can't get current editor ContentProvider.");
- }
- // Add it to the current folder
- contentProvider.addPage(model);
- return null;
- }
-
-
- /**
- * Show an ErrorDialog.
- *
- * @param string
- */
- private void showErrorDialog(String text) {
- MessageBox dialog = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_WARNING | SWT.OK | SWT.APPLICATION_MODAL);
- dialog.setText(text);
- dialog.open();
- return;
- }
-
-
- /**
- * Get the current MultiDiagramEditor.
- *
- * @return
- */
- protected IEditorPart getMultiDiagramEditor() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editorPart = page.getActiveEditor();
- return editorPart;
- }
-
- /**
- * Get the shared object.
- *
- * @return
- */
- protected ISashWindowsContentProvider getSashWindowsContentProvider() {
- IEditorPart editor = getMultiDiagramEditor();
-
- ISashWindowsContentProvider contentProvider = (ISashWindowsContentProvider)editor.getAdapter(ISashWindowsContentProvider.class);
- return contentProvider;
- }
-
-}
+/***************************************************************************** + * 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.example.core.sashwindows.fulleditor.msgpage; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IComponentModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; + +/** + * Command to create a new TextEditor. + * The command create a new IEditorModel and add it to the Sashwindow repository model. + * + * @author dumoulin + */ +public class CreateMessageCommandHandler extends AbstractHandler implements IHandler { + + /** + * Method called when the command is invoked. + */ + public Object execute(ExecutionEvent event) throws ExecutionException { + + // Create the Editor Model + IComponentModel model = new MessagePartModel("Message !!!"); + // Get the Sashwindow model + ISashWindowsContentProvider contentProvider = getSashWindowsContentProvider(); + if(contentProvider == null) { + showErrorDialog("Can't create Editor. Reason: Can't get current editor ContentProvider."); + } + // Add it to the current folder + contentProvider.addPage(model); + return null; + } + + + /** + * Show an ErrorDialog. + * + * @param string + */ + private void showErrorDialog(String text) { + MessageBox dialog = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_WARNING | SWT.OK | SWT.APPLICATION_MODAL); + dialog.setText(text); + dialog.open(); + return; + } + + + /** + * Get the current MultiDiagramEditor. + * + * @return + */ + protected IEditorPart getMultiDiagramEditor() { + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + IEditorPart editorPart = page.getActiveEditor(); + return editorPart; + } + + /** + * Get the shared object. + * + * @return + */ + protected ISashWindowsContentProvider getSashWindowsContentProvider() { + IEditorPart editor = getMultiDiagramEditor(); + + ISashWindowsContentProvider contentProvider = (ISashWindowsContentProvider)editor.getAdapter(ISashWindowsContentProvider.class); + return contentProvider; + } + +} diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/CreateTextEditorCommandHandler.java b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/CreateTextEditorCommandHandler.java index b308d2719ff..ee13a0860ee 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/CreateTextEditorCommandHandler.java +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/CreateTextEditorCommandHandler.java @@ -1,94 +1,94 @@ -/*****************************************************************************
- * 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.example.core.sashwindows.fulleditor.texteditor;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Command to create a new TextEditor.
- * The command create a new IEditorModel and add it to the Sashwindow repository model.
- *
- * @author dumoulin
- */
-public class CreateTextEditorCommandHandler extends AbstractHandler implements IHandler {
-
- /**
- * Method called when the command is invoked.
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- // Create the Editor Model
- IEditorModel model = new TextEditorPartModel();
- // Get the Sashwindow model
- ISashWindowsContentProvider contentProvider = getSashWindowsContentProvider(event);
- if(contentProvider == null) {
- showErrorDialog("Can't create Editor. Reason: Can't get current editor ContentProvider.");
- }
- // Add it to the current folder
- contentProvider.addPage(model);
- return null;
- }
-
-
- /**
- * Show an ErrorDialog.
- *
- * @param string
- */
- private void showErrorDialog(String text) {
- MessageBox dialog = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_WARNING | SWT.OK | SWT.APPLICATION_MODAL);
- dialog.setText(text);
- dialog.open();
- return;
- }
-
-
- /**
- * Get the current MultiDiagramEditor.
- *
- * @return
- */
- protected IEditorPart getMultiDiagramEditor() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editorPart = page.getActiveEditor();
- return editorPart;
- }
-
- /**
- * Get the shared object.
- * @param event
- *
- * @return
- * @throws ExecutionException
- */
- protected ISashWindowsContentProvider getSashWindowsContentProvider(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditorChecked(event);
-// IEditorPart editor = getMultiDiagramEditor();
-
- ISashWindowsContentProvider contentProvider = (ISashWindowsContentProvider)editor.getAdapter(ISashWindowsContentProvider.class);
- return contentProvider;
- }
-
-}
+/***************************************************************************** + * 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.example.core.sashwindows.fulleditor.texteditor; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; + +/** + * Command to create a new TextEditor. + * The command create a new IEditorModel and add it to the Sashwindow repository model. + * + * @author dumoulin + */ +public class CreateTextEditorCommandHandler extends AbstractHandler implements IHandler { + + /** + * Method called when the command is invoked. + */ + public Object execute(ExecutionEvent event) throws ExecutionException { + + // Create the Editor Model + IEditorModel model = new TextEditorPartModel(); + // Get the Sashwindow model + ISashWindowsContentProvider contentProvider = getSashWindowsContentProvider(event); + if(contentProvider == null) { + showErrorDialog("Can't create Editor. Reason: Can't get current editor ContentProvider."); + } + // Add it to the current folder + contentProvider.addPage(model); + return null; + } + + + /** + * Show an ErrorDialog. + * + * @param string + */ + private void showErrorDialog(String text) { + MessageBox dialog = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_WARNING | SWT.OK | SWT.APPLICATION_MODAL); + dialog.setText(text); + dialog.open(); + return; + } + + + /** + * Get the current MultiDiagramEditor. + * + * @return + */ + protected IEditorPart getMultiDiagramEditor() { + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + IEditorPart editorPart = page.getActiveEditor(); + return editorPart; + } + + /** + * Get the shared object. + * @param event + * + * @return + * @throws ExecutionException + */ + protected ISashWindowsContentProvider getSashWindowsContentProvider(ExecutionEvent event) throws ExecutionException { + IEditorPart editor = HandlerUtil.getActiveEditorChecked(event); +// IEditorPart editor = getMultiDiagramEditor(); + + ISashWindowsContentProvider contentProvider = (ISashWindowsContentProvider)editor.getAdapter(ISashWindowsContentProvider.class); + return contentProvider; + } + +} diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TabTextEditor.java b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TabTextEditor.java index 838efb0a1af..865bcb52486 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TabTextEditor.java +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.fulleditor/src/org/eclipse/papyrus/example/core/sashwindows/fulleditor/texteditor/TabTextEditor.java @@ -1,39 +1,39 @@ -/*****************************************************************************
- * Copyright (c) 2009 CEA LIST & LIFL
- *
- *
- * 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.example.core.sashwindows.fulleditor.texteditor;
-
-import org.eclipse.ui.editors.text.TextEditor;
-
-
-/**
- * A TextEditor that can be used as Tab of a sashes window.
- *
- * @author dumoulin
- */
-public class TabTextEditor extends TextEditor {
-
- /**
- *
- */
- public TabTextEditor() {
- }
-
- /**
- * Set the name of this part. {@inheritDoc}
- */
- @Override
- public void setPartName(String partName) {
- super.setPartName(partName);
- }
-}
+/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * 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.example.core.sashwindows.fulleditor.texteditor; + +import org.eclipse.ui.editors.text.TextEditor; + + +/** + * A TextEditor that can be used as Tab of a sashes window. + * + * @author dumoulin + */ +public class TabTextEditor extends TextEditor { + + /** + * + */ + public TabTextEditor() { + } + + /** + * Set the name of this part. {@inheritDoc} + */ + @Override + public void setPartName(String partName) { + super.setPartName(partName); + } +} diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.classpath b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.classpath +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.project b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.project index b1297849328..246ddd7a0ee 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.project +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.example.core.sashwindows.simpleeditor</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.example.core.sashwindows.simpleeditor</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/about.html b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/about.html +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/build.properties b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/build.properties index d4e63335e69..74f4c7d7af6 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/build.properties +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/build.properties @@ -1,8 +1,8 @@ -source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
- META-INF/,\
- .,\
- icons/,\
- about.html,\
- plugin.properties
+source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + about.html,\ + plugin.properties diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/plugin.xml b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/plugin.xml index 6005740a446..16f8aa4ab65 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/plugin.xml +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/plugin.xml @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="Sash Windows Simple Editor"
- extensions="simpleEditor"
- icon="icons/sample.gif"
- contributorClass="org.eclipse.papyrus.example.core.sashwindows.simpleeditor.editors.MultiPageEditorContributor"
- class="org.eclipse.papyrus.example.core.sashwindows.simpleeditor.editors.SimpleTextMultiPageEditor"
- id="org.eclipse.papyrus.example.sashwindows.SimpleEditor">
- </editor>
- </extension>
- <extension
- point="org.eclipse.ui.newWizards">
- <!-- @generated NOT -->
- <wizard
- name="%wizardSash"
- icon="icons/sample.gif"
- category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.examples"
- class="org.eclipse.papyrus.example.core.sashwindows.simpleeditor.wizards.MultiPageEditorNewWizard"
- id="org.eclipse.papyrus.example.sashwindows.wizards.SimpleEditor">
- </wizard>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.2"?> +<plugin> + + <extension + point="org.eclipse.ui.editors"> + <editor + name="Sash Windows Simple Editor" + extensions="simpleEditor" + icon="icons/sample.gif" + contributorClass="org.eclipse.papyrus.example.core.sashwindows.simpleeditor.editors.MultiPageEditorContributor" + class="org.eclipse.papyrus.example.core.sashwindows.simpleeditor.editors.SimpleTextMultiPageEditor" + id="org.eclipse.papyrus.example.sashwindows.SimpleEditor"> + </editor> + </extension> + <extension + point="org.eclipse.ui.newWizards"> + <!-- @generated NOT --> + <wizard + name="%wizardSash" + icon="icons/sample.gif" + category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.examples" + class="org.eclipse.papyrus.example.core.sashwindows.simpleeditor.wizards.MultiPageEditorNewWizard" + id="org.eclipse.papyrus.example.sashwindows.wizards.SimpleEditor"> + </wizard> + </extension> + +</plugin> diff --git a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/src/org/eclipse/papyrus/example/core/sashwindows/simpleeditor/Activator.java b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/src/org/eclipse/papyrus/example/core/sashwindows/simpleeditor/Activator.java index 98db081c499..d15f10bdd04 100644 --- a/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/src/org/eclipse/papyrus/example/core/sashwindows/simpleeditor/Activator.java +++ b/examples/core/org.eclipse.papyrus.example.core.sashwindows.simpleeditor/src/org/eclipse/papyrus/example/core/sashwindows/simpleeditor/Activator.java @@ -1,77 +1,77 @@ -/*****************************************************************************
- * Copyright (c) 2009 CEA LIST & LIFL
- *
- *
- * 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.example.core.sashwindows.simpleeditor;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.example.core.sashwindows.simpleeditor";
-
- // 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;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path
- * the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
+/***************************************************************************** + * Copyright (c) 2009 CEA LIST & LIFL + * + * + * 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.example.core.sashwindows.simpleeditor; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.example.core.sashwindows.simpleeditor"; + + // 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; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path + * the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/.classpath b/examples/emf/org.eclipse.papyrus.outline.emftree/.classpath index 6e16b23d695..16d067f284a 100644 --- a/examples/emf/org.eclipse.papyrus.outline.emftree/.classpath +++ b/examples/emf/org.eclipse.papyrus.outline.emftree/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/about.html b/examples/emf/org.eclipse.papyrus.outline.emftree/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/emf/org.eclipse.papyrus.outline.emftree/about.html +++ b/examples/emf/org.eclipse.papyrus.outline.emftree/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/build.properties b/examples/emf/org.eclipse.papyrus.outline.emftree/build.properties index 26f13552e94..e1756978070 100644 --- a/examples/emf/org.eclipse.papyrus.outline.emftree/build.properties +++ b/examples/emf/org.eclipse.papyrus.outline.emftree/build.properties @@ -1,6 +1,6 @@ -#
-#Mon Sep 12 09:30:00 CEST 2011
-bin.includes=META-INF/,.,plugin.xml,about.html,plugin.properties
-output.. = bin/
-src.includes = about.html
-source.. = src/
+# +#Mon Sep 12 09:30:00 CEST 2011 +bin.includes=META-INF/,.,plugin.xml,about.html,plugin.properties +output.. = bin/ +src.includes = about.html +source.. = src/ diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.properties b/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.properties index 2da2ec05f23..cb3f34c3656 100644 --- a/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.properties +++ b/examples/emf/org.eclipse.papyrus.outline.emftree/plugin.properties @@ -1,12 +1,12 @@ -###############################################################################
-# * Copyright (c) 2008 CEA LIST.
-# * All rights reserved. This program and the accompanying materials
-# * are made available under the terms of the Eclipse Public License v1.0
-# * which accompanies this distribution, and is available at
-# * http://www.eclipse.org/legal/epl-v10.html
-# *
-# * Contributors:
-# * CEA LIST - initial API and implementation
-###############################################################################
-pluginName=Papyrus Outline Example (Incubation)
-providerName=Eclipse Modeling Project
+############################################################################### +# * Copyright (c) 2008 CEA LIST. +# * All rights reserved. This program and the accompanying materials +# * are made available under the terms of the Eclipse Public License v1.0 +# * which accompanies this distribution, and is available at +# * http://www.eclipse.org/legal/epl-v10.html +# * +# * Contributors: +# * CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus Outline Example (Incubation) +providerName=Eclipse Modeling Project diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/Activator.java b/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/Activator.java index bf4b2708f87..7457dcac458 100644 --- a/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/Activator.java +++ b/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/Activator.java @@ -1,65 +1,65 @@ -/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cedric Dumoulin Cedric.Dumoulin@lifl.fr- Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.outline.emftree;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.outline.emftree";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
+/***************************************************************************** + * 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.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.outline.emftree"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/MultiPageAdapterSite.java b/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/MultiPageAdapterSite.java index 175fb22796b..780c13531e2 100644 --- a/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/MultiPageAdapterSite.java +++ b/examples/emf/org.eclipse.papyrus.outline.emftree/src/org/eclipse/papyrus/outline/emftree/MultiPageAdapterSite.java @@ -1,260 +1,260 @@ -/**
- *
- */
-package org.eclipse.papyrus.outline.emftree;
-
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IKeyBindingService;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.internal.services.INestable;
-import org.eclipse.ui.part.EditorActionBarContributor;
-
-/**
- * A site made of a main site and another ActionarContributor.
- *
- * @author dumoulin
- *
- */
-public class MultiPageAdapterSite implements IEditorSite, INestable {
-
- /**
- * The actionBarContributor to use instead of the one in the site.
- */
- private EditorActionBarContributor actionBarContributor;
-
- /**
- * The site to which methods delegate.
- */
- private IEditorSite site;
-
- /**
- * Constructor.
- *
- * @param workbenchPartSite
- * @param actionBarContributor
- */
- public MultiPageAdapterSite(IEditorSite site, EditorActionBarContributor actionBarContributor) {
- super();
- this.site = site;
- this.actionBarContributor = actionBarContributor;
- }
-
- /**
- * @see org.eclipse.ui.IEditorSite#getActionBarContributor()
- * @return
- *
- */
- public IEditorActionBarContributor getActionBarContributor() {
-
- return actionBarContributor;
- }
-
- /**
- * @see org.eclipse.ui.IEditorSite#getActionBars()
- * @return
- *
- */
- public IActionBars getActionBars() {
- return site.getActionBars();
- }
-
- /**
- * @see org.eclipse.ui.IEditorSite#registerContextMenu(org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider,
- * boolean)
- * @param menuManager
- * @param selectionProvider
- * @param includeEditorInput
- *
- */
- public void registerContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) {
- site.registerContextMenu(menuManager, selectionProvider, includeEditorInput);
- }
-
- /**
- * @see org.eclipse.ui.IEditorSite#registerContextMenu(java.lang.String, org.eclipse.jface.action.MenuManager,
- * org.eclipse.jface.viewers.ISelectionProvider, boolean)
- * @param menuId
- * @param menuManager
- * @param selectionProvider
- * @param includeEditorInput
- *
- */
- public void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) {
- site.registerContextMenu(menuId, menuManager, selectionProvider, includeEditorInput);
-
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPartSite#getId()
- * @return
- *
- */
- public String getId() {
- return site.getId();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPartSite#getKeyBindingService()
- * @return
- * @deprecated
- *
- */
- public IKeyBindingService getKeyBindingService() {
- return site.getKeyBindingService();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPartSite#getPart()
- * @return
- *
- */
- public IWorkbenchPart getPart() {
- return site.getPart();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPartSite#getPluginId()
- * @return
- *
- */
- public String getPluginId() {
- return site.getPluginId();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPartSite#getRegisteredName()
- * @return
- *
- */
- public String getRegisteredName() {
- return site.getRegisteredName();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPartSite#registerContextMenu(org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider)
- * @param menuManager
- * @param selectionProvider
- *
- */
- public void registerContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider) {
- site.registerContextMenu(menuManager, selectionProvider);
-
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPartSite#registerContextMenu(java.lang.String, org.eclipse.jface.action.MenuManager,
- * org.eclipse.jface.viewers.ISelectionProvider)
- * @param menuId
- * @param menuManager
- * @param selectionProvider
- *
- */
- public void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider) {
- site.registerContextMenu(menuId, menuManager, selectionProvider);
-
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchSite#getPage()
- * @return
- *
- */
- public IWorkbenchPage getPage() {
- return site.getPage();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchSite#getSelectionProvider()
- * @return
- *
- */
- public ISelectionProvider getSelectionProvider() {
- return site.getSelectionProvider();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchSite#getShell()
- * @return
- *
- */
- public Shell getShell() {
- return site.getShell();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchSite#getWorkbenchWindow()
- * @return
- *
- */
- public IWorkbenchWindow getWorkbenchWindow() {
- return site.getWorkbenchWindow();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchSite#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
- * @param provider
- *
- */
- public void setSelectionProvider(ISelectionProvider provider) {
- site.setSelectionProvider(provider);
-
- }
-
- /**
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- * @param adapter
- * @return
- *
- */
- public Object getAdapter(Class adapter) {
- return site.getAdapter(adapter);
- }
-
- /**
- * @see org.eclipse.ui.services.IServiceLocator#getService(java.lang.Class)
- * @param api
- * @return
- *
- */
- public Object getService(Class api) {
- return site.getService(api);
- }
-
- /**
- * @see org.eclipse.ui.services.IServiceLocator#hasService(java.lang.Class)
- * @param api
- * @return
- *
- */
- public boolean hasService(Class api) {
- return site.hasService(api);
- }
-
- /**
- *
- * @see org.eclipse.ui.internal.services.INestable#activate()
- *
- */
- public void activate() {
- if(site instanceof INestable)
- ((INestable)site).activate();
- }
-
- /**
- *
- * @see org.eclipse.ui.internal.services.INestable#deactivate()
- *
- */
- public void deactivate() {
- if(site instanceof INestable)
- ((INestable)site).deactivate();
- }
-
-}
+/** + * + */ +package org.eclipse.papyrus.outline.emftree; + +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorActionBarContributor; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IKeyBindingService; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.internal.services.INestable; +import org.eclipse.ui.part.EditorActionBarContributor; + +/** + * A site made of a main site and another ActionarContributor. + * + * @author dumoulin + * + */ +public class MultiPageAdapterSite implements IEditorSite, INestable { + + /** + * The actionBarContributor to use instead of the one in the site. + */ + private EditorActionBarContributor actionBarContributor; + + /** + * The site to which methods delegate. + */ + private IEditorSite site; + + /** + * Constructor. + * + * @param workbenchPartSite + * @param actionBarContributor + */ + public MultiPageAdapterSite(IEditorSite site, EditorActionBarContributor actionBarContributor) { + super(); + this.site = site; + this.actionBarContributor = actionBarContributor; + } + + /** + * @see org.eclipse.ui.IEditorSite#getActionBarContributor() + * @return + * + */ + public IEditorActionBarContributor getActionBarContributor() { + + return actionBarContributor; + } + + /** + * @see org.eclipse.ui.IEditorSite#getActionBars() + * @return + * + */ + public IActionBars getActionBars() { + return site.getActionBars(); + } + + /** + * @see org.eclipse.ui.IEditorSite#registerContextMenu(org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider, + * boolean) + * @param menuManager + * @param selectionProvider + * @param includeEditorInput + * + */ + public void registerContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) { + site.registerContextMenu(menuManager, selectionProvider, includeEditorInput); + } + + /** + * @see org.eclipse.ui.IEditorSite#registerContextMenu(java.lang.String, org.eclipse.jface.action.MenuManager, + * org.eclipse.jface.viewers.ISelectionProvider, boolean) + * @param menuId + * @param menuManager + * @param selectionProvider + * @param includeEditorInput + * + */ + public void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider, boolean includeEditorInput) { + site.registerContextMenu(menuId, menuManager, selectionProvider, includeEditorInput); + + } + + /** + * @see org.eclipse.ui.IWorkbenchPartSite#getId() + * @return + * + */ + public String getId() { + return site.getId(); + } + + /** + * @see org.eclipse.ui.IWorkbenchPartSite#getKeyBindingService() + * @return + * @deprecated + * + */ + public IKeyBindingService getKeyBindingService() { + return site.getKeyBindingService(); + } + + /** + * @see org.eclipse.ui.IWorkbenchPartSite#getPart() + * @return + * + */ + public IWorkbenchPart getPart() { + return site.getPart(); + } + + /** + * @see org.eclipse.ui.IWorkbenchPartSite#getPluginId() + * @return + * + */ + public String getPluginId() { + return site.getPluginId(); + } + + /** + * @see org.eclipse.ui.IWorkbenchPartSite#getRegisteredName() + * @return + * + */ + public String getRegisteredName() { + return site.getRegisteredName(); + } + + /** + * @see org.eclipse.ui.IWorkbenchPartSite#registerContextMenu(org.eclipse.jface.action.MenuManager, org.eclipse.jface.viewers.ISelectionProvider) + * @param menuManager + * @param selectionProvider + * + */ + public void registerContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider) { + site.registerContextMenu(menuManager, selectionProvider); + + } + + /** + * @see org.eclipse.ui.IWorkbenchPartSite#registerContextMenu(java.lang.String, org.eclipse.jface.action.MenuManager, + * org.eclipse.jface.viewers.ISelectionProvider) + * @param menuId + * @param menuManager + * @param selectionProvider + * + */ + public void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider) { + site.registerContextMenu(menuId, menuManager, selectionProvider); + + } + + /** + * @see org.eclipse.ui.IWorkbenchSite#getPage() + * @return + * + */ + public IWorkbenchPage getPage() { + return site.getPage(); + } + + /** + * @see org.eclipse.ui.IWorkbenchSite#getSelectionProvider() + * @return + * + */ + public ISelectionProvider getSelectionProvider() { + return site.getSelectionProvider(); + } + + /** + * @see org.eclipse.ui.IWorkbenchSite#getShell() + * @return + * + */ + public Shell getShell() { + return site.getShell(); + } + + /** + * @see org.eclipse.ui.IWorkbenchSite#getWorkbenchWindow() + * @return + * + */ + public IWorkbenchWindow getWorkbenchWindow() { + return site.getWorkbenchWindow(); + } + + /** + * @see org.eclipse.ui.IWorkbenchSite#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider) + * @param provider + * + */ + public void setSelectionProvider(ISelectionProvider provider) { + site.setSelectionProvider(provider); + + } + + /** + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + * @param adapter + * @return + * + */ + public Object getAdapter(Class adapter) { + return site.getAdapter(adapter); + } + + /** + * @see org.eclipse.ui.services.IServiceLocator#getService(java.lang.Class) + * @param api + * @return + * + */ + public Object getService(Class api) { + return site.getService(api); + } + + /** + * @see org.eclipse.ui.services.IServiceLocator#hasService(java.lang.Class) + * @param api + * @return + * + */ + public boolean hasService(Class api) { + return site.hasService(api); + } + + /** + * + * @see org.eclipse.ui.internal.services.INestable#activate() + * + */ + public void activate() { + if(site instanceof INestable) + ((INestable)site).activate(); + } + + /** + * + * @see org.eclipse.ui.internal.services.INestable#deactivate() + * + */ + public void deactivate() { + if(site instanceof INestable) + ((INestable)site).deactivate(); + } + +} diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.classpath b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.classpath +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.project b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.project index c1bfde361a9..df0f43b4f0d 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.project +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.example.infra.servicesregistry.retrieval</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.example.infra.servicesregistry.retrieval</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/about.html b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/about.html +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/build.properties b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/build.properties index 657277dcdfb..bc3b0f2bf1f 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/build.properties +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/build.properties @@ -1,7 +1,7 @@ -source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.properties,\
- about.html
+source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties,\ + about.html diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.properties b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.properties index ea0330aedb8..07c6391c076 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.properties +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.properties @@ -1,12 +1,12 @@ -#################################################################################
-# Copyright (c) 2012 Cedric Dumoulin.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
-##################################################################################
-pluginName=Papyrus Services Registry Examples
-providerName=Eclipse Modeling Project
+################################################################################# +# Copyright (c) 2012 Cedric Dumoulin. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation +################################################################################## +pluginName=Papyrus Services Registry Examples +providerName=Eclipse Modeling Project diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.xml b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.xml index c5958e71e55..cb2c2bd3300 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.xml +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/plugin.xml @@ -1,74 +1,74 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ui.commands">
- <command
- description="Lookup the ServicesRegistry associated to an EObject"
- id="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand"
- name="Lookup ServicesRegistry">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.handlers.LookupServiceRegistryFromEObjectHandler"
- commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand">
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar
- id="org.eclipse.papyrus.examples.ui.toolbar.examples">
- <command
- commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand"
- icon="icons/ReportSelectedElementIcon.png"
- label="Lookup ServicesRegistry"
- style="push">
- </command>
- </toolbar>
- </menuContribution>
- <menuContribution
- locationURI="menu:org.eclipse.papyrus.ui.menu">
- <menu
- id="org.eclipse.papyrus.example.ui.menu.examples"
- label="Examples">
- <command
- commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand"
- icon="icons/ReportSelectedElementIcon.png"
- label="Lookup ServicesRegistry"
- style="push">
- </command>
- </menu>
- </menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
- <menu
- id="org.eclipse.papyrus.example.ui.popupmenu.diagram.examples"
- label="Examples">
- <command
- commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand"
- icon="icons/ReportSelectedElementIcon.png"
- label="Lookup ServicesRegistry"
- style="push">
- </command>
- </menu>
- </menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
- <menu
- id="org.eclipse.papyrus.example.ui.popupmenu.modelexplorer.examples"
- label="Examples">
- <command
- commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand"
- icon="icons/ReportSelectedElementIcon.png"
- label="Lookup ServicesRegistry"
- style="push">
- </command>
- </menu>
- </menuContribution>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.ui.commands"> + <command + description="Lookup the ServicesRegistry associated to an EObject" + id="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand" + name="Lookup ServicesRegistry"> + </command> + </extension> + <extension + point="org.eclipse.ui.handlers"> + <handler + class="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.handlers.LookupServiceRegistryFromEObjectHandler" + commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand"> + </handler> + </extension> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + locationURI="toolbar:org.eclipse.ui.main.toolbar"> + <toolbar + id="org.eclipse.papyrus.examples.ui.toolbar.examples"> + <command + commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand" + icon="icons/ReportSelectedElementIcon.png" + label="Lookup ServicesRegistry" + style="push"> + </command> + </toolbar> + </menuContribution> + <menuContribution + locationURI="menu:org.eclipse.papyrus.ui.menu"> + <menu + id="org.eclipse.papyrus.example.ui.menu.examples" + label="Examples"> + <command + commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand" + icon="icons/ReportSelectedElementIcon.png" + label="Lookup ServicesRegistry" + style="push"> + </command> + </menu> + </menuContribution> + <menuContribution + locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu"> + <menu + id="org.eclipse.papyrus.example.ui.popupmenu.diagram.examples" + label="Examples"> + <command + commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand" + icon="icons/ReportSelectedElementIcon.png" + label="Lookup ServicesRegistry" + style="push"> + </command> + </menu> + </menuContribution> + <menuContribution + locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup"> + <menu + id="org.eclipse.papyrus.example.ui.popupmenu.modelexplorer.examples" + label="Examples"> + <command + commandId="org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.commands.ShowServiceRegistryRetrievalCommand" + icon="icons/ReportSelectedElementIcon.png" + label="Lookup ServicesRegistry" + style="push"> + </command> + </menu> + </menuContribution> + </extension> + +</plugin> diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/Activator.java b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/Activator.java index 87648f0a19e..2f7fc63e52a 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/Activator.java +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/Activator.java @@ -1,50 +1,50 @@ -package org.eclipse.papyrus.example.infra.servicesregistry.retrieval;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.example.infra.servicesregistry.retrieval"; //$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;
- }
-
-}
+package org.eclipse.papyrus.example.infra.servicesregistry.retrieval; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.example.infra.servicesregistry.retrieval"; //$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; + } + +} diff --git a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/menu/handlers/LookupServiceRegistryFromEObjectHandler.java b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/menu/handlers/LookupServiceRegistryFromEObjectHandler.java index 8a56202614f..f7ef706129a 100644 --- a/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/menu/handlers/LookupServiceRegistryFromEObjectHandler.java +++ b/examples/infra/org.eclipse.papyrus.example.infra.servicesregistry.retrieval/src/org/eclipse/papyrus/example/infra/servicesregistry/retrieval/menu/handlers/LookupServiceRegistryFromEObjectHandler.java @@ -1,246 +1,246 @@ -/*****************************************************************************
- * Copyright (c) 2012,2017 Cedric Dumoulin & Others
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
- * Benoit maggi (CEA LIST) - Bug 521475
- *****************************************************************************/
-package org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.handlers;
-
-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.commands.IHandler;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.papyrus.example.infra.servicesregistry.retrieval.Activator;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-
-/**
- * A menu handler showing :
- * <ul>
- * <li>How to retrieve a UML element from any kind of selected object (using adapters)</li>
- * <li>How to get the ServicesRegistry from an EObject</li>
- * </ul>
- *
- * @author Cedric dumoulin
- *
- */
-public class LookupServiceRegistryFromEObjectHandler extends AbstractHandler implements IHandler {
-
-
- /**
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- * @param event
- * @return
- * @throws ExecutionException
- *
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
-
- List<EObject> selectedProperties = getAllSelectionAdaptedToType( event, EObject.class );
- if( selectedProperties == null) {
-
- showErrorDialog(event, "No object selected", "Please select a Property First.");
- return null;
- }
-
-
- // Get the ServiceRegistry for each of the selected object
- List<ServicesRegistry> res = new ArrayList<>();
- for( EObject selected : selectedProperties) {
-
- // Get the servicesRegistry
- try {
- ServicesRegistry registry = ServiceUtilsForResource.getInstance().getServiceRegistry(selected.eResource());
- res.add(registry);
- Activator.getDefault().getLog().log(new Status(IStatus.INFO, Activator.PLUGIN_ID, " - " + selected + " [" + registry + "]"));
- } catch (ServiceException e) {
- // Not found
- res.add(null);
- Activator.getDefault().getLog().log(new Status(IStatus.INFO, Activator.PLUGIN_ID, " - " + selected + " [Can't get ServicesRegistry !!!]"));
- }
- }
-
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- showResults( window.getShell(), selectedProperties, res);
-
- return null;
- }
-
- /**
- * Show results in popup.
- * @param selectedProperties
- * @param res
- */
- private void showResults(Shell shell, List<EObject> selectedProperties, List<ServicesRegistry> res) {
-
- StringBuffer buff = new StringBuffer();
-
- Iterator<EObject> selectedIter = selectedProperties.iterator();
- Iterator<ServicesRegistry> registryIter = res.iterator();
- while(selectedIter.hasNext()) {
- EObject selected = selectedIter.next();
- ServicesRegistry registry = registryIter.next();
-
- buff.append("\n[ServicesRegistry]\n");
- if( registry != null )
- buff.append(registry.toString());
- else
- buff.append("Registry not found !!!");
- buff.append( "\n[EOBject]\n");
- buff.append(selected.toString());
- buff.append("\n");
-
- }
-
- String message = buff.toString();
- MessageDialog.openInformation(shell, "ServicesRegistry found for selected objects:", message);
- }
-
- /**
- * Get all selected element of the specified type.
- *
- * @param expectedType
- * @return
- * @throws ExecutionException
- */
- @SuppressWarnings("unchecked")
- private <T> List<T> getAllSelectionAdaptedToType(ExecutionEvent event, Class<T> expectedType) throws ExecutionException {
-
- // Get selection from the workbench
- ISelection selection = HandlerUtil.getCurrentSelectionChecked(event);
-
- // Get the selected objects according to the type of the selected
- if(selection instanceof IStructuredSelection)
- {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- return getAllElementAdaptedToType( structuredSelection.toList(), expectedType);
- }
- else if( selection instanceof TreeSelection) {
- TreeSelection treeSelection = (TreeSelection)selection;
- return getAllElementAdaptedToType( treeSelection.toList(), expectedType );
-
- }
- return null;
- }
-
- /**
- * Filter the list, and only retain objects that can be adapted to the specified type
- * @param objects
- * @param class1
- * @return
- */
- private <T> List<T> getAllElementAdaptedToType(List<Object> list, Class<T> expectedClassType) {
-
- List<T> res = new ArrayList<T>();
-
- for( Object cur : list) {
-
- T adapted = adapt( cur, expectedClassType);
- if( adapted != null)
- res.add(adapted);
- }
- return res;
- }
-
- /**
- * Adapt the specified object to the requested type, if possible.
- * Return null if the object can't be adapted.
- *
- * @param object
- * @param expectedClassType
- * @return The adapted object, or null.
- */
- @SuppressWarnings("unchecked")
- private <T> T adapt( Object object, Class<T> expectedClassType) {
-
- if( object instanceof IAdaptable ) {
- T ele = (T)((IAdaptable)object).getAdapter(expectedClassType);
- if(ele != null) {
- return ele;
- }
- // Try as EObject if the expectedClasType is sub-type of EObject.
- if( EObject.class.isAssignableFrom( expectedClassType) ) {
- // to EObject
- EObject eobject = (EObject)((IAdaptable)object).getAdapter(EObject.class);
-
- if(eobject != null && expectedClassType.isInstance(eobject)) {
- return (T)eobject;
- }
- }
- }
-
- // Try global mechanism
- {
- T ele = (T)Platform.getAdapterManager().getAdapter(object, expectedClassType);
- if(ele != null) {
- return ele;
- }
- // Try as EObject if the expectedClasType is sub-type of EObject.
- if( EObject.class.isAssignableFrom( expectedClassType) ) {
- // to EObject
- EObject eobject = (EObject)Platform.getAdapterManager().getAdapter(object, EObject.class);
-
- if(eobject != null && expectedClassType.isInstance(eobject)) {
-
- return (T)eobject;
- }
- }
- }
- // Can't be adapted
- return null;
-
- }
-
-
- /**
- *
- * @param event
- * @param errorMessage
- * @throws ExecutionException
- */
- private void showErrorDialog(ExecutionEvent event, String title, String errorMessage) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- MessageDialog.openError(
- window.getShell(),
- title,
- errorMessage);
- }
-
-
- /**
- * Get the name used in the {@link RecordingCommand}. This name will be visible in
- * undo/redo.
- *
- * @return The command name to show.
- */
- public String getCommandName() {
- return "Show ServiceRegistry";
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012,2017 Cedric Dumoulin & Others + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * Benoit maggi (CEA LIST) - Bug 521475 + *****************************************************************************/ +package org.eclipse.papyrus.example.infra.servicesregistry.retrieval.menu.handlers; + +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.commands.IHandler; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.papyrus.example.infra.servicesregistry.retrieval.Activator; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.handlers.HandlerUtil; + + +/** + * A menu handler showing : + * <ul> + * <li>How to retrieve a UML element from any kind of selected object (using adapters)</li> + * <li>How to get the ServicesRegistry from an EObject</li> + * </ul> + * + * @author Cedric dumoulin + * + */ +public class LookupServiceRegistryFromEObjectHandler extends AbstractHandler implements IHandler { + + + /** + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + * @param event + * @return + * @throws ExecutionException + * + */ + public Object execute(ExecutionEvent event) throws ExecutionException { + + + List<EObject> selectedProperties = getAllSelectionAdaptedToType( event, EObject.class ); + if( selectedProperties == null) { + + showErrorDialog(event, "No object selected", "Please select a Property First."); + return null; + } + + + // Get the ServiceRegistry for each of the selected object + List<ServicesRegistry> res = new ArrayList<>(); + for( EObject selected : selectedProperties) { + + // Get the servicesRegistry + try { + ServicesRegistry registry = ServiceUtilsForResource.getInstance().getServiceRegistry(selected.eResource()); + res.add(registry); + Activator.getDefault().getLog().log(new Status(IStatus.INFO, Activator.PLUGIN_ID, " - " + selected + " [" + registry + "]")); + } catch (ServiceException e) { + // Not found + res.add(null); + Activator.getDefault().getLog().log(new Status(IStatus.INFO, Activator.PLUGIN_ID, " - " + selected + " [Can't get ServicesRegistry !!!]")); + } + } + + IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); + showResults( window.getShell(), selectedProperties, res); + + return null; + } + + /** + * Show results in popup. + * @param selectedProperties + * @param res + */ + private void showResults(Shell shell, List<EObject> selectedProperties, List<ServicesRegistry> res) { + + StringBuffer buff = new StringBuffer(); + + Iterator<EObject> selectedIter = selectedProperties.iterator(); + Iterator<ServicesRegistry> registryIter = res.iterator(); + while(selectedIter.hasNext()) { + EObject selected = selectedIter.next(); + ServicesRegistry registry = registryIter.next(); + + buff.append("\n[ServicesRegistry]\n"); + if( registry != null ) + buff.append(registry.toString()); + else + buff.append("Registry not found !!!"); + buff.append( "\n[EOBject]\n"); + buff.append(selected.toString()); + buff.append("\n"); + + } + + String message = buff.toString(); + MessageDialog.openInformation(shell, "ServicesRegistry found for selected objects:", message); + } + + /** + * Get all selected element of the specified type. + * + * @param expectedType + * @return + * @throws ExecutionException + */ + @SuppressWarnings("unchecked") + private <T> List<T> getAllSelectionAdaptedToType(ExecutionEvent event, Class<T> expectedType) throws ExecutionException { + + // Get selection from the workbench + ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); + + // Get the selected objects according to the type of the selected + if(selection instanceof IStructuredSelection) + { + IStructuredSelection structuredSelection = (IStructuredSelection)selection; + return getAllElementAdaptedToType( structuredSelection.toList(), expectedType); + } + else if( selection instanceof TreeSelection) { + TreeSelection treeSelection = (TreeSelection)selection; + return getAllElementAdaptedToType( treeSelection.toList(), expectedType ); + + } + return null; + } + + /** + * Filter the list, and only retain objects that can be adapted to the specified type + * @param objects + * @param class1 + * @return + */ + private <T> List<T> getAllElementAdaptedToType(List<Object> list, Class<T> expectedClassType) { + + List<T> res = new ArrayList<T>(); + + for( Object cur : list) { + + T adapted = adapt( cur, expectedClassType); + if( adapted != null) + res.add(adapted); + } + return res; + } + + /** + * Adapt the specified object to the requested type, if possible. + * Return null if the object can't be adapted. + * + * @param object + * @param expectedClassType + * @return The adapted object, or null. + */ + @SuppressWarnings("unchecked") + private <T> T adapt( Object object, Class<T> expectedClassType) { + + if( object instanceof IAdaptable ) { + T ele = (T)((IAdaptable)object).getAdapter(expectedClassType); + if(ele != null) { + return ele; + } + // Try as EObject if the expectedClasType is sub-type of EObject. + if( EObject.class.isAssignableFrom( expectedClassType) ) { + // to EObject + EObject eobject = (EObject)((IAdaptable)object).getAdapter(EObject.class); + + if(eobject != null && expectedClassType.isInstance(eobject)) { + return (T)eobject; + } + } + } + + // Try global mechanism + { + T ele = (T)Platform.getAdapterManager().getAdapter(object, expectedClassType); + if(ele != null) { + return ele; + } + // Try as EObject if the expectedClasType is sub-type of EObject. + if( EObject.class.isAssignableFrom( expectedClassType) ) { + // to EObject + EObject eobject = (EObject)Platform.getAdapterManager().getAdapter(object, EObject.class); + + if(eobject != null && expectedClassType.isInstance(eobject)) { + + return (T)eobject; + } + } + } + // Can't be adapted + return null; + + } + + + /** + * + * @param event + * @param errorMessage + * @throws ExecutionException + */ + private void showErrorDialog(ExecutionEvent event, String title, String errorMessage) throws ExecutionException { + IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); + MessageDialog.openError( + window.getShell(), + title, + errorMessage); + } + + + /** + * Get the name used in the {@link RecordingCommand}. This name will be visible in + * undo/redo. + * + * @return The command name to show. + */ + public String getCommandName() { + return "Show ServiceRegistry"; + } + +} diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.classpath b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.classpath index 8a8f1668cdc..ad32c83a788 100644 --- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.classpath +++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.project b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.project index 41dd6dd726f..2f80519f566 100644 --- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.project +++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/OSGI-INF/l10n/bundle.properties b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/OSGI-INF/l10n/bundle.properties index e9e8b4d04f3..9f729b6ea46 100644 --- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/OSGI-INF/l10n/bundle.properties +++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/OSGI-INF/l10n/bundle.properties @@ -1,3 +1,3 @@ -#Properties file for org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences
-Bundle-Vendor = Eclipse Modeling Project
+#Properties file for org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences +Bundle-Vendor = Eclipse Modeling Project Bundle-Name = ConnectionPoint Preferences Example (Incubation)
\ No newline at end of file diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/about.html b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/about.html index 209103075a7..dd3c089a94c 100644 --- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/about.html +++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>November 14, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>November 14, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> + +</body> </html>
\ No newline at end of file diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/build.properties b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/build.properties index d16b1200471..eab8f10a1d8 100644 --- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/build.properties +++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/build.properties @@ -1,9 +1,9 @@ -source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- build.properties,\
- OSGI-INF/,\
- about.html
-src.includes = about.html
+source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + build.properties,\ + OSGI-INF/,\ + about.html +src.includes = about.html diff --git a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/CustomPreferenceInitializer.java b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/CustomPreferenceInitializer.java index 55ac4ed58cb..5e052aea30a 100644 --- a/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/CustomPreferenceInitializer.java +++ b/examples/infra/org.eclipse.papyrus.infra.gmfdiag.connectionpoint.preferences/src/org/eclipse/papyrus/infra/gmfdiag/connectionpoint/preferences/CustomPreferenceInitializer.java @@ -1,38 +1,38 @@ -/*****************************************************************************
- * 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.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
-
-
-
-public class CustomPreferenceInitializer extends AbstractPreferenceInitializer {
-
- private IPreferenceStore store;
-
- /**
- * constructor of this class
- */
- public CustomPreferenceInitializer() {
- store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
- }
-
- @Override
- public void initializeDefaultPreferences() {
- store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.DRAW_CONNECTION_POINT), true);
- }
-
-}
+/***************************************************************************** + * 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.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper; + + + +public class CustomPreferenceInitializer extends AbstractPreferenceInitializer { + + private IPreferenceStore store; + + /** + * constructor of this class + */ + public CustomPreferenceInitializer() { + store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore(); + } + + @Override + public void initializeDefaultPreferences() { + store.setDefault(PreferencesConstantsHelper.getPapyrusEditorConstant(PreferencesConstantsHelper.DRAW_CONNECTION_POINT), true); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/about.html b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/about.html +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/helpers/UMLBaseEditHelper.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/helpers/UMLBaseEditHelper.java index a308c39c56d..8fc17c2f6be 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/helpers/UMLBaseEditHelper.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/helpers/UMLBaseEditHelper.java @@ -1,10 +1,10 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.edit.helpers;
-
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase;
-
-/**
- * @generated
- */
-public class UMLBaseEditHelper extends GeneratedEditHelperBase {
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.edit.helpers; + +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase; + +/** + * @generated + */ +public class UMLBaseEditHelper extends GeneratedEditHelperBase { + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ComponentNameEditPart.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ComponentNameEditPart.java index 48d0f013a65..fc86216f733 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ComponentNameEditPart.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ComponentNameEditPart.java @@ -1,626 +1,626 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
-import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.policies.UMLTextSelectionEditPolicy;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes;
-import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLParserProvider;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @generated
- */
-public class ComponentNameEditPart extends CompartmentEditPart implements
- ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5001;
-
- /**
- * @generated
- */
- private DirectEditManager manager;
-
- /**
- * @generated
- */
- private IParser parser;
-
- /**
- * @generated
- */
- private List<?> parserElements;
-
- /**
- * @generated
- */
- private String defaultText;
-
- /**
- * @generated
- */
- private ILabelDelegate labelDelegate;
-
- /**
- * @generated
- */
- public ComponentNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
- new UMLTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE,
- new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
- new DefaultNodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getText();
- } else if (figure instanceof Label) {
- return ((Label) figure).getText();
- } else {
- return getLabelDelegate().getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setText(text);
- } else if (figure instanceof Label) {
- ((Label) figure).setText(text);
- } else {
- getLabelDelegate().setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if (figure instanceof WrappingLabel) {
- return ((WrappingLabel) figure).getIcon();
- } else if (figure instanceof Label) {
- return ((Label) figure).getIcon();
- } else {
- return getLabelDelegate().getIcon(0);
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if (figure instanceof WrappingLabel) {
- ((WrappingLabel) figure).setIcon(icon);
- return;
- } else if (figure instanceof Label) {
- ((Label) figure).setIcon(icon);
- return;
- } else {
- getLabelDelegate().setIcon(icon, 0);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if (parserElement == null) {
- return null;
- }
- return UMLElementTypes.getImage(parserElement.eClass());
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if (parserElement != null && getParser() != null) {
- text = getParser().getPrintString(
- new EObjectAdapter(parserElement),
- getParserOptions().intValue());
- }
- if (text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- refreshSelectionFeedback();
- }
-
- /**
- * @generated
- */
- public String getEditText() {
- if (getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(
- new EObjectAdapter(getParserElement()),
- getParserOptions().intValue());
- }
-
- /**
- * @generated
- */
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- /**
- * @generated
- */
- public ICellEditorValidator getEditTextValidator() {
- return new ICellEditorValidator() {
-
- public String isValid(final Object value) {
- if (value instanceof String) {
- final EObject element = getParserElement();
- final IParser parser = getParser();
- try {
- IParserEditStatus valid = (IParserEditStatus) getEditingDomain()
- .runExclusive(
- new RunnableWithResult.Impl<IParserEditStatus>() {
-
- public void run() {
- setResult(parser
- .isValidEditString(
- new EObjectAdapter(
- element),
- (String) value));
- }
- });
- return valid.getCode() == ParserEditStatus.EDITABLE ? null
- : valid.getMessage();
- } catch (InterruptedException ie) {
- ie.printStackTrace();
- }
- }
-
- // shouldn't get here
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor() {
- if (getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(
- new EObjectAdapter(getParserElement()));
- }
-
- /**
- * @generated
- */
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * @generated
- */
- public IParser getParser() {
- if (parser == null) {
- parser = UMLParserProvider
- .getParser(
- UMLElementTypes.Component_2001,
- getParserElement(),
- UMLVisualIDRegistry
- .getType(org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if (manager == null) {
- setManager(new TextDirectEditManager(this, null,
- UMLEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if (getManager().getClass() == TextDirectEditManager.class) {
- ((TextDirectEditManager) getManager()).show(eventLocation
- .getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if (getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager) getManager()).show(initialCharacter);
- } else //
- {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
- final Request theRequest = request;
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if (isActive() && isEditable()) {
- if (theRequest
- .getExtendedData()
- .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character) theRequest
- .getExtendedData()
- .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if ((theRequest instanceof DirectEditRequest)
- && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest) theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- refreshSelectionFeedback();
- }
-
- /**
- * @generated
- */
- protected void refreshUnderline() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getFigure()).setTextStrikeThrough(style
- .isStrikeThrough());
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFont() {
- FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(
- NotationPackage.eINSTANCE.getFontStyle());
- if (style != null) {
- FontData fontData = new FontData(style.getFontName(),
- style.getFontHeight(), (style.isBold() ? SWT.BOLD
- : SWT.NORMAL)
- | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- /**
- * @generated
- */
- private void refreshSelectionFeedback() {
- requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
- requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
- }
-
- /**
- * @generated
- */
- private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
- Object editPolicy = getEditPolicy(editPolicyKey);
- if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
- ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- /**
- * @generated
- */
- protected void addSemanticListeners() {
- if (getParser() instanceof ISemanticParser) {
- EObject element = resolveSemanticElement();
- parserElements = ((ISemanticParser) getParser())
- .getSemanticElementsBeingParsed(element);
- for (int i = 0; i < parserElements.size(); i++) {
- addListenerFilter(
- "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$
- }
- } else {
- super.addSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected void removeSemanticListeners() {
- if (parserElements != null) {
- for (int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- /**
- * @generated
- */
- protected AccessibleEditPart getAccessibleEditPart() {
- if (accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- /**
- * @generated
- */
- private View getFontStyleOwnerView() {
- return getPrimaryView();
- }
-
- /**
- * @generated
- */
- private ILabelDelegate getLabelDelegate() {
- if (labelDelegate == null) {
- IFigure label = getFigure();
- if (label instanceof WrappingLabel) {
- labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
- } else {
- labelDelegate = new SimpleLabelDelegate((Label) label);
- }
- }
- return labelDelegate;
- }
-
- /**
- * @generated
- */
- @Override
- public Object getAdapter(Class key) {
- if (ILabelDelegate.class.equals(key)) {
- return getLabelDelegate();
- }
- return super.getAdapter(key);
- }
-
- /**
- * @generated
- */
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
- Object feature = event.getFeature();
- if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- Integer c = (Integer) event.getNewValue();
- setFontColor(DiagramColorRegistry.getInstance().getColor(c));
- } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(
- feature)) {
- refreshUnderline();
- } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough()
- .equals(feature)) {
- refreshStrikeThrough();
- } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(
- feature)
- || NotationPackage.eINSTANCE.getFontStyle_FontName().equals(
- feature)
- || NotationPackage.eINSTANCE.getFontStyle_Bold()
- .equals(feature)
- || NotationPackage.eINSTANCE.getFontStyle_Italic().equals(
- feature)) {
- refreshFont();
- } else {
- if (getParser() != null
- && getParser().isAffectingEvent(event,
- getParserOptions().intValue())) {
- refreshLabel();
- }
- if (getParser() instanceof ISemanticParser) {
- ISemanticParser modelParser = (ISemanticParser) getParser();
- if (modelParser.areSemanticElementsAffected(null, event)) {
- removeSemanticListeners();
- if (resolveSemanticElement() != null) {
- addSemanticListeners();
- }
- refreshLabel();
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.edit.parts; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RunnableWithResult; +import org.eclipse.gef.AccessibleEditPart; +import org.eclipse.gef.EditPolicy; +import org.eclipse.gef.Request; +import org.eclipse.gef.requests.DirectEditRequest; +import org.eclipse.gef.tools.DirectEditManager; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; +import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; +import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; +import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate; +import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate; +import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; +import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; +import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; +import org.eclipse.gmf.runtime.notation.FontStyle; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.jface.text.contentassist.IContentAssistProcessor; +import org.eclipse.jface.viewers.ICellEditorValidator; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.policies.UMLTextSelectionEditPolicy; +import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes; +import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLParserProvider; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.draw2d.labels.SimpleLabelDelegate; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy; +import org.eclipse.swt.SWT; +import org.eclipse.swt.accessibility.AccessibleEvent; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; + +/** + * @generated + */ +public class ComponentNameEditPart extends CompartmentEditPart implements + ITextAwareEditPart { + + /** + * @generated + */ + public static final int VISUAL_ID = 5001; + + /** + * @generated + */ + private DirectEditManager manager; + + /** + * @generated + */ + private IParser parser; + + /** + * @generated + */ + private List<?> parserElements; + + /** + * @generated + */ + private String defaultText; + + /** + * @generated + */ + private ILabelDelegate labelDelegate; + + /** + * @generated + */ + public ComponentNameEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, + new UMLTextSelectionEditPolicy()); + installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, + new LabelDirectEditPolicy()); + installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, + new DefaultNodeLabelDragPolicy()); + } + + /** + * @generated + */ + protected String getLabelTextHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getText(); + } else if (figure instanceof Label) { + return ((Label) figure).getText(); + } else { + return getLabelDelegate().getText(); + } + } + + /** + * @generated + */ + protected void setLabelTextHelper(IFigure figure, String text) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setText(text); + } else if (figure instanceof Label) { + ((Label) figure).setText(text); + } else { + getLabelDelegate().setText(text); + } + } + + /** + * @generated + */ + protected Image getLabelIconHelper(IFigure figure) { + if (figure instanceof WrappingLabel) { + return ((WrappingLabel) figure).getIcon(); + } else if (figure instanceof Label) { + return ((Label) figure).getIcon(); + } else { + return getLabelDelegate().getIcon(0); + } + } + + /** + * @generated + */ + protected void setLabelIconHelper(IFigure figure, Image icon) { + if (figure instanceof WrappingLabel) { + ((WrappingLabel) figure).setIcon(icon); + return; + } else if (figure instanceof Label) { + ((Label) figure).setIcon(icon); + return; + } else { + getLabelDelegate().setIcon(icon, 0); + } + } + + /** + * @generated + */ + public void setLabel(WrappingLabel figure) { + unregisterVisuals(); + setFigure(figure); + defaultText = getLabelTextHelper(figure); + registerVisuals(); + refreshVisuals(); + } + + /** + * @generated + */ + @SuppressWarnings("rawtypes") + protected List getModelChildren() { + return Collections.EMPTY_LIST; + } + + /** + * @generated + */ + public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { + return null; + } + + /** + * @generated + */ + protected EObject getParserElement() { + return resolveSemanticElement(); + } + + /** + * @generated + */ + protected Image getLabelIcon() { + EObject parserElement = getParserElement(); + if (parserElement == null) { + return null; + } + return UMLElementTypes.getImage(parserElement.eClass()); + } + + /** + * @generated + */ + protected String getLabelText() { + String text = null; + EObject parserElement = getParserElement(); + if (parserElement != null && getParser() != null) { + text = getParser().getPrintString( + new EObjectAdapter(parserElement), + getParserOptions().intValue()); + } + if (text == null || text.length() == 0) { + text = defaultText; + } + return text; + } + + /** + * @generated + */ + public void setLabelText(String text) { + setLabelTextHelper(getFigure(), text); + refreshSelectionFeedback(); + } + + /** + * @generated + */ + public String getEditText() { + if (getParserElement() == null || getParser() == null) { + return ""; //$NON-NLS-1$ + } + return getParser().getEditString( + new EObjectAdapter(getParserElement()), + getParserOptions().intValue()); + } + + /** + * @generated + */ + protected boolean isEditable() { + return getParser() != null; + } + + /** + * @generated + */ + public ICellEditorValidator getEditTextValidator() { + return new ICellEditorValidator() { + + public String isValid(final Object value) { + if (value instanceof String) { + final EObject element = getParserElement(); + final IParser parser = getParser(); + try { + IParserEditStatus valid = (IParserEditStatus) getEditingDomain() + .runExclusive( + new RunnableWithResult.Impl<IParserEditStatus>() { + + public void run() { + setResult(parser + .isValidEditString( + new EObjectAdapter( + element), + (String) value)); + } + }); + return valid.getCode() == ParserEditStatus.EDITABLE ? null + : valid.getMessage(); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } + } + + // shouldn't get here + return null; + } + }; + } + + /** + * @generated + */ + public IContentAssistProcessor getCompletionProcessor() { + if (getParserElement() == null || getParser() == null) { + return null; + } + return getParser().getCompletionProcessor( + new EObjectAdapter(getParserElement())); + } + + /** + * @generated + */ + public ParserOptions getParserOptions() { + return ParserOptions.NONE; + } + + /** + * @generated + */ + public IParser getParser() { + if (parser == null) { + parser = UMLParserProvider + .getParser( + UMLElementTypes.Component_2001, + getParserElement(), + UMLVisualIDRegistry + .getType(org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentNameEditPart.VISUAL_ID)); + } + return parser; + } + + /** + * @generated + */ + protected DirectEditManager getManager() { + if (manager == null) { + setManager(new TextDirectEditManager(this, null, + UMLEditPartFactory.getTextCellEditorLocator(this))); + } + return manager; + } + + /** + * @generated + */ + protected void setManager(DirectEditManager manager) { + this.manager = manager; + } + + /** + * @generated + */ + protected void performDirectEdit() { + getManager().show(); + } + + /** + * @generated + */ + protected void performDirectEdit(Point eventLocation) { + if (getManager().getClass() == TextDirectEditManager.class) { + ((TextDirectEditManager) getManager()).show(eventLocation + .getSWTPoint()); + } + } + + /** + * @generated + */ + private void performDirectEdit(char initialCharacter) { + if (getManager() instanceof TextDirectEditManager) { + ((TextDirectEditManager) getManager()).show(initialCharacter); + } else // + { + performDirectEdit(); + } + } + + /** + * @generated + */ + protected void performDirectEditRequest(Request request) { + final Request theRequest = request; + try { + getEditingDomain().runExclusive(new Runnable() { + + public void run() { + if (isActive() && isEditable()) { + if (theRequest + .getExtendedData() + .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { + Character initialChar = (Character) theRequest + .getExtendedData() + .get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); + performDirectEdit(initialChar.charValue()); + } else if ((theRequest instanceof DirectEditRequest) + && (getEditText().equals(getLabelText()))) { + DirectEditRequest editRequest = (DirectEditRequest) theRequest; + performDirectEdit(editRequest.getLocation()); + } else { + performDirectEdit(); + } + } + } + }); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + /** + * @generated + */ + protected void refreshVisuals() { + super.refreshVisuals(); + refreshLabel(); + refreshFont(); + refreshFontColor(); + refreshUnderline(); + refreshStrikeThrough(); + } + + /** + * @generated + */ + protected void refreshLabel() { + setLabelTextHelper(getFigure(), getLabelText()); + setLabelIconHelper(getFigure(), getLabelIcon()); + refreshSelectionFeedback(); + } + + /** + * @generated + */ + protected void refreshUnderline() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); + } + } + + /** + * @generated + */ + protected void refreshStrikeThrough() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null && getFigure() instanceof WrappingLabel) { + ((WrappingLabel) getFigure()).setTextStrikeThrough(style + .isStrikeThrough()); + } + } + + /** + * @generated + */ + protected void refreshFont() { + FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( + NotationPackage.eINSTANCE.getFontStyle()); + if (style != null) { + FontData fontData = new FontData(style.getFontName(), + style.getFontHeight(), (style.isBold() ? SWT.BOLD + : SWT.NORMAL) + | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); + setFont(fontData); + } + } + + /** + * @generated + */ + private void refreshSelectionFeedback() { + requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE); + requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE); + } + + /** + * @generated + */ + private void requestEditPolicyFeedbackRefresh(String editPolicyKey) { + Object editPolicy = getEditPolicy(editPolicyKey); + if (editPolicy instanceof IRefreshableFeedbackEditPolicy) { + ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback(); + } + } + + /** + * @generated + */ + protected void setFontColor(Color color) { + getFigure().setForegroundColor(color); + } + + /** + * @generated + */ + protected void addSemanticListeners() { + if (getParser() instanceof ISemanticParser) { + EObject element = resolveSemanticElement(); + parserElements = ((ISemanticParser) getParser()) + .getSemanticElementsBeingParsed(element); + for (int i = 0; i < parserElements.size(); i++) { + addListenerFilter( + "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ + } + } else { + super.addSemanticListeners(); + } + } + + /** + * @generated + */ + protected void removeSemanticListeners() { + if (parserElements != null) { + for (int i = 0; i < parserElements.size(); i++) { + removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ + } + } else { + super.removeSemanticListeners(); + } + } + + /** + * @generated + */ + protected AccessibleEditPart getAccessibleEditPart() { + if (accessibleEP == null) { + accessibleEP = new AccessibleGraphicalEditPart() { + + public void getName(AccessibleEvent e) { + e.result = getLabelTextHelper(getFigure()); + } + }; + } + return accessibleEP; + } + + /** + * @generated + */ + private View getFontStyleOwnerView() { + return getPrimaryView(); + } + + /** + * @generated + */ + private ILabelDelegate getLabelDelegate() { + if (labelDelegate == null) { + IFigure label = getFigure(); + if (label instanceof WrappingLabel) { + labelDelegate = new WrappingLabelDelegate((WrappingLabel) label); + } else { + labelDelegate = new SimpleLabelDelegate((Label) label); + } + } + return labelDelegate; + } + + /** + * @generated + */ + @Override + public Object getAdapter(Class key) { + if (ILabelDelegate.class.equals(key)) { + return getLabelDelegate(); + } + return super.getAdapter(key); + } + + /** + * @generated + */ + protected void addNotationalListeners() { + super.addNotationalListeners(); + addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void removeNotationalListeners() { + super.removeNotationalListeners(); + removeListenerFilter("PrimaryView"); //$NON-NLS-1$ + } + + /** + * @generated + */ + protected void handleNotificationEvent(Notification event) { + Object feature = event.getFeature(); + if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { + Integer c = (Integer) event.getNewValue(); + setFontColor(DiagramColorRegistry.getInstance().getColor(c)); + } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( + feature)) { + refreshUnderline(); + } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() + .equals(feature)) { + refreshStrikeThrough(); + } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( + feature) + || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( + feature) + || NotationPackage.eINSTANCE.getFontStyle_Bold() + .equals(feature) + || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( + feature)) { + refreshFont(); + } else { + if (getParser() != null + && getParser().isAffectingEvent(event, + getParserOptions().intValue())) { + refreshLabel(); + } + if (getParser() instanceof ISemanticParser) { + ISemanticParser modelParser = (ISemanticParser) getParser(); + if (modelParser.areSemanticElementsAffected(null, event)) { + removeSemanticListeners(); + if (resolveSemanticElement() != null) { + addSemanticListeners(); + } + refreshLabel(); + } + } + } + super.handleNotificationEvent(event); + } + + /** + * @generated + */ + protected IFigure createFigure() { + // Parent should assign one using setLabel() method + return null; + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ModelEditPart.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ModelEditPart.java index be41ba5fbee..678a49f74e4 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ModelEditPart.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/ModelEditPart.java @@ -1,48 +1,48 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.edit.parts;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.policies.ModelCanonicalEditPolicy;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.policies.ModelItemSemanticEditPolicy;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent;
-
-/**
- * @generated
- */
-public class ModelEditPart extends DiagramEditPart {
-
- /**
- * @generated
- */
- public final static String MODEL_ID = "PapyrusNewDiagram"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 1000;
-
- /**
- * @generated
- */
- public ModelEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
- new ModelItemSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CANONICAL_ROLE,
- new ModelCanonicalEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE,
- new CreationEditPolicyWithCustomReparent(
- UMLVisualIDRegistry.TYPED_INSTANCE));
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.edit.parts; + +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.policies.ModelCanonicalEditPolicy; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.policies.ModelItemSemanticEditPolicy; +import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent; + +/** + * @generated + */ +public class ModelEditPart extends DiagramEditPart { + + /** + * @generated + */ + public final static String MODEL_ID = "PapyrusNewDiagram"; //$NON-NLS-1$ + + /** + * @generated + */ + public static final int VISUAL_ID = 1000; + + /** + * @generated + */ + public ModelEditPart(View view) { + super(view); + } + + /** + * @generated + */ + protected void createDefaultEditPolicies() { + super.createDefaultEditPolicies(); + installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, + new ModelItemSemanticEditPolicy()); + installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, + new ModelCanonicalEditPolicy()); + installEditPolicy(EditPolicyRoles.CREATION_ROLE, + new CreationEditPolicyWithCustomReparent( + UMLVisualIDRegistry.TYPED_INSTANCE)); + // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/UMLEditPartFactory.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/UMLEditPartFactory.java index 03b6613e17e..4cc67802aa3 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/UMLEditPartFactory.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/parts/UMLEditPartFactory.java @@ -1,54 +1,54 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.edit.parts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.directedit.locator.CellEditorLocatorAccess;
-
-/**
- * @generated
- */
-public class UMLEditPartFactory implements EditPartFactory {
-
- /**
- * @generated
- */
- public EditPart createEditPart(EditPart context, Object model) {
- if (model instanceof View) {
- View view = (View) model;
- switch (UMLVisualIDRegistry.getVisualID(view)) {
-
- case ModelEditPart.VISUAL_ID:
- return new ModelEditPart(view);
-
- case ComponentEditPart.VISUAL_ID:
- return new ComponentEditPart(view);
-
- case ComponentNameEditPart.VISUAL_ID:
- return new ComponentNameEditPart(view);
- }
- }
- return createUnrecognizedEditPart(context, model);
- }
-
- /**
- * @generated
- */
- private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
- // Handle creation of unrecognized child node EditParts here
- return null;
- }
-
- /**
- * @generated
- */
- public static CellEditorLocator getTextCellEditorLocator(
- ITextAwareEditPart source) {
- return CellEditorLocatorAccess.INSTANCE
- .getTextCellEditorLocator(source);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.edit.parts; + +import org.eclipse.gef.EditPart; +import org.eclipse.gef.EditPartFactory; +import org.eclipse.gef.tools.CellEditorLocator; +import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.directedit.locator.CellEditorLocatorAccess; + +/** + * @generated + */ +public class UMLEditPartFactory implements EditPartFactory { + + /** + * @generated + */ + public EditPart createEditPart(EditPart context, Object model) { + if (model instanceof View) { + View view = (View) model; + switch (UMLVisualIDRegistry.getVisualID(view)) { + + case ModelEditPart.VISUAL_ID: + return new ModelEditPart(view); + + case ComponentEditPart.VISUAL_ID: + return new ComponentEditPart(view); + + case ComponentNameEditPart.VISUAL_ID: + return new ComponentNameEditPart(view); + } + } + return createUnrecognizedEditPart(context, model); + } + + /** + * @generated + */ + private EditPart createUnrecognizedEditPart(EditPart context, Object model) { + // Handle creation of unrecognized child node EditParts here + return null; + } + + /** + * @generated + */ + public static CellEditorLocator getTextCellEditorLocator( + ITextAwareEditPart source) { + return CellEditorLocatorAccess.INSTANCE + .getTextCellEditorLocator(source); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLBaseItemSemanticEditPolicy.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLBaseItemSemanticEditPolicy.java index 33c0a1b65f2..2a4c6781840 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLBaseItemSemanticEditPolicy.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLBaseItemSemanticEditPolicy.java @@ -1,295 +1,295 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.edit.policies;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry;
-import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy {
-
- /**
- * Extended request data key to hold editpart visual id.
- * @generated
- */
- public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final IElementType myElementType;
-
- /**
- * @generated
- */
- protected UMLBaseItemSemanticEditPolicy(IElementType elementType) {
- myElementType = elementType;
- }
-
- /**
- * Extended request data key to hold editpart visual id.
- * Add visual id of edited editpart to extended data of the request
- * so command switch can decide what kind of diagram element is being edited.
- * It is done in those cases when it's not possible to deduce diagram
- * element kind from domain element.
- *
- * @generated
- */
- public Command getCommand(Request request) {
- if (request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest) request).getConnectionEditPart()
- .getModel();
- if (view instanceof View) {
- Integer id = new Integer(
- UMLVisualIDRegistry.getVisualID((View) view));
- request.getExtendedData().put(VISUAL_ID_KEY, id);
- }
- }
- return super.getCommand(request);
- }
-
- /**
- * Returns visual id from request parameters.
- * @generated
- */
- protected int getVisualID(IEditCommandRequest request) {
- Object id = request.getParameter(VISUAL_ID_KEY);
- return id instanceof Integer ? ((Integer) id).intValue() : -1;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommand(IEditCommandRequest request) {
- IEditCommandRequest completedRequest = completeRequest(request);
- Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- semanticCommand = getEditHelperCommand(completedRequest,
- semanticCommand);
- if (completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest) completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(
- semanticCommand, destroyRequest) : null;
- }
- return semanticCommand;
- }
-
- /**
- * @generated
- */
- protected Command addDeleteViewCommand(Command mainCommand,
- DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(
- getEditingDomain(), (View) getHost().getModel()));
- return mainCommand == null ? deleteViewCommand : mainCommand
- .chain(deleteViewCommand);
- }
-
- /**
- * @generated
- */
- private Command getEditHelperCommand(IEditCommandRequest request,
- Command editPolicyCommand) {
- if (editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy) editPolicyCommand)
- .getICommand() : new CommandProxy(editPolicyCommand);
- request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND,
- command);
- }
- IElementType requestContextElementType = getContextElementType(request);
- request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE,
- requestContextElementType);
- ICommand command = requestContextElementType.getEditCommand(request);
- request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, null);
- request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, null);
- if (command != null) {
- if (!(command instanceof CompositeTransactionalCommand)) {
- command = new CompositeTransactionalCommand(getEditingDomain(),
- command.getLabel()).compose(command);
- }
- return new ICommandProxy(command);
- }
- return editPolicyCommand;
- }
-
- /**
- * @generated
- */
- private IElementType getContextElementType(IEditCommandRequest request) {
- IElementType requestContextElementType = UMLElementTypes
- .getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType
- : myElementType;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
- if (req instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest) req);
- } else if (req instanceof CreateElementRequest) {
- return getCreateCommand((CreateElementRequest) req);
- } else if (req instanceof ConfigureRequest) {
- return getConfigureCommand((ConfigureRequest) req);
- } else if (req instanceof DestroyElementRequest) {
- return getDestroyElementCommand((DestroyElementRequest) req);
- } else if (req instanceof DestroyReferenceRequest) {
- return getDestroyReferenceCommand((DestroyReferenceRequest) req);
- } else if (req instanceof DuplicateElementsRequest) {
- return getDuplicateCommand((DuplicateElementsRequest) req);
- } else if (req instanceof GetEditContextRequest) {
- return getEditContextCommand((GetEditContextRequest) req);
- } else if (req instanceof MoveRequest) {
- return getMoveCommand((MoveRequest) req);
- } else if (req instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) req);
- } else if (req instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest) req);
- } else if (req instanceof SetRequest) {
- return getSetCommand((SetRequest) req);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getConfigureCommand(ConfigureRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getSetCommand(SetRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getEditContextCommand(GetEditContextRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getMoveCommand(MoveRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(
- ReorientReferenceRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getReorientRelationshipCommand(
- ReorientRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected final Command getGEFWrapper(ICommand cmd) {
- return new ICommandProxy(cmd);
- }
-
- /**
- * Returns editing domain from the host edit part.
- * @generated
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart) getHost()).getEditingDomain();
- }
-
- /**
- * Clean all shortcuts to the host element from the same diagram
- * @generated
- */
- protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
- assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for (Iterator it = view.getDiagram().getChildren().iterator(); it
- .hasNext();) {
- View nextView = (View) it.next();
- if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
- continue;
- }
- cmd.add(new DeleteCommand(getEditingDomain(), nextView));
- }
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.edit.policies; + +import java.util.Iterator; + +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gef.requests.ReconnectRequest; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand; +import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand; +import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy; +import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.helpers.GeneratedEditHelperBase; +import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry; +import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes; + +/** + * @generated + */ +public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy { + + /** + * Extended request data key to hold editpart visual id. + * @generated + */ + public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$ + + /** + * @generated + */ + private final IElementType myElementType; + + /** + * @generated + */ + protected UMLBaseItemSemanticEditPolicy(IElementType elementType) { + myElementType = elementType; + } + + /** + * Extended request data key to hold editpart visual id. + * Add visual id of edited editpart to extended data of the request + * so command switch can decide what kind of diagram element is being edited. + * It is done in those cases when it's not possible to deduce diagram + * element kind from domain element. + * + * @generated + */ + public Command getCommand(Request request) { + if (request instanceof ReconnectRequest) { + Object view = ((ReconnectRequest) request).getConnectionEditPart() + .getModel(); + if (view instanceof View) { + Integer id = new Integer( + UMLVisualIDRegistry.getVisualID((View) view)); + request.getExtendedData().put(VISUAL_ID_KEY, id); + } + } + return super.getCommand(request); + } + + /** + * Returns visual id from request parameters. + * @generated + */ + protected int getVisualID(IEditCommandRequest request) { + Object id = request.getParameter(VISUAL_ID_KEY); + return id instanceof Integer ? ((Integer) id).intValue() : -1; + } + + /** + * @generated + */ + protected Command getSemanticCommand(IEditCommandRequest request) { + IEditCommandRequest completedRequest = completeRequest(request); + Command semanticCommand = getSemanticCommandSwitch(completedRequest); + semanticCommand = getEditHelperCommand(completedRequest, + semanticCommand); + if (completedRequest instanceof DestroyRequest) { + DestroyRequest destroyRequest = (DestroyRequest) completedRequest; + return shouldProceed(destroyRequest) ? addDeleteViewCommand( + semanticCommand, destroyRequest) : null; + } + return semanticCommand; + } + + /** + * @generated + */ + protected Command addDeleteViewCommand(Command mainCommand, + DestroyRequest completedRequest) { + Command deleteViewCommand = getGEFWrapper(new DeleteCommand( + getEditingDomain(), (View) getHost().getModel())); + return mainCommand == null ? deleteViewCommand : mainCommand + .chain(deleteViewCommand); + } + + /** + * @generated + */ + private Command getEditHelperCommand(IEditCommandRequest request, + Command editPolicyCommand) { + if (editPolicyCommand != null) { + ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy) editPolicyCommand) + .getICommand() : new CommandProxy(editPolicyCommand); + request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, + command); + } + IElementType requestContextElementType = getContextElementType(request); + request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, + requestContextElementType); + ICommand command = requestContextElementType.getEditCommand(request); + request.setParameter(GeneratedEditHelperBase.EDIT_POLICY_COMMAND, null); + request.setParameter(GeneratedEditHelperBase.CONTEXT_ELEMENT_TYPE, null); + if (command != null) { + if (!(command instanceof CompositeTransactionalCommand)) { + command = new CompositeTransactionalCommand(getEditingDomain(), + command.getLabel()).compose(command); + } + return new ICommandProxy(command); + } + return editPolicyCommand; + } + + /** + * @generated + */ + private IElementType getContextElementType(IEditCommandRequest request) { + IElementType requestContextElementType = UMLElementTypes + .getElementType(getVisualID(request)); + return requestContextElementType != null ? requestContextElementType + : myElementType; + } + + /** + * @generated + */ + protected Command getSemanticCommandSwitch(IEditCommandRequest req) { + if (req instanceof CreateRelationshipRequest) { + return getCreateRelationshipCommand((CreateRelationshipRequest) req); + } else if (req instanceof CreateElementRequest) { + return getCreateCommand((CreateElementRequest) req); + } else if (req instanceof ConfigureRequest) { + return getConfigureCommand((ConfigureRequest) req); + } else if (req instanceof DestroyElementRequest) { + return getDestroyElementCommand((DestroyElementRequest) req); + } else if (req instanceof DestroyReferenceRequest) { + return getDestroyReferenceCommand((DestroyReferenceRequest) req); + } else if (req instanceof DuplicateElementsRequest) { + return getDuplicateCommand((DuplicateElementsRequest) req); + } else if (req instanceof GetEditContextRequest) { + return getEditContextCommand((GetEditContextRequest) req); + } else if (req instanceof MoveRequest) { + return getMoveCommand((MoveRequest) req); + } else if (req instanceof ReorientReferenceRelationshipRequest) { + return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) req); + } else if (req instanceof ReorientRelationshipRequest) { + return getReorientRelationshipCommand((ReorientRelationshipRequest) req); + } else if (req instanceof SetRequest) { + return getSetCommand((SetRequest) req); + } + return null; + } + + /** + * @generated + */ + protected Command getConfigureCommand(ConfigureRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getCreateCommand(CreateElementRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getSetCommand(SetRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getEditContextCommand(GetEditContextRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getDestroyElementCommand(DestroyElementRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getDuplicateCommand(DuplicateElementsRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getMoveCommand(MoveRequest req) { + return null; + } + + /** + * @generated + */ + protected Command getReorientReferenceRelationshipCommand( + ReorientReferenceRelationshipRequest req) { + return UnexecutableCommand.INSTANCE; + } + + /** + * @generated + */ + protected Command getReorientRelationshipCommand( + ReorientRelationshipRequest req) { + return UnexecutableCommand.INSTANCE; + } + + /** + * @generated + */ + protected final Command getGEFWrapper(ICommand cmd) { + return new ICommandProxy(cmd); + } + + /** + * Returns editing domain from the host edit part. + * @generated + */ + protected TransactionalEditingDomain getEditingDomain() { + return ((IGraphicalEditPart) getHost()).getEditingDomain(); + } + + /** + * Clean all shortcuts to the host element from the same diagram + * @generated + */ + protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) { + assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$ + for (Iterator it = view.getDiagram().getChildren().iterator(); it + .hasNext();) { + View nextView = (View) it.next(); + if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$ + continue; + } + cmd.add(new DeleteCommand(getEditingDomain(), nextView)); + } + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextNonResizableEditPolicy.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextNonResizableEditPolicy.java index c95839130e8..1115682394e 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextNonResizableEditPolicy.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextNonResizableEditPolicy.java @@ -1,229 +1,229 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
-
-/**
- * @generated
- */
-public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx
- implements IRefreshableFeedbackEditPolicy {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(false);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if (getHostFigure() instanceof Label) {
- bounds = ((Label) getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if (getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure
- .setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure
- .setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label) getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if (selectionFeedbackFigure != null) {
- if (selectionFeedbackFigure instanceof Label) {
- updateLabel((Label) selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5,
- 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if (focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
-
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if (hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
- /**
- * @generated
- */
- protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.edit.policies; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.draw2d.ColorConstants; +import org.eclipse.draw2d.Figure; +import org.eclipse.draw2d.FigureListener; +import org.eclipse.draw2d.Graphics; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.RectangleFigure; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.handles.MoveHandle; +import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx; +import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy; + +/** + * @generated + */ +public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx + implements IRefreshableFeedbackEditPolicy { + + /** + * @generated + */ + private IFigure selectionFeedbackFigure; + + /** + * @generated + */ + private IFigure focusFeedbackFigure; + + /** + * @generated + */ + private FigureListener hostPositionListener; + + /** + * @generated + */ + protected void showPrimarySelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + showSelection(); + showFocus(); + } + } + + /** + * @generated + */ + protected void showSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + hideSelection(); + addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure()); + getHostFigure().addFigureListener(getHostPositionListener()); + refreshSelectionFeedback(); + hideFocus(); + } + } + + /** + * @generated + */ + protected void hideSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(false); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (selectionFeedbackFigure != null) { + removeFeedback(selectionFeedbackFigure); + getHostFigure().removeFigureListener(getHostPositionListener()); + selectionFeedbackFigure = null; + } + hideFocus(); + } + } + + /** + * @generated + */ + protected void showFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + hideFocus(); + addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); + refreshFocusFeedback(); + } + } + + /** + * @generated + */ + protected void hideFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (focusFeedbackFigure != null) { + removeFeedback(focusFeedbackFigure); + focusFeedbackFigure = null; + } + } + } + + /** + * @generated + */ + protected Rectangle getFeedbackBounds() { + Rectangle bounds; + if (getHostFigure() instanceof Label) { + bounds = ((Label) getHostFigure()).getTextBounds(); + bounds.intersect(getHostFigure().getBounds()); + } else { + bounds = getHostFigure().getBounds().getCopy(); + } + getHostFigure().getParent().translateToAbsolute(bounds); + getFeedbackLayer().translateToRelative(bounds); + return bounds; + } + + /** + * @generated + */ + protected IFigure createSelectionFeedbackFigure() { + if (getHostFigure() instanceof Label) { + Label feedbackFigure = new Label(); + feedbackFigure.setOpaque(true); + feedbackFigure + .setBackgroundColor(ColorConstants.menuBackgroundSelected); + feedbackFigure + .setForegroundColor(ColorConstants.menuForegroundSelected); + return feedbackFigure; + } else { + RectangleFigure feedbackFigure = new RectangleFigure(); + feedbackFigure.setFill(false); + return feedbackFigure; + } + } + + /** + * @generated + */ + protected IFigure createFocusFeedbackFigure() { + return new Figure() { + + protected void paintFigure(Graphics graphics) { + graphics.drawFocus(getBounds().getResized(-1, -1)); + } + }; + } + + /** + * @generated + */ + protected void updateLabel(Label target) { + Label source = (Label) getHostFigure(); + target.setText(source.getText()); + target.setTextAlignment(source.getTextAlignment()); + target.setFont(source.getFont()); + } + + /** + * @generated + */ + protected void refreshSelectionFeedback() { + if (selectionFeedbackFigure != null) { + if (selectionFeedbackFigure instanceof Label) { + updateLabel((Label) selectionFeedbackFigure); + selectionFeedbackFigure.setBounds(getFeedbackBounds()); + } else { + selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, + 5)); + } + } + } + + /** + * @generated + */ + protected void refreshFocusFeedback() { + if (focusFeedbackFigure != null) { + focusFeedbackFigure.setBounds(getFeedbackBounds()); + } + } + + /** + * @generated + */ + + public void refreshFeedback() { + refreshSelectionFeedback(); + refreshFocusFeedback(); + } + + /** + * @generated + */ + private FigureListener getHostPositionListener() { + if (hostPositionListener == null) { + hostPositionListener = new FigureListener() { + public void figureMoved(IFigure source) { + refreshFeedback(); + } + }; + } + return hostPositionListener; + } + + /** + * @generated + */ + protected List createSelectionHandles() { + MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost()); + moveHandle.setBorder(null); + moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost())); + return Collections.singletonList(moveHandle); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextSelectionEditPolicy.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextSelectionEditPolicy.java index f503e7dab0f..16670d3f351 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextSelectionEditPolicy.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/edit/policies/UMLTextSelectionEditPolicy.java @@ -1,213 +1,213 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.edit.policies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
-
-/**
- * @generated
- */
-public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements
- IRefreshableFeedbackEditPolicy {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(true);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setSelected(false);
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if (getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel) getHostFigure()).setFocus(false);
- } else {
- if (focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if (getHostFigure() instanceof Label) {
- bounds = ((Label) getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if (getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure
- .setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure
- .setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label) getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if (selectionFeedbackFigure != null) {
- if (selectionFeedbackFigure instanceof Label) {
- updateLabel((Label) selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5,
- 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if (focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
-
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if (hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.edit.policies; + +import org.eclipse.draw2d.ColorConstants; +import org.eclipse.draw2d.Figure; +import org.eclipse.draw2d.FigureListener; +import org.eclipse.draw2d.Graphics; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.RectangleFigure; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.gef.editpolicies.SelectionEditPolicy; +import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy; + +/** + * @generated + */ +public class UMLTextSelectionEditPolicy extends SelectionEditPolicy implements + IRefreshableFeedbackEditPolicy { + + /** + * @generated + */ + private IFigure selectionFeedbackFigure; + + /** + * @generated + */ + private IFigure focusFeedbackFigure; + + /** + * @generated + */ + private FigureListener hostPositionListener; + + /** + * @generated + */ + protected void showPrimarySelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + showSelection(); + showFocus(); + } + } + + /** + * @generated + */ + protected void showSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(true); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + hideSelection(); + addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure()); + getHostFigure().addFigureListener(getHostPositionListener()); + refreshSelectionFeedback(); + hideFocus(); + } + } + + /** + * @generated + */ + protected void hideSelection() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setSelected(false); + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (selectionFeedbackFigure != null) { + removeFeedback(selectionFeedbackFigure); + getHostFigure().removeFigureListener(getHostPositionListener()); + selectionFeedbackFigure = null; + } + hideFocus(); + } + } + + /** + * @generated + */ + protected void showFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(true); + } else { + hideFocus(); + addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); + refreshFocusFeedback(); + } + } + + /** + * @generated + */ + protected void hideFocus() { + if (getHostFigure() instanceof WrappingLabel) { + ((WrappingLabel) getHostFigure()).setFocus(false); + } else { + if (focusFeedbackFigure != null) { + removeFeedback(focusFeedbackFigure); + focusFeedbackFigure = null; + } + } + } + + /** + * @generated + */ + protected Rectangle getFeedbackBounds() { + Rectangle bounds; + if (getHostFigure() instanceof Label) { + bounds = ((Label) getHostFigure()).getTextBounds(); + bounds.intersect(getHostFigure().getBounds()); + } else { + bounds = getHostFigure().getBounds().getCopy(); + } + getHostFigure().getParent().translateToAbsolute(bounds); + getFeedbackLayer().translateToRelative(bounds); + return bounds; + } + + /** + * @generated + */ + protected IFigure createSelectionFeedbackFigure() { + if (getHostFigure() instanceof Label) { + Label feedbackFigure = new Label(); + feedbackFigure.setOpaque(true); + feedbackFigure + .setBackgroundColor(ColorConstants.menuBackgroundSelected); + feedbackFigure + .setForegroundColor(ColorConstants.menuForegroundSelected); + return feedbackFigure; + } else { + RectangleFigure feedbackFigure = new RectangleFigure(); + feedbackFigure.setFill(false); + return feedbackFigure; + } + } + + /** + * @generated + */ + protected IFigure createFocusFeedbackFigure() { + return new Figure() { + + protected void paintFigure(Graphics graphics) { + graphics.drawFocus(getBounds().getResized(-1, -1)); + } + }; + } + + /** + * @generated + */ + protected void updateLabel(Label target) { + Label source = (Label) getHostFigure(); + target.setText(source.getText()); + target.setTextAlignment(source.getTextAlignment()); + target.setFont(source.getFont()); + } + + /** + * @generated + */ + protected void refreshSelectionFeedback() { + if (selectionFeedbackFigure != null) { + if (selectionFeedbackFigure instanceof Label) { + updateLabel((Label) selectionFeedbackFigure); + selectionFeedbackFigure.setBounds(getFeedbackBounds()); + } else { + selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, + 5)); + } + } + } + + /** + * @generated + */ + protected void refreshFocusFeedback() { + if (focusFeedbackFigure != null) { + focusFeedbackFigure.setBounds(getFeedbackBounds()); + } + } + + /** + * @generated + */ + + public void refreshFeedback() { + refreshSelectionFeedback(); + refreshFocusFeedback(); + } + + /** + * @generated + */ + private FigureListener getHostPositionListener() { + if (hostPositionListener == null) { + hostPositionListener = new FigureListener() { + public void figureMoved(IFigure source) { + refreshFeedback(); + } + }; + } + return hostPositionListener; + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/AbstractParser.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/AbstractParser.java index 0cb00c061a7..dbcb00f1c27 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/AbstractParser.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/AbstractParser.java @@ -1 +1 @@ -//Since GMFT 3.1 we don't generate class AbstractParser into every diagram, instead extend org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser.
+//Since GMFT 3.1 we don't generate class AbstractParser into every diagram, instead extend org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser. diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java index 0eefacbc76e..e233f14d26e 100755 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/parsers/MessageFormatParser.java @@ -1,204 +1,204 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.parsers;
-
-import java.text.FieldPosition;
-import java.text.MessageFormat;
-import java.text.ParsePosition;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.Messages;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class MessageFormatParser extends AbstractAttributeParser {
-
- /**
- * @generated
- */
- private String defaultPattern;
- /**
- * @generated
- */
- private String defaultEditablePattern;
-
- /**
- * @generated
- */
- private MessageFormat viewProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editorProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editProcessor;
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features) {
- super(features);
- }
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features,
- EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- /**
- * @generated
- */
- protected String getDefaultPattern() {
- if (defaultPattern == null) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < features.length; i++) {
- if (i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultPattern = sb.toString();
- }
- return defaultPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- super.setViewPattern(viewPattern);
- viewProcessor = null;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- super.setEditorPattern(editorPattern);
- editorProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getViewProcessor() {
- if (viewProcessor == null) {
- viewProcessor = new MessageFormat(
- getViewPattern() == null ? getDefaultPattern()
- : getViewPattern());
- }
- return viewProcessor;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditorProcessor() {
- if (editorProcessor == null) {
- editorProcessor = new MessageFormat(
- getEditorPattern() == null ? getDefaultEditablePattern()
- : getEditorPattern());
- }
- return editorProcessor;
- }
-
- /**
- * @generated
- */
- protected String getDefaultEditablePattern() {
- if (defaultEditablePattern == null) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < editableFeatures.length; i++) {
- if (i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultEditablePattern = sb.toString();
- }
- return defaultEditablePattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- super.setEditPattern(editPattern);
- editProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditProcessor() {
- if (editProcessor == null) {
- editProcessor = new MessageFormat(
- getEditPattern() == null ? getDefaultEditablePattern()
- : getEditPattern());
- }
- return editProcessor;
- }
-
- /**
- * @generated
- */
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject) adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element),
- new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * @generated
- */
- public IParserEditStatus isValidEditString(IAdaptable adapter,
- String editString) {
- ParsePosition pos = new ParsePosition(0);
- Object[] values = getEditProcessor().parse(editString, pos);
- if (values == null) {
- return new ParserEditStatus(UMLDiagramEditorPlugin.ID,
- IParserEditStatus.UNEDITABLE, NLS.bind(
- Messages.MessageFormatParser_InvalidInputError,
- new Integer(pos.getErrorIndex())));
- }
- return validateNewValues(values);
- }
-
- /**
- * @generated
- */
- public ICommand getParseCommand(IAdaptable adapter, String newString,
- int flags) {
- Object[] values = getEditProcessor().parse(newString,
- new ParsePosition(0));
- return getParseCommand(adapter, values, flags);
- }
-
- /**
- * @generated
- */
- public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject) adapter.getAdapter(EObject.class);
- return getViewProcessor().format(getValues(element),
- new StringBuffer(), new FieldPosition(0)).toString();
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.parsers; + +import java.text.FieldPosition; +import java.text.MessageFormat; +import java.text.ParsePosition; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.common.core.command.ICommand; +import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; +import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.parsers.AbstractAttributeParser; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.example.diagram.simplediagram.part.Messages; +import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorPlugin; + +/** + * @generated + */ +public class MessageFormatParser extends AbstractAttributeParser { + + /** + * @generated + */ + private String defaultPattern; + /** + * @generated + */ + private String defaultEditablePattern; + + /** + * @generated + */ + private MessageFormat viewProcessor; + + /** + * @generated + */ + private MessageFormat editorProcessor; + + /** + * @generated + */ + private MessageFormat editProcessor; + + /** + * @generated + */ + public MessageFormatParser(EAttribute[] features) { + super(features); + } + + /** + * @generated + */ + public MessageFormatParser(EAttribute[] features, + EAttribute[] editableFeatures) { + super(features, editableFeatures); + } + + /** + * @generated + */ + protected String getDefaultPattern() { + if (defaultPattern == null) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < features.length; i++) { + if (i > 0) { + sb.append(' '); + } + sb.append('{'); + sb.append(i); + sb.append('}'); + } + defaultPattern = sb.toString(); + } + return defaultPattern; + } + + /** + * @generated + */ + public void setViewPattern(String viewPattern) { + super.setViewPattern(viewPattern); + viewProcessor = null; + } + + /** + * @generated + */ + public void setEditorPattern(String editorPattern) { + super.setEditorPattern(editorPattern); + editorProcessor = null; + } + + /** + * @generated + */ + protected MessageFormat getViewProcessor() { + if (viewProcessor == null) { + viewProcessor = new MessageFormat( + getViewPattern() == null ? getDefaultPattern() + : getViewPattern()); + } + return viewProcessor; + } + + /** + * @generated + */ + protected MessageFormat getEditorProcessor() { + if (editorProcessor == null) { + editorProcessor = new MessageFormat( + getEditorPattern() == null ? getDefaultEditablePattern() + : getEditorPattern()); + } + return editorProcessor; + } + + /** + * @generated + */ + protected String getDefaultEditablePattern() { + if (defaultEditablePattern == null) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < editableFeatures.length; i++) { + if (i > 0) { + sb.append(' '); + } + sb.append('{'); + sb.append(i); + sb.append('}'); + } + defaultEditablePattern = sb.toString(); + } + return defaultEditablePattern; + } + + /** + * @generated + */ + public void setEditPattern(String editPattern) { + super.setEditPattern(editPattern); + editProcessor = null; + } + + /** + * @generated + */ + protected MessageFormat getEditProcessor() { + if (editProcessor == null) { + editProcessor = new MessageFormat( + getEditPattern() == null ? getDefaultEditablePattern() + : getEditPattern()); + } + return editProcessor; + } + + /** + * @generated + */ + public String getEditString(IAdaptable adapter, int flags) { + EObject element = (EObject) adapter.getAdapter(EObject.class); + return getEditorProcessor().format(getEditableValues(element), + new StringBuffer(), new FieldPosition(0)).toString(); + } + + /** + * @generated + */ + public IParserEditStatus isValidEditString(IAdaptable adapter, + String editString) { + ParsePosition pos = new ParsePosition(0); + Object[] values = getEditProcessor().parse(editString, pos); + if (values == null) { + return new ParserEditStatus(UMLDiagramEditorPlugin.ID, + IParserEditStatus.UNEDITABLE, NLS.bind( + Messages.MessageFormatParser_InvalidInputError, + new Integer(pos.getErrorIndex()))); + } + return validateNewValues(values); + } + + /** + * @generated + */ + public ICommand getParseCommand(IAdaptable adapter, String newString, + int flags) { + Object[] values = getEditProcessor().parse(newString, + new ParsePosition(0)); + return getParseCommand(adapter, values, flags); + } + + /** + * @generated + */ + public String getPrintString(IAdaptable adapter, int flags) { + EObject element = (EObject) adapter.getAdapter(EObject.class); + return getViewProcessor().format(getValues(element), + new StringBuffer(), new FieldPosition(0)).toString(); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/LoadResourceAction.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/LoadResourceAction.java index cb3f66e6736..2b95f2bc404 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/LoadResourceAction.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/LoadResourceAction.java @@ -1,18 +1,18 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.actions.DefaultLoadResourceAction;
-
-/**
- * @generated
- */
-public class LoadResourceAction extends DefaultLoadResourceAction {
- /**
- * @generated
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- return super.execute(event);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.actions.DefaultLoadResourceAction; + +/** + * @generated + */ +public class LoadResourceAction extends DefaultLoadResourceAction { + /** + * @generated + */ + public Object execute(ExecutionEvent event) throws ExecutionException { + return super.execute(event); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/ModelElementSelectionPage.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/ModelElementSelectionPage.java index 58346c37a77..06722211dc6 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/ModelElementSelectionPage.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/ModelElementSelectionPage.java @@ -1,27 +1,27 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultModelElementSelectionPage;
-
-/**
- * Wizard page that allows to select element from model.
- * @generated
- */
-public class ModelElementSelectionPage extends DefaultModelElementSelectionPage {
-
- /**
- * @generated
- */
- public ModelElementSelectionPage(String pageName) {
- super(UMLDiagramEditorPlugin.getInstance()
- .getItemProvidersAdapterFactory(), pageName);
- }
-
- /**
- * Override to provide custom model element description.
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.ModelElementSelectionPageMessage;
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultModelElementSelectionPage; + +/** + * Wizard page that allows to select element from model. + * @generated + */ +public class ModelElementSelectionPage extends DefaultModelElementSelectionPage { + + /** + * @generated + */ + public ModelElementSelectionPage(String pageName) { + super(UMLDiagramEditorPlugin.getInstance() + .getItemProvidersAdapterFactory(), pageName); + } + + /** + * Override to provide custom model element description. + * @generated + */ + protected String getSelectionTitle() { + return Messages.ModelElementSelectionPageMessage; + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorPlugin.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorPlugin.java index 137c5ce3d47..d95ab2f9bd5 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorPlugin.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorPlugin.java @@ -1,256 +1,256 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.LogHelper;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.example.diagram.simplediagram.providers.ElementInitializers;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorPlugin extends AbstractUIPlugin {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.example.diagram.simplediagram"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private LogHelper myLogHelper;
-
- /**
- * @generated
- */
- public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(
- ID);
-
- /**
- * @generated
- */
- private static UMLDiagramEditorPlugin instance;
-
- /**
- * @generated
- */
- private ComposedAdapterFactory adapterFactory;
-
- /**
- * @generated
- */
- private UMLDocumentProvider documentProvider;
-
- /**
- * @generated
- */
- private ElementInitializers initializers;
-
- /**
- * @generated
- */
- public UMLDiagramEditorPlugin() {
- }
-
- /**
- * @generated
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- instance = this;
- myLogHelper = new LogHelper(this);
- PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT,
- getPreferenceStore());
- adapterFactory = createAdapterFactory();
- }
-
- /**
- * @generated
- */
- public void stop(BundleContext context) throws Exception {
- adapterFactory.dispose();
- adapterFactory = null;
- initializers = null;
- instance = null;
- super.stop(context);
- }
-
- /**
- * @generated
- */
- public static UMLDiagramEditorPlugin getInstance() {
- return instance;
- }
-
- /**
- * @generated
- */
- protected ComposedAdapterFactory createAdapterFactory() {
- ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>();
- fillItemProviderFactories(factories);
- return new ComposedAdapterFactory(factories);
- }
-
- /**
- * @generated
- */
- protected void fillItemProviderFactories(List<AdapterFactory> factories) {
- factories.add(new UMLItemProviderAdapterFactory());
- factories.add(new EcoreItemProviderAdapterFactory());
- factories.add(new ResourceItemProviderAdapterFactory());
- factories.add(new ReflectiveItemProviderAdapterFactory());
- }
-
- /**
- * @generated
- */
- public AdapterFactory getItemProvidersAdapterFactory() {
- return adapterFactory;
- }
-
- /**
- * @generated
- */
- public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory
- .adapt(item, IItemLabelProvider.class);
- if (labelProvider != null) {
- return ExtendedImageRegistry.getInstance().getImageDescriptor(
- labelProvider.getImage(item));
- }
- return null;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @generated
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getBundledImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }
-
- /**
- * Respects images residing in any plug-in. If path is relative,
- * then this bundle is looked up for the image, otherwise, for absolute
- * path, first segment is taken as id of plug-in with image
- *
- * @generated
- * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images
- * @return the image descriptor
- */
- public static ImageDescriptor findImageDescriptor(String path) {
- final IPath p = new Path(path);
- if (p.isAbsolute() && p.segmentCount() > 1) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
- .removeFirstSegments(1).makeAbsolute().toString());
- } else {
- return getBundledImageDescriptor(p.makeAbsolute().toString());
- }
- }
-
- /**
- * Returns an image for the image file at the given plugin relative path.
- * Client do not need to dispose this image. Images will be disposed automatically.
- *
- * @generated
- * @param path the path
- * @return image instance
- */
- public Image getBundledImage(String path) {
- Image image = getImageRegistry().get(path);
- if (image == null) {
- getImageRegistry().put(path, getBundledImageDescriptor(path));
- image = getImageRegistry().get(path);
- }
- return image;
- }
-
- /**
- * Returns string from plug-in's resource bundle
- *
- * @generated
- */
- public static String getString(String key) {
- return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public UMLDocumentProvider getDocumentProvider() {
- if (documentProvider == null) {
- documentProvider = new UMLDocumentProvider();
- }
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public ElementInitializers getElementInitializers() {
- return initializers;
- }
-
- /**
- * @generated
- */
- public void setElementInitializers(ElementInitializers i) {
- this.initializers = i;
- }
-
- /**
- * @generated
- */
- public void logError(String error) {
- getLogHelper().logError(error, null);
- }
-
- /**
- * @generated
- */
- public void logError(String error, Throwable throwable) {
- getLogHelper().logError(error, throwable);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message) {
- getLogHelper().logInfo(message, null);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message, Throwable throwable) {
- getLogHelper().logInfo(message, throwable);
- }
-
- /**
- * @generated
- */
- public LogHelper getLogHelper() {
- return myLogHelper;
- }
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; +import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; +import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.LogHelper; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.papyrus.example.diagram.simplediagram.providers.ElementInitializers; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory; +import org.osgi.framework.BundleContext; + +/** + * @generated + */ +public class UMLDiagramEditorPlugin extends AbstractUIPlugin { + + /** + * @generated + */ + public static final String ID = "org.eclipse.papyrus.example.diagram.simplediagram"; //$NON-NLS-1$ + + /** + * @generated + */ + private LogHelper myLogHelper; + + /** + * @generated + */ + public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint( + ID); + + /** + * @generated + */ + private static UMLDiagramEditorPlugin instance; + + /** + * @generated + */ + private ComposedAdapterFactory adapterFactory; + + /** + * @generated + */ + private UMLDocumentProvider documentProvider; + + /** + * @generated + */ + private ElementInitializers initializers; + + /** + * @generated + */ + public UMLDiagramEditorPlugin() { + } + + /** + * @generated + */ + public void start(BundleContext context) throws Exception { + super.start(context); + instance = this; + myLogHelper = new LogHelper(this); + PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, + getPreferenceStore()); + adapterFactory = createAdapterFactory(); + } + + /** + * @generated + */ + public void stop(BundleContext context) throws Exception { + adapterFactory.dispose(); + adapterFactory = null; + initializers = null; + instance = null; + super.stop(context); + } + + /** + * @generated + */ + public static UMLDiagramEditorPlugin getInstance() { + return instance; + } + + /** + * @generated + */ + protected ComposedAdapterFactory createAdapterFactory() { + ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>(); + fillItemProviderFactories(factories); + return new ComposedAdapterFactory(factories); + } + + /** + * @generated + */ + protected void fillItemProviderFactories(List<AdapterFactory> factories) { + factories.add(new UMLItemProviderAdapterFactory()); + factories.add(new EcoreItemProviderAdapterFactory()); + factories.add(new ResourceItemProviderAdapterFactory()); + factories.add(new ReflectiveItemProviderAdapterFactory()); + } + + /** + * @generated + */ + public AdapterFactory getItemProvidersAdapterFactory() { + return adapterFactory; + } + + /** + * @generated + */ + public ImageDescriptor getItemImageDescriptor(Object item) { + IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory + .adapt(item, IItemLabelProvider.class); + if (labelProvider != null) { + return ExtendedImageRegistry.getInstance().getImageDescriptor( + labelProvider.getImage(item)); + } + return null; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path. + * + * @generated + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getBundledImageDescriptor(String path) { + return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path); + } + + /** + * Respects images residing in any plug-in. If path is relative, + * then this bundle is looked up for the image, otherwise, for absolute + * path, first segment is taken as id of plug-in with image + * + * @generated + * @param path the path to image, either absolute (with plug-in id as first segment), or relative for bundled images + * @return the image descriptor + */ + public static ImageDescriptor findImageDescriptor(String path) { + final IPath p = new Path(path); + if (p.isAbsolute() && p.segmentCount() > 1) { + return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p + .removeFirstSegments(1).makeAbsolute().toString()); + } else { + return getBundledImageDescriptor(p.makeAbsolute().toString()); + } + } + + /** + * Returns an image for the image file at the given plugin relative path. + * Client do not need to dispose this image. Images will be disposed automatically. + * + * @generated + * @param path the path + * @return image instance + */ + public Image getBundledImage(String path) { + Image image = getImageRegistry().get(path); + if (image == null) { + getImageRegistry().put(path, getBundledImageDescriptor(path)); + image = getImageRegistry().get(path); + } + return image; + } + + /** + * Returns string from plug-in's resource bundle + * + * @generated + */ + public static String getString(String key) { + return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$ + } + + /** + * @generated + */ + public UMLDocumentProvider getDocumentProvider() { + if (documentProvider == null) { + documentProvider = new UMLDocumentProvider(); + } + return documentProvider; + } + + /** + * @generated + */ + public ElementInitializers getElementInitializers() { + return initializers; + } + + /** + * @generated + */ + public void setElementInitializers(ElementInitializers i) { + this.initializers = i; + } + + /** + * @generated + */ + public void logError(String error) { + getLogHelper().logError(error, null); + } + + /** + * @generated + */ + public void logError(String error, Throwable throwable) { + getLogHelper().logError(error, throwable); + } + + /** + * @generated + */ + public void logInfo(String message) { + getLogHelper().logInfo(message, null); + } + + /** + * @generated + */ + public void logInfo(String message, Throwable throwable) { + getLogHelper().logInfo(message, throwable); + } + + /** + * @generated + */ + public LogHelper getLogHelper() { + return myLogHelper; + } +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorUtil.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorUtil.java index edf1dbc14ad..1232543e24a 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorUtil.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramEditorUtil.java @@ -1,398 +1,398 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class UMLDiagramEditorUtil {
-
- /**
- * @generated
- */
- public static Map<?, ?> getSaveOptions() {
- HashMap<String, Object> saveOptions = new HashMap<String, Object>();
- saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED,
- Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
- return saveOptions;
- }
-
- /**
- * @generated
- */
- public static boolean openDiagram(Resource diagram)
- throws PartInitException {
- String path = diagram.getURI().toPlatformString(true);
- IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot()
- .findMember(new Path(path));
- if (workspaceResource instanceof IFile) {
- IWorkbenchPage page = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- return null != page.openEditor(new FileEditorInput(
- (IFile) workspaceResource), UMLDiagramEditor.ID);
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static void setCharset(IFile file) {
- if (file == null) {
- return;
- }
- try {
- file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$
- } catch (CoreException e) {
- UMLDiagramEditorPlugin.getInstance().logError(
- "Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static String getUniqueFileName(IPath containerFullPath,
- String fileName, String extension) {
- return DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath,
- fileName, extension,
- DefaultDiagramEditorUtil.EXISTS_IN_WORKSPACE);
- }
-
- /**
- * Runs the wizard in a dialog.
- *
- * @generated
- */
- public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
- IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin
- .getInstance().getDialogSettings();
- IDialogSettings wizardDialogSettings = pluginDialogSettings
- .getSection(settingsKey);
- if (wizardDialogSettings == null) {
- wizardDialogSettings = pluginDialogSettings
- .addNewSection(settingsKey);
- }
- wizard.setDialogSettings(wizardDialogSettings);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x),
- 500);
- dialog.open();
- }
-
- /**
- * This method should be called within a workspace modify operation since it creates resources.
- * @generated
- */
- public static Resource createDiagram(URI diagramURI, URI modelURI,
- IProgressMonitor progressMonitor) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE
- .createEditingDomain();
- progressMonitor.beginTask(
- Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3);
- final Resource diagramResource = editingDomain.getResourceSet()
- .createResource(diagramURI);
- final Resource modelResource = editingDomain.getResourceSet()
- .createResource(modelURI);
- final String diagramName = diagramURI.lastSegment();
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(
- editingDomain,
- Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel,
- Collections.EMPTY_LIST) {
- protected CommandResult doExecuteWithResult(
- IProgressMonitor monitor, IAdaptable info)
- throws ExecutionException {
- Model model = createInitialModel();
- attachModelToResource(model, modelResource);
-
- Diagram diagram = ViewService.createDiagram(model,
- ModelEditPart.MODEL_ID,
- UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if (diagram != null) {
- diagramResource.getContents().add(diagram);
- diagram.setName(diagramName);
- diagram.setElement(model);
- }
-
- try {
- modelResource
- .save(org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorUtil
- .getSaveOptions());
- diagramResource
- .save(org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorUtil
- .getSaveOptions());
- } catch (IOException e) {
-
- UMLDiagramEditorPlugin.getInstance().logError(
- "Unable to store model and diagram resources", e); //$NON-NLS-1$
- }
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command,
- new SubProgressMonitor(progressMonitor, 1), null);
- } catch (ExecutionException e) {
- UMLDiagramEditorPlugin.getInstance().logError(
- "Unable to create model and diagram", e); //$NON-NLS-1$
- }
- setCharset(WorkspaceSynchronizer.getFile(modelResource));
- setCharset(WorkspaceSynchronizer.getFile(diagramResource));
- return diagramResource;
- }
-
- /**
- * Create a new instance of domain element associated with canvas.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static Model createInitialModel() {
- return UMLFactory.eINSTANCE.createModel();
- }
-
- /**
- * Store model element in the resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static void attachModelToResource(Model model, Resource resource) {
- resource.getContents().add(model);
- }
-
- /**
- * @generated
- */
- public static void selectElementsInDiagram(
- IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
- diagramPart.getDiagramGraphicalViewer().deselectAll();
-
- EditPart firstPrimary = null;
- for (EditPart nextPart : editParts) {
- diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
- firstPrimary = nextPart;
- }
- }
-
- if (!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(
- firstPrimary != null ? firstPrimary : (EditPart) editParts
- .get(0));
- }
- }
-
- /**
- * @generated
- */
- private static int findElementsInDiagramByID(DiagramEditPart diagramPart,
- EObject element, List<EditPart> editPartCollector) {
- IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart
- .getViewer();
- final int intialNumOfEditParts = editPartCollector.size();
-
- if (element instanceof View) { // support notation element lookup
- EditPart editPart = (EditPart) viewer.getEditPartRegistry().get(
- element);
- if (editPart != null) {
- editPartCollector.add(editPart);
- return 1;
- }
- }
-
- String elementID = EMFCoreUtil.getProxyID(element);
- @SuppressWarnings("unchecked")
- List<EditPart> associatedParts = viewer.findEditPartsForElement(
- elementID, IGraphicalEditPart.class);
- // perform the possible hierarchy disjoint -> take the top-most parts only
- for (EditPart nextPart : associatedParts) {
- EditPart parentPart = nextPart.getParent();
- while (parentPart != null && !associatedParts.contains(parentPart)) {
- parentPart = parentPart.getParent();
- }
- if (parentPart == null) {
- editPartCollector.add(nextPart);
- }
- }
-
- if (intialNumOfEditParts == editPartCollector.size()) {
- if (!associatedParts.isEmpty()) {
- editPartCollector.add(associatedParts.get(0));
- } else {
- if (element.eContainer() != null) {
- return findElementsInDiagramByID(diagramPart,
- element.eContainer(), editPartCollector);
- }
- }
- }
- return editPartCollector.size() - intialNumOfEditParts;
- }
-
- /**
- * @generated
- */
- public static View findView(DiagramEditPart diagramEditPart,
- EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) {
- boolean hasStructuralURI = false;
- if (targetElement.eResource() instanceof XMLResource) {
- hasStructuralURI = ((XMLResource) targetElement.eResource())
- .getID(targetElement) == null;
- }
-
- View view = null;
- LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>();
- if (hasStructuralURI
- && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
- view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
- } else if (findElementsInDiagramByID(diagramEditPart, targetElement,
- editPartHolder) > 0) {
- EditPart editPart = editPartHolder.get(0);
- view = editPart.getModel() instanceof View ? (View) editPart
- .getModel() : null;
- }
-
- return (view == null) ? diagramEditPart.getDiagramView() : view;
- }
-
- /**
- * XXX This is quite suspicious code (especially editPartTmpHolder) and likely to be removed soon
- * @generated
- */
- public static class LazyElement2ViewMap {
- /**
- * @generated
- */
- private Map<EObject, View> element2ViewMap;
-
- /**
- * @generated
- */
- private View scope;
-
- /**
- * @generated
- */
- private Set<? extends EObject> elementSet;
-
- /**
- * @generated
- */
- public LazyElement2ViewMap(View scope, Set<? extends EObject> elements) {
- this.scope = scope;
- this.elementSet = elements;
- }
-
- /**
- * @generated
- */
- public final Map<EObject, View> getElement2ViewMap() {
- if (element2ViewMap == null) {
- element2ViewMap = new HashMap<EObject, View>();
- // map possible notation elements to itself as these can't be found by view.getElement()
- for (EObject element : elementSet) {
- if (element instanceof View) {
- View view = (View) element;
- if (view.getDiagram() == scope.getDiagram()) {
- element2ViewMap.put(element, view); // take only those that part of our diagram
- }
- }
- }
-
- buildElement2ViewMap(scope, element2ViewMap, elementSet);
- }
- return element2ViewMap;
- }
-
- /**
- * @generated
- */
- private static boolean buildElement2ViewMap(View parentView,
- Map<EObject, View> element2ViewMap,
- Set<? extends EObject> elements) {
- if (elements.size() == element2ViewMap.size()) {
- return true;
- }
-
- if (parentView.isSetElement()
- && !element2ViewMap.containsKey(parentView.getElement())
- && elements.contains(parentView.getElement())) {
- element2ViewMap.put(parentView.getElement(), parentView);
- if (elements.size() == element2ViewMap.size()) {
- return true;
- }
- }
- boolean complete = false;
- for (Iterator<?> it = parentView.getChildren().iterator(); it
- .hasNext() && !complete;) {
- complete = buildElement2ViewMap((View) it.next(),
- element2ViewMap, elements);
- }
- for (Iterator<?> it = parentView.getSourceEdges().iterator(); it
- .hasNext() && !complete;) {
- complete = buildElement2ViewMap((View) it.next(),
- element2ViewMap, elements);
- }
- for (Iterator<?> it = parentView.getTargetEdges().iterator(); it
- .hasNext() && !complete;) {
- complete = buildElement2ViewMap((View) it.next(),
- element2ViewMap, elements);
- }
- return complete;
- }
- } //LazyElement2ViewMap
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.OperationHistoryFactory; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.SubProgressMonitor; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gef.EditPart; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.diagram.core.services.ViewService; +import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; +import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart; +import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer; +import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory; +import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultDiagramEditorUtil; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.UMLFactory; + +/** + * @generated + */ +public class UMLDiagramEditorUtil { + + /** + * @generated + */ + public static Map<?, ?> getSaveOptions() { + HashMap<String, Object> saveOptions = new HashMap<String, Object>(); + saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, + Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + return saveOptions; + } + + /** + * @generated + */ + public static boolean openDiagram(Resource diagram) + throws PartInitException { + String path = diagram.getURI().toPlatformString(true); + IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot() + .findMember(new Path(path)); + if (workspaceResource instanceof IFile) { + IWorkbenchPage page = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage(); + return null != page.openEditor(new FileEditorInput( + (IFile) workspaceResource), UMLDiagramEditor.ID); + } + return false; + } + + /** + * @generated + */ + public static void setCharset(IFile file) { + if (file == null) { + return; + } + try { + file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$ + } catch (CoreException e) { + UMLDiagramEditorPlugin.getInstance().logError( + "Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$ + } + } + + /** + * @generated + */ + public static String getUniqueFileName(IPath containerFullPath, + String fileName, String extension) { + return DefaultDiagramEditorUtil.getUniqueFileName(containerFullPath, + fileName, extension, + DefaultDiagramEditorUtil.EXISTS_IN_WORKSPACE); + } + + /** + * Runs the wizard in a dialog. + * + * @generated + */ + public static void runWizard(Shell shell, Wizard wizard, String settingsKey) { + IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin + .getInstance().getDialogSettings(); + IDialogSettings wizardDialogSettings = pluginDialogSettings + .getSection(settingsKey); + if (wizardDialogSettings == null) { + wizardDialogSettings = pluginDialogSettings + .addNewSection(settingsKey); + } + wizard.setDialogSettings(wizardDialogSettings); + WizardDialog dialog = new WizardDialog(shell, wizard); + dialog.create(); + dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), + 500); + dialog.open(); + } + + /** + * This method should be called within a workspace modify operation since it creates resources. + * @generated + */ + public static Resource createDiagram(URI diagramURI, URI modelURI, + IProgressMonitor progressMonitor) { + TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE + .createEditingDomain(); + progressMonitor.beginTask( + Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3); + final Resource diagramResource = editingDomain.getResourceSet() + .createResource(diagramURI); + final Resource modelResource = editingDomain.getResourceSet() + .createResource(modelURI); + final String diagramName = diagramURI.lastSegment(); + AbstractTransactionalCommand command = new AbstractTransactionalCommand( + editingDomain, + Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, + Collections.EMPTY_LIST) { + protected CommandResult doExecuteWithResult( + IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + Model model = createInitialModel(); + attachModelToResource(model, modelResource); + + Diagram diagram = ViewService.createDiagram(model, + ModelEditPart.MODEL_ID, + UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); + if (diagram != null) { + diagramResource.getContents().add(diagram); + diagram.setName(diagramName); + diagram.setElement(model); + } + + try { + modelResource + .save(org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorUtil + .getSaveOptions()); + diagramResource + .save(org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorUtil + .getSaveOptions()); + } catch (IOException e) { + + UMLDiagramEditorPlugin.getInstance().logError( + "Unable to store model and diagram resources", e); //$NON-NLS-1$ + } + return CommandResult.newOKCommandResult(); + } + }; + try { + OperationHistoryFactory.getOperationHistory().execute(command, + new SubProgressMonitor(progressMonitor, 1), null); + } catch (ExecutionException e) { + UMLDiagramEditorPlugin.getInstance().logError( + "Unable to create model and diagram", e); //$NON-NLS-1$ + } + setCharset(WorkspaceSynchronizer.getFile(modelResource)); + setCharset(WorkspaceSynchronizer.getFile(diagramResource)); + return diagramResource; + } + + /** + * Create a new instance of domain element associated with canvas. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static Model createInitialModel() { + return UMLFactory.eINSTANCE.createModel(); + } + + /** + * Store model element in the resource. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static void attachModelToResource(Model model, Resource resource) { + resource.getContents().add(model); + } + + /** + * @generated + */ + public static void selectElementsInDiagram( + IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) { + diagramPart.getDiagramGraphicalViewer().deselectAll(); + + EditPart firstPrimary = null; + for (EditPart nextPart : editParts) { + diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart); + if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) { + firstPrimary = nextPart; + } + } + + if (!editParts.isEmpty()) { + diagramPart.getDiagramGraphicalViewer().reveal( + firstPrimary != null ? firstPrimary : (EditPart) editParts + .get(0)); + } + } + + /** + * @generated + */ + private static int findElementsInDiagramByID(DiagramEditPart diagramPart, + EObject element, List<EditPart> editPartCollector) { + IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart + .getViewer(); + final int intialNumOfEditParts = editPartCollector.size(); + + if (element instanceof View) { // support notation element lookup + EditPart editPart = (EditPart) viewer.getEditPartRegistry().get( + element); + if (editPart != null) { + editPartCollector.add(editPart); + return 1; + } + } + + String elementID = EMFCoreUtil.getProxyID(element); + @SuppressWarnings("unchecked") + List<EditPart> associatedParts = viewer.findEditPartsForElement( + elementID, IGraphicalEditPart.class); + // perform the possible hierarchy disjoint -> take the top-most parts only + for (EditPart nextPart : associatedParts) { + EditPart parentPart = nextPart.getParent(); + while (parentPart != null && !associatedParts.contains(parentPart)) { + parentPart = parentPart.getParent(); + } + if (parentPart == null) { + editPartCollector.add(nextPart); + } + } + + if (intialNumOfEditParts == editPartCollector.size()) { + if (!associatedParts.isEmpty()) { + editPartCollector.add(associatedParts.get(0)); + } else { + if (element.eContainer() != null) { + return findElementsInDiagramByID(diagramPart, + element.eContainer(), editPartCollector); + } + } + } + return editPartCollector.size() - intialNumOfEditParts; + } + + /** + * @generated + */ + public static View findView(DiagramEditPart diagramEditPart, + EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) { + boolean hasStructuralURI = false; + if (targetElement.eResource() instanceof XMLResource) { + hasStructuralURI = ((XMLResource) targetElement.eResource()) + .getID(targetElement) == null; + } + + View view = null; + LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>(); + if (hasStructuralURI + && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) { + view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement); + } else if (findElementsInDiagramByID(diagramEditPart, targetElement, + editPartHolder) > 0) { + EditPart editPart = editPartHolder.get(0); + view = editPart.getModel() instanceof View ? (View) editPart + .getModel() : null; + } + + return (view == null) ? diagramEditPart.getDiagramView() : view; + } + + /** + * XXX This is quite suspicious code (especially editPartTmpHolder) and likely to be removed soon + * @generated + */ + public static class LazyElement2ViewMap { + /** + * @generated + */ + private Map<EObject, View> element2ViewMap; + + /** + * @generated + */ + private View scope; + + /** + * @generated + */ + private Set<? extends EObject> elementSet; + + /** + * @generated + */ + public LazyElement2ViewMap(View scope, Set<? extends EObject> elements) { + this.scope = scope; + this.elementSet = elements; + } + + /** + * @generated + */ + public final Map<EObject, View> getElement2ViewMap() { + if (element2ViewMap == null) { + element2ViewMap = new HashMap<EObject, View>(); + // map possible notation elements to itself as these can't be found by view.getElement() + for (EObject element : elementSet) { + if (element instanceof View) { + View view = (View) element; + if (view.getDiagram() == scope.getDiagram()) { + element2ViewMap.put(element, view); // take only those that part of our diagram + } + } + } + + buildElement2ViewMap(scope, element2ViewMap, elementSet); + } + return element2ViewMap; + } + + /** + * @generated + */ + private static boolean buildElement2ViewMap(View parentView, + Map<EObject, View> element2ViewMap, + Set<? extends EObject> elements) { + if (elements.size() == element2ViewMap.size()) { + return true; + } + + if (parentView.isSetElement() + && !element2ViewMap.containsKey(parentView.getElement()) + && elements.contains(parentView.getElement())) { + element2ViewMap.put(parentView.getElement(), parentView); + if (elements.size() == element2ViewMap.size()) { + return true; + } + } + boolean complete = false; + for (Iterator<?> it = parentView.getChildren().iterator(); it + .hasNext() && !complete;) { + complete = buildElement2ViewMap((View) it.next(), + element2ViewMap, elements); + } + for (Iterator<?> it = parentView.getSourceEdges().iterator(); it + .hasNext() && !complete;) { + complete = buildElement2ViewMap((View) it.next(), + element2ViewMap, elements); + } + for (Iterator<?> it = parentView.getTargetEdges().iterator(); it + .hasNext() && !complete;) { + complete = buildElement2ViewMap((View) it.next(), + element2ViewMap, elements); + } + return complete; + } + } //LazyElement2ViewMap + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramUpdater.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramUpdater.java index db9efd6af07..503d2d1c243 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramUpdater.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLDiagramUpdater.java @@ -1,157 +1,157 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.update.DiagramUpdater;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.PackageableElement;
-
-/**
- * @generated
- */
-public class UMLDiagramUpdater {
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getSemanticChildren(View view) {
- switch (UMLVisualIDRegistry.getVisualID(view)) {
- case ModelEditPart.VISUAL_ID:
- return getModel_1000SemanticChildren(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLNodeDescriptor> getModel_1000SemanticChildren(
- View view) {
- if (!view.isSetElement()) {
- return Collections.emptyList();
- }
- Model modelElement = (Model) view.getElement();
- LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>();
- for (Iterator<?> it = modelElement.getPackagedElements().iterator(); it
- .hasNext();) {
- PackageableElement childElement = (PackageableElement) it.next();
- int visualID = UMLVisualIDRegistry.getNodeVisualID(view,
- childElement);
- if (visualID == ComponentEditPart.VISUAL_ID) {
- result.add(new UMLNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getContainedLinks(View view) {
- switch (UMLVisualIDRegistry.getVisualID(view)) {
- case ModelEditPart.VISUAL_ID:
- return getModel_1000ContainedLinks(view);
- case ComponentEditPart.VISUAL_ID:
- return getComponent_2001ContainedLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getIncomingLinks(View view) {
- switch (UMLVisualIDRegistry.getVisualID(view)) {
- case ComponentEditPart.VISUAL_ID:
- return getComponent_2001IncomingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getOutgoingLinks(View view) {
- switch (UMLVisualIDRegistry.getVisualID(view)) {
- case ComponentEditPart.VISUAL_ID:
- return getComponent_2001OutgoingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getModel_1000ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_2001ContainedLinks(
- View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_2001IncomingLinks(
- View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<UMLLinkDescriptor> getComponent_2001OutgoingLinks(
- View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static final DiagramUpdater TYPED_INSTANCE = new DiagramUpdater() {
- /**
- * @generated
- */
-
- public List<UMLNodeDescriptor> getSemanticChildren(View view) {
- return UMLDiagramUpdater.getSemanticChildren(view);
- }
-
- /**
- * @generated
- */
-
- public List<UMLLinkDescriptor> getContainedLinks(View view) {
- return UMLDiagramUpdater.getContainedLinks(view);
- }
-
- /**
- * @generated
- */
-
- public List<UMLLinkDescriptor> getIncomingLinks(View view) {
- return UMLDiagramUpdater.getIncomingLinks(view);
- }
-
- /**
- * @generated
- */
-
- public List<UMLLinkDescriptor> getOutgoingLinks(View view) {
- return UMLDiagramUpdater.getOutgoingLinks(view);
- }
- };
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.update.DiagramUpdater; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentEditPart; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.PackageableElement; + +/** + * @generated + */ +public class UMLDiagramUpdater { + + /** + * @generated + */ + public static List<UMLNodeDescriptor> getSemanticChildren(View view) { + switch (UMLVisualIDRegistry.getVisualID(view)) { + case ModelEditPart.VISUAL_ID: + return getModel_1000SemanticChildren(view); + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public static List<UMLNodeDescriptor> getModel_1000SemanticChildren( + View view) { + if (!view.isSetElement()) { + return Collections.emptyList(); + } + Model modelElement = (Model) view.getElement(); + LinkedList<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>(); + for (Iterator<?> it = modelElement.getPackagedElements().iterator(); it + .hasNext();) { + PackageableElement childElement = (PackageableElement) it.next(); + int visualID = UMLVisualIDRegistry.getNodeVisualID(view, + childElement); + if (visualID == ComponentEditPart.VISUAL_ID) { + result.add(new UMLNodeDescriptor(childElement, visualID)); + continue; + } + } + return result; + } + + /** + * @generated + */ + public static List<UMLLinkDescriptor> getContainedLinks(View view) { + switch (UMLVisualIDRegistry.getVisualID(view)) { + case ModelEditPart.VISUAL_ID: + return getModel_1000ContainedLinks(view); + case ComponentEditPart.VISUAL_ID: + return getComponent_2001ContainedLinks(view); + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public static List<UMLLinkDescriptor> getIncomingLinks(View view) { + switch (UMLVisualIDRegistry.getVisualID(view)) { + case ComponentEditPart.VISUAL_ID: + return getComponent_2001IncomingLinks(view); + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public static List<UMLLinkDescriptor> getOutgoingLinks(View view) { + switch (UMLVisualIDRegistry.getVisualID(view)) { + case ComponentEditPart.VISUAL_ID: + return getComponent_2001OutgoingLinks(view); + } + return Collections.emptyList(); + } + + /** + * @generated + */ + public static List<UMLLinkDescriptor> getModel_1000ContainedLinks(View view) { + return Collections.emptyList(); + } + + /** + * @generated + */ + public static List<UMLLinkDescriptor> getComponent_2001ContainedLinks( + View view) { + return Collections.emptyList(); + } + + /** + * @generated + */ + public static List<UMLLinkDescriptor> getComponent_2001IncomingLinks( + View view) { + return Collections.emptyList(); + } + + /** + * @generated + */ + public static List<UMLLinkDescriptor> getComponent_2001OutgoingLinks( + View view) { + return Collections.emptyList(); + } + + /** + * @generated + */ + public static final DiagramUpdater TYPED_INSTANCE = new DiagramUpdater() { + /** + * @generated + */ + + public List<UMLNodeDescriptor> getSemanticChildren(View view) { + return UMLDiagramUpdater.getSemanticChildren(view); + } + + /** + * @generated + */ + + public List<UMLLinkDescriptor> getContainedLinks(View view) { + return UMLDiagramUpdater.getContainedLinks(view); + } + + /** + * @generated + */ + + public List<UMLLinkDescriptor> getIncomingLinks(View view) { + return UMLDiagramUpdater.getIncomingLinks(view); + } + + /** + * @generated + */ + + public List<UMLLinkDescriptor> getOutgoingLinks(View view) { + return UMLDiagramUpdater.getOutgoingLinks(view); + } + }; + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLLinkDescriptor.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLLinkDescriptor.java index 8afa40f619c..3a3ee2cb657 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLLinkDescriptor.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLLinkDescriptor.java @@ -1,27 +1,27 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.update.UpdaterLinkDescriptor;
-
-/**
- * @generated
- */
-public class UMLLinkDescriptor extends UpdaterLinkDescriptor {
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination,
- IElementType elementType, int linkVID) {
- super(source, destination, elementType, linkVID);
- }
-
- /**
- * @generated
- */
- public UMLLinkDescriptor(EObject source, EObject destination,
- EObject linkElement, IElementType elementType, int linkVID) {
- super(source, destination, linkElement, elementType, linkVID);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.update.UpdaterLinkDescriptor; + +/** + * @generated + */ +public class UMLLinkDescriptor extends UpdaterLinkDescriptor { + /** + * @generated + */ + public UMLLinkDescriptor(EObject source, EObject destination, + IElementType elementType, int linkVID) { + super(source, destination, elementType, linkVID); + } + + /** + * @generated + */ + public UMLLinkDescriptor(EObject source, EObject destination, + EObject linkElement, IElementType elementType, int linkVID) { + super(source, destination, linkElement, elementType, linkVID); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLNodeDescriptor.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLNodeDescriptor.java index ef0fc6a148c..a25c5f511a8 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLNodeDescriptor.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLNodeDescriptor.java @@ -1,17 +1,17 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.update.UpdaterNodeDescriptor;
-
-/**
- * @generated
- */
-public class UMLNodeDescriptor extends UpdaterNodeDescriptor {
- /**
- * @generated
- */
- public UMLNodeDescriptor(EObject modelElement, int visualID) {
- super(modelElement, visualID);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.update.UpdaterNodeDescriptor; + +/** + * @generated + */ +public class UMLNodeDescriptor extends UpdaterNodeDescriptor { + /** + * @generated + */ + public UMLNodeDescriptor(EObject modelElement, int visualID) { + super(modelElement, visualID); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLPaletteFactory.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLPaletteFactory.java index 882240ee3b8..9d9635a25b0 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLPaletteFactory.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLPaletteFactory.java @@ -1,56 +1,56 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import java.util.Collections;
-
-import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.PaletteGroup;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultNodeToolEntry;
-import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes;
-
-/**
- * @generated
- */
-public class UMLPaletteFactory {
-
- /**
- * @generated
- */
- public void fillPalette(PaletteRoot paletteRoot) {
- paletteRoot.add(createUml1Group());
- }
-
- /**
- * Creates "uml" palette tool group
- * @generated
- */
- private PaletteContainer createUml1Group() {
- PaletteGroup paletteContainer = new PaletteGroup(
- Messages.Uml1Group_title);
- paletteContainer.setId("createUml1Group"); //$NON-NLS-1$
- paletteContainer.setSmallIcon(UMLDiagramEditorPlugin
- .findImageDescriptor("icons/obj16/Diagram_UML.gif")); //$NON-NLS-1$
- paletteContainer.setLargeIcon(UMLDiagramEditorPlugin
- .findImageDescriptor("icons/obj16/Diagram_UML.gif")); //$NON-NLS-1$
- paletteContainer.add(createComponent1CreationTool());
- return paletteContainer;
- }
-
- /**
- * @generated
- */
- private ToolEntry createComponent1CreationTool() {
- DefaultNodeToolEntry entry = new DefaultNodeToolEntry(
- Messages.Component1CreationTool_title,
- Messages.Component1CreationTool_desc,
- Collections.singletonList(UMLElementTypes.Component_2001));
- entry.setId("createComponent1CreationTool"); //$NON-NLS-1$
- entry.setSmallIcon(UMLDiagramEditorPlugin
- .findImageDescriptor("icons/obj16/Component.gif")); //$NON-NLS-1$
- entry.setLargeIcon(UMLDiagramEditorPlugin
- .findImageDescriptor("icons/obj16/Component.gif")); //$NON-NLS-1$
- return entry;
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import java.util.Collections; + +import org.eclipse.gef.palette.PaletteContainer; +import org.eclipse.gef.palette.PaletteGroup; +import org.eclipse.gef.palette.PaletteRoot; +import org.eclipse.gef.palette.ToolEntry; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.part.DefaultNodeToolEntry; +import org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes; + +/** + * @generated + */ +public class UMLPaletteFactory { + + /** + * @generated + */ + public void fillPalette(PaletteRoot paletteRoot) { + paletteRoot.add(createUml1Group()); + } + + /** + * Creates "uml" palette tool group + * @generated + */ + private PaletteContainer createUml1Group() { + PaletteGroup paletteContainer = new PaletteGroup( + Messages.Uml1Group_title); + paletteContainer.setId("createUml1Group"); //$NON-NLS-1$ + paletteContainer.setSmallIcon(UMLDiagramEditorPlugin + .findImageDescriptor("icons/obj16/Diagram_UML.gif")); //$NON-NLS-1$ + paletteContainer.setLargeIcon(UMLDiagramEditorPlugin + .findImageDescriptor("icons/obj16/Diagram_UML.gif")); //$NON-NLS-1$ + paletteContainer.add(createComponent1CreationTool()); + return paletteContainer; + } + + /** + * @generated + */ + private ToolEntry createComponent1CreationTool() { + DefaultNodeToolEntry entry = new DefaultNodeToolEntry( + Messages.Component1CreationTool_title, + Messages.Component1CreationTool_desc, + Collections.singletonList(UMLElementTypes.Component_2001)); + entry.setId("createComponent1CreationTool"); //$NON-NLS-1$ + entry.setSmallIcon(UMLDiagramEditorPlugin + .findImageDescriptor("icons/obj16/Component.gif")); //$NON-NLS-1$ + entry.setLargeIcon(UMLDiagramEditorPlugin + .findImageDescriptor("icons/obj16/Component.gif")); //$NON-NLS-1$ + return entry; + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLVisualIDRegistry.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLVisualIDRegistry.java index 7053dd08f66..cc121e9e93a 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLVisualIDRegistry.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/part/UMLVisualIDRegistry.java @@ -1,282 +1,282 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.part;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentNameEditPart;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.structure.DiagramStructure;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This registry is used to determine which type of visual object should be
- * created for the corresponding Diagram, Node, ChildNode or Link represented
- * by a domain model object.
- *
- * @generated
- */
-public class UMLVisualIDRegistry {
-
- /**
- * @generated
- */
- private static final String DEBUG_KEY = "org.eclipse.uml2.uml.diagram/debug/visualID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static int getVisualID(View view) {
- if (view instanceof Diagram) {
- if (ModelEditPart.MODEL_ID.equals(view.getType())) {
- return ModelEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getVisualID(view.getType());
- }
-
- /**
- * @generated
- */
- public static String getModelID(View view) {
- View diagram = view.getDiagram();
- while (view != diagram) {
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if (annotation != null) {
- return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$
- }
- view = (View) view.eContainer();
- }
- return diagram != null ? diagram.getType() : null;
- }
-
- /**
- * @generated
- */
- public static int getVisualID(String type) {
- try {
- return Integer.parseInt(type);
- } catch (NumberFormatException e) {
- if (Boolean.TRUE.toString().equalsIgnoreCase(
- Platform.getDebugOption(DEBUG_KEY))) {
- UMLDiagramEditorPlugin.getInstance().logError(
- "Unable to parse view type as a visualID number: "
- + type);
- }
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static String getType(int visualID) {
- return Integer.toString(visualID);
- }
-
- /**
- * @generated
- */
- public static int getDiagramVisualID(EObject domainElement) {
- if (domainElement == null) {
- return -1;
- }
- if (UMLPackage.eINSTANCE.getModel().isSuperTypeOf(
- domainElement.eClass())
- && isDiagram((Model) domainElement)) {
- return ModelEditPart.VISUAL_ID;
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static int getNodeVisualID(View containerView, EObject domainElement) {
- if (domainElement == null) {
- return -1;
- }
- String containerModelID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getModelID(containerView);
- if (!ModelEditPart.MODEL_ID.equals(containerModelID)) {
- return -1;
- }
- int containerVisualID;
- if (ModelEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getVisualID(containerView);
- } else {
- if (containerView instanceof Diagram) {
- containerVisualID = ModelEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- switch (containerVisualID) {
- case ModelEditPart.VISUAL_ID:
- if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf(
- domainElement.eClass())) {
- return ComponentEditPart.VISUAL_ID;
- }
- break;
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static boolean canCreateNode(View containerView, int nodeVisualID) {
- String containerModelID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getModelID(containerView);
- if (!ModelEditPart.MODEL_ID.equals(containerModelID)) {
- return false;
- }
- int containerVisualID;
- if (ModelEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getVisualID(containerView);
- } else {
- if (containerView instanceof Diagram) {
- containerVisualID = ModelEditPart.VISUAL_ID;
- } else {
- return false;
- }
- }
- switch (containerVisualID) {
- case ModelEditPart.VISUAL_ID:
- if (ComponentEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ComponentEditPart.VISUAL_ID:
- if (ComponentNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static int getLinkWithClassVisualID(EObject domainElement) {
- if (domainElement == null) {
- return -1;
- }
- return -1;
- }
-
- /**
- * User can change implementation of this method to handle some specific
- * situations not covered by default logic.
- *
- * @generated
- */
- private static boolean isDiagram(Model element) {
- return true;
- }
-
- /**
- * @generated
- */
- public static boolean checkNodeVisualID(View containerView,
- EObject domainElement, int candidate) {
- if (candidate == -1) {
- //unrecognized id is always bad
- return false;
- }
- int basic = getNodeVisualID(containerView, domainElement);
- return basic == candidate;
- }
-
- /**
- * @generated
- */
- public static boolean isCompartmentVisualID(int visualID) {
- return false;
- }
-
- /**
- * @generated
- */
- public static boolean isSemanticLeafVisualID(int visualID) {
- switch (visualID) {
- case ModelEditPart.VISUAL_ID:
- return false;
- case ComponentEditPart.VISUAL_ID:
- return true;
- default:
- break;
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static final DiagramStructure TYPED_INSTANCE = new DiagramStructure() {
- /**
- * @generated
- */
-
- public int getVisualID(View view) {
- return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getVisualID(view);
- }
-
- /**
- * @generated
- */
-
- public String getModelID(View view) {
- return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getModelID(view);
- }
-
- /**
- * @generated
- */
-
- public int getNodeVisualID(View containerView, EObject domainElement) {
- return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .getNodeVisualID(containerView, domainElement);
- }
-
- /**
- * @generated
- */
-
- public boolean checkNodeVisualID(View containerView,
- EObject domainElement, int candidate) {
- return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .checkNodeVisualID(containerView, domainElement, candidate);
- }
-
- /**
- * @generated
- */
-
- public boolean isCompartmentVisualID(int visualID) {
- return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .isCompartmentVisualID(visualID);
- }
-
- /**
- * @generated
- */
-
- public boolean isSemanticLeafVisualID(int visualID) {
- return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry
- .isSemanticLeafVisualID(visualID);
- }
- };
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.part; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentEditPart; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentNameEditPart; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.structure.DiagramStructure; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * This registry is used to determine which type of visual object should be + * created for the corresponding Diagram, Node, ChildNode or Link represented + * by a domain model object. + * + * @generated + */ +public class UMLVisualIDRegistry { + + /** + * @generated + */ + private static final String DEBUG_KEY = "org.eclipse.uml2.uml.diagram/debug/visualID"; //$NON-NLS-1$ + + /** + * @generated + */ + public static int getVisualID(View view) { + if (view instanceof Diagram) { + if (ModelEditPart.MODEL_ID.equals(view.getType())) { + return ModelEditPart.VISUAL_ID; + } else { + return -1; + } + } + return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getVisualID(view.getType()); + } + + /** + * @generated + */ + public static String getModelID(View view) { + View diagram = view.getDiagram(); + while (view != diagram) { + EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ + if (annotation != null) { + return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$ + } + view = (View) view.eContainer(); + } + return diagram != null ? diagram.getType() : null; + } + + /** + * @generated + */ + public static int getVisualID(String type) { + try { + return Integer.parseInt(type); + } catch (NumberFormatException e) { + if (Boolean.TRUE.toString().equalsIgnoreCase( + Platform.getDebugOption(DEBUG_KEY))) { + UMLDiagramEditorPlugin.getInstance().logError( + "Unable to parse view type as a visualID number: " + + type); + } + } + return -1; + } + + /** + * @generated + */ + public static String getType(int visualID) { + return Integer.toString(visualID); + } + + /** + * @generated + */ + public static int getDiagramVisualID(EObject domainElement) { + if (domainElement == null) { + return -1; + } + if (UMLPackage.eINSTANCE.getModel().isSuperTypeOf( + domainElement.eClass()) + && isDiagram((Model) domainElement)) { + return ModelEditPart.VISUAL_ID; + } + return -1; + } + + /** + * @generated + */ + public static int getNodeVisualID(View containerView, EObject domainElement) { + if (domainElement == null) { + return -1; + } + String containerModelID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getModelID(containerView); + if (!ModelEditPart.MODEL_ID.equals(containerModelID)) { + return -1; + } + int containerVisualID; + if (ModelEditPart.MODEL_ID.equals(containerModelID)) { + containerVisualID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getVisualID(containerView); + } else { + if (containerView instanceof Diagram) { + containerVisualID = ModelEditPart.VISUAL_ID; + } else { + return -1; + } + } + switch (containerVisualID) { + case ModelEditPart.VISUAL_ID: + if (UMLPackage.eINSTANCE.getComponent().isSuperTypeOf( + domainElement.eClass())) { + return ComponentEditPart.VISUAL_ID; + } + break; + } + return -1; + } + + /** + * @generated + */ + public static boolean canCreateNode(View containerView, int nodeVisualID) { + String containerModelID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getModelID(containerView); + if (!ModelEditPart.MODEL_ID.equals(containerModelID)) { + return false; + } + int containerVisualID; + if (ModelEditPart.MODEL_ID.equals(containerModelID)) { + containerVisualID = org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getVisualID(containerView); + } else { + if (containerView instanceof Diagram) { + containerVisualID = ModelEditPart.VISUAL_ID; + } else { + return false; + } + } + switch (containerVisualID) { + case ModelEditPart.VISUAL_ID: + if (ComponentEditPart.VISUAL_ID == nodeVisualID) { + return true; + } + break; + case ComponentEditPart.VISUAL_ID: + if (ComponentNameEditPart.VISUAL_ID == nodeVisualID) { + return true; + } + break; + } + return false; + } + + /** + * @generated + */ + public static int getLinkWithClassVisualID(EObject domainElement) { + if (domainElement == null) { + return -1; + } + return -1; + } + + /** + * User can change implementation of this method to handle some specific + * situations not covered by default logic. + * + * @generated + */ + private static boolean isDiagram(Model element) { + return true; + } + + /** + * @generated + */ + public static boolean checkNodeVisualID(View containerView, + EObject domainElement, int candidate) { + if (candidate == -1) { + //unrecognized id is always bad + return false; + } + int basic = getNodeVisualID(containerView, domainElement); + return basic == candidate; + } + + /** + * @generated + */ + public static boolean isCompartmentVisualID(int visualID) { + return false; + } + + /** + * @generated + */ + public static boolean isSemanticLeafVisualID(int visualID) { + switch (visualID) { + case ModelEditPart.VISUAL_ID: + return false; + case ComponentEditPart.VISUAL_ID: + return true; + default: + break; + } + return false; + } + + /** + * @generated + */ + public static final DiagramStructure TYPED_INSTANCE = new DiagramStructure() { + /** + * @generated + */ + + public int getVisualID(View view) { + return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getVisualID(view); + } + + /** + * @generated + */ + + public String getModelID(View view) { + return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getModelID(view); + } + + /** + * @generated + */ + + public int getNodeVisualID(View containerView, EObject domainElement) { + return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .getNodeVisualID(containerView, domainElement); + } + + /** + * @generated + */ + + public boolean checkNodeVisualID(View containerView, + EObject domainElement, int candidate) { + return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .checkNodeVisualID(containerView, domainElement, candidate); + } + + /** + * @generated + */ + + public boolean isCompartmentVisualID(int visualID) { + return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .isCompartmentVisualID(visualID); + } + + /** + * @generated + */ + + public boolean isSemanticLeafVisualID(int visualID) { + return org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry + .isSemanticLeafVisualID(visualID); + } + }; + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLEditPartProvider.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLEditPartProvider.java index dc7647a51e7..170cad7eca3 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLEditPartProvider.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLEditPartProvider.java @@ -1,21 +1,21 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.providers;
-
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DefaultEditPartProvider;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry;
-
-/**
- * @generated
- */
-public class UMLEditPartProvider extends DefaultEditPartProvider {
-
- /**
- * @generated
- */
- public UMLEditPartProvider() {
- super(new UMLEditPartFactory(), UMLVisualIDRegistry.TYPED_INSTANCE,
- ModelEditPart.MODEL_ID);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.providers; + +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DefaultEditPartProvider; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.UMLEditPartFactory; +import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLVisualIDRegistry; + +/** + * @generated + */ +public class UMLEditPartProvider extends DefaultEditPartProvider { + + /** + * @generated + */ + public UMLEditPartProvider() { + super(new UMLEditPartFactory(), UMLVisualIDRegistry.TYPED_INSTANCE, + ModelEditPart.MODEL_ID); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLElementTypes.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLElementTypes.java index 1b8c21ca8d2..bf8a3f8b082 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLElementTypes.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLElementTypes.java @@ -1,170 +1,170 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.providers;
-
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DiagramElementTypeImages;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DiagramElementTypes;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentEditPart;
-import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart;
-import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class UMLElementTypes {
-
- /**
- * @generated
- */
- private UMLElementTypes() {
- }
-
- /**
- * @generated
- */
- private static Map<IElementType, ENamedElement> elements;
-
- /**
- * @generated
- */
- private static DiagramElementTypeImages elementTypeImages = new DiagramElementTypeImages(
- UMLDiagramEditorPlugin.getInstance()
- .getItemProvidersAdapterFactory());
-
- /**
- * @generated
- */
- private static Set<IElementType> KNOWN_ELEMENT_TYPES;
-
- /**
- * @generated
- */
- public static final IElementType Model_1000 = getElementType("org.eclipse.uml2.uml.diagram.Model_1000"); //$NON-NLS-1$
- /**
- * @generated
- */
- public static final IElementType Component_2001 = getElementType("org.eclipse.uml2.uml.diagram.Component_2001"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(ENamedElement element) {
- return elementTypeImages.getImageDescriptor(element);
- }
-
- /**
- * @generated
- */
- public static Image getImage(ENamedElement element) {
- return elementTypeImages.getImage(element);
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
- return getImageDescriptor(getElement(hint));
- }
-
- /**
- * @generated
- */
- public static Image getImage(IAdaptable hint) {
- return getImage(getElement(hint));
- }
-
- /**
- * Returns 'type' of the ecore object associated with the hint.
- *
- * @generated
- */
- public static ENamedElement getElement(IAdaptable hint) {
- Object type = hint.getAdapter(IElementType.class);
- if (elements == null) {
- elements = new IdentityHashMap<IElementType, ENamedElement>();
-
- elements.put(Model_1000, UMLPackage.eINSTANCE.getModel());
-
- elements.put(Component_2001, UMLPackage.eINSTANCE.getComponent());
- }
- return (ENamedElement) elements.get(type);
- }
-
- /**
- * @generated
- */
- private static IElementType getElementType(String id) {
- return ElementTypeRegistry.getInstance().getType(id);
- }
-
- /**
- * @generated
- */
- public static boolean isKnownElementType(IElementType elementType) {
- if (KNOWN_ELEMENT_TYPES == null) {
- KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
- KNOWN_ELEMENT_TYPES.add(Model_1000);
- KNOWN_ELEMENT_TYPES.add(Component_2001);
- }
- return KNOWN_ELEMENT_TYPES.contains(elementType);
- }
-
- /**
- * @generated
- */
- public static IElementType getElementType(int visualID) {
- switch (visualID) {
- case ModelEditPart.VISUAL_ID:
- return Model_1000;
- case ComponentEditPart.VISUAL_ID:
- return Component_2001;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public static final DiagramElementTypes TYPED_INSTANCE = new DiagramElementTypes(
- elementTypeImages) {
-
- /**
- * @generated
- */
- @Override
- public boolean isKnownElementType(IElementType elementType) {
- return org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes
- .isKnownElementType(elementType);
- }
-
- /**
- * @generated
- */
- @Override
- public IElementType getElementTypeForVisualId(int visualID) {
- return org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes
- .getElementType(visualID);
- }
-
- /**
- * @generated
- */
- @Override
- public ENamedElement getDefiningNamedElement(
- IAdaptable elementTypeAdapter) {
- return org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes
- .getElement(elementTypeAdapter);
- }
- };
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.providers; + +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Set; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DiagramElementTypeImages; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DiagramElementTypes; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ComponentEditPart; +import org.eclipse.papyrus.example.diagram.simplediagram.edit.parts.ModelEditPart; +import org.eclipse.papyrus.example.diagram.simplediagram.part.UMLDiagramEditorPlugin; +import org.eclipse.swt.graphics.Image; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * @generated + */ +public class UMLElementTypes { + + /** + * @generated + */ + private UMLElementTypes() { + } + + /** + * @generated + */ + private static Map<IElementType, ENamedElement> elements; + + /** + * @generated + */ + private static DiagramElementTypeImages elementTypeImages = new DiagramElementTypeImages( + UMLDiagramEditorPlugin.getInstance() + .getItemProvidersAdapterFactory()); + + /** + * @generated + */ + private static Set<IElementType> KNOWN_ELEMENT_TYPES; + + /** + * @generated + */ + public static final IElementType Model_1000 = getElementType("org.eclipse.uml2.uml.diagram.Model_1000"); //$NON-NLS-1$ + /** + * @generated + */ + public static final IElementType Component_2001 = getElementType("org.eclipse.uml2.uml.diagram.Component_2001"); //$NON-NLS-1$ + + /** + * @generated + */ + public static ImageDescriptor getImageDescriptor(ENamedElement element) { + return elementTypeImages.getImageDescriptor(element); + } + + /** + * @generated + */ + public static Image getImage(ENamedElement element) { + return elementTypeImages.getImage(element); + } + + /** + * @generated + */ + public static ImageDescriptor getImageDescriptor(IAdaptable hint) { + return getImageDescriptor(getElement(hint)); + } + + /** + * @generated + */ + public static Image getImage(IAdaptable hint) { + return getImage(getElement(hint)); + } + + /** + * Returns 'type' of the ecore object associated with the hint. + * + * @generated + */ + public static ENamedElement getElement(IAdaptable hint) { + Object type = hint.getAdapter(IElementType.class); + if (elements == null) { + elements = new IdentityHashMap<IElementType, ENamedElement>(); + + elements.put(Model_1000, UMLPackage.eINSTANCE.getModel()); + + elements.put(Component_2001, UMLPackage.eINSTANCE.getComponent()); + } + return (ENamedElement) elements.get(type); + } + + /** + * @generated + */ + private static IElementType getElementType(String id) { + return ElementTypeRegistry.getInstance().getType(id); + } + + /** + * @generated + */ + public static boolean isKnownElementType(IElementType elementType) { + if (KNOWN_ELEMENT_TYPES == null) { + KNOWN_ELEMENT_TYPES = new HashSet<IElementType>(); + KNOWN_ELEMENT_TYPES.add(Model_1000); + KNOWN_ELEMENT_TYPES.add(Component_2001); + } + return KNOWN_ELEMENT_TYPES.contains(elementType); + } + + /** + * @generated + */ + public static IElementType getElementType(int visualID) { + switch (visualID) { + case ModelEditPart.VISUAL_ID: + return Model_1000; + case ComponentEditPart.VISUAL_ID: + return Component_2001; + } + return null; + } + + /** + * @generated + */ + public static final DiagramElementTypes TYPED_INSTANCE = new DiagramElementTypes( + elementTypeImages) { + + /** + * @generated + */ + @Override + public boolean isKnownElementType(IElementType elementType) { + return org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes + .isKnownElementType(elementType); + } + + /** + * @generated + */ + @Override + public IElementType getElementTypeForVisualId(int visualID) { + return org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes + .getElementType(visualID); + } + + /** + * @generated + */ + @Override + public ENamedElement getDefiningNamedElement( + IAdaptable elementTypeAdapter) { + return org.eclipse.papyrus.example.diagram.simplediagram.providers.UMLElementTypes + .getElement(elementTypeAdapter); + } + }; + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLIconProvider.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLIconProvider.java index 468b6e6223f..9a5a0b36b21 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLIconProvider.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/providers/UMLIconProvider.java @@ -1,19 +1,19 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.providers;
-
-import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DefaultElementTypeIconProvider;
-
-/**
- * @generated
- */
-public class UMLIconProvider extends DefaultElementTypeIconProvider implements
- IIconProvider {
-
- /**
- * @generated
- */
- public UMLIconProvider() {
- super(UMLElementTypes.TYPED_INSTANCE);
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.providers; + +import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider; +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.providers.DefaultElementTypeIconProvider; + +/** + * @generated + */ +public class UMLIconProvider extends DefaultElementTypeIconProvider implements + IIconProvider { + + /** + * @generated + */ + public UMLIconProvider() { + super(UMLElementTypes.TYPED_INSTANCE); + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/sheet/UMLPropertySection.java b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/sheet/UMLPropertySection.java index a2dfbd9a23c..c4bc608194b 100644 --- a/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/sheet/UMLPropertySection.java +++ b/examples/others/org.eclipse.papyrus.example.diagram.simplediagram/src/org/eclipse/papyrus/example/diagram/simplediagram/sheet/UMLPropertySection.java @@ -1,22 +1,22 @@ -package org.eclipse.papyrus.example.diagram.simplediagram.sheet;
-
-import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.sheet.DefaultPropertySection;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-/**
- * @generated
- */
-public class UMLPropertySection extends DefaultPropertySection implements
- IPropertySourceProvider {
-
- /**
- * Modify/unwrap selection.
- * @generated
- */
- @Override
- protected Object transformSelection(Object selected) {
- selected = /*super.*/transformSelectionToDomain(selected);
- return selected;
- }
-
-}
+package org.eclipse.papyrus.example.diagram.simplediagram.sheet; + +import org.eclipse.papyrus.infra.gmfdiag.tooling.runtime.sheet.DefaultPropertySection; +import org.eclipse.ui.views.properties.IPropertySourceProvider; + +/** + * @generated + */ +public class UMLPropertySection extends DefaultPropertySection implements + IPropertySourceProvider { + + /** + * Modify/unwrap selection. + * @generated + */ + @Override + protected Object transformSelection(Object selected) { + selected = /*super.*/transformSelectionToDomain(selected); + return selected; + } + +} diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/.classpath b/examples/others/org.eclipse.papyrus.example.text.instance/.classpath index 45f024e850e..304e86186aa 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/.classpath +++ b/examples/others/org.eclipse.papyrus.example.text.instance/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/.project b/examples/others/org.eclipse.papyrus.example.text.instance/.project index 1f1bbbf348a..35c719b324a 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/.project +++ b/examples/others/org.eclipse.papyrus.example.text.instance/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.example.text.instance</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.example.text.instance</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/about.html b/examples/others/org.eclipse.papyrus.example.text.instance/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/about.html +++ b/examples/others/org.eclipse.papyrus.example.text.instance/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/build.properties b/examples/others/org.eclipse.papyrus.example.text.instance/build.properties index 83183307edb..38c809d77da 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/build.properties +++ b/examples/others/org.eclipse.papyrus.example.text.instance/build.properties @@ -1,22 +1,22 @@ -# 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
-#
-
-bin.includes = .,\
- model/,\
- META-INF/,\
- plugin.xml,\
- about.html,\
- plugin.properties,\
- build.properties
-jars.compile.order = .
-source.. = src/
-output.. = bin/
-src.includes = about.html
+# 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 +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + about.html,\ + plugin.properties,\ + build.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = about.html diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore index 1efefbcdd3e..cacc29ab16b 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore +++ b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.ecore @@ -1,10 +1,10 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="papyrustextinstance" nsURI="http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance"
- nsPrefix="papyrustextinstance">
- <eClassifiers xsi:type="ecore:EClass" name="PapyrusTextInstance" eSuperTypes="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EModelElement">
- <eStructuralFeatures xsi:type="ecore:EReference" name="editedObject" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
-</ecore:EPackage>
+<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="papyrustextinstance" nsURI="http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance" + nsPrefix="papyrustextinstance"> + <eClassifiers xsi:type="ecore:EClass" name="PapyrusTextInstance" eSuperTypes="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EModelElement"> + <eStructuralFeatures xsi:type="ecore:EReference" name="editedObject" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EObject"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + </eClassifiers> +</ecore:EPackage> diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel index 02d981047ff..346cb6ed859 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel +++ b/examples/others/org.eclipse.papyrus.example.text.instance/model/papyrustextinstance.genmodel @@ -1,16 +1,16 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText=" 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
"
- modelDirectory="/org.eclipse.papyrus.example.text.instance/src" modelPluginID="org.eclipse.papyrus.example.text.instance"
- modelName="Papyrustextinstance" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0"
- copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
- <foreignModel>papyrustextinstance.ecore</foreignModel>
- <genPackages prefix="Papyrustextinstance" basePackage="org.eclipse.papyrus.example.test.instance"
- disposableProviderFactory="true" ecorePackage="papyrustextinstance.ecore#/">
- <genClasses ecoreClass="papyrustextinstance.ecore#//PapyrusTextInstance">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustextinstance.ecore#//PapyrusTextInstance/editedObject"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustextinstance.ecore#//PapyrusTextInstance/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustextinstance.ecore#//PapyrusTextInstance/name"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
+<?xml version="1.0" encoding="UTF-8"?> +<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText=" 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
" + modelDirectory="/org.eclipse.papyrus.example.text.instance/src" modelPluginID="org.eclipse.papyrus.example.text.instance" + modelName="Papyrustextinstance" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" + copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore"> + <foreignModel>papyrustextinstance.ecore</foreignModel> + <genPackages prefix="Papyrustextinstance" basePackage="org.eclipse.papyrus.example.test.instance" + disposableProviderFactory="true" ecorePackage="papyrustextinstance.ecore#/"> + <genClasses ecoreClass="papyrustextinstance.ecore#//PapyrusTextInstance"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustextinstance.ecore#//PapyrusTextInstance/editedObject"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustextinstance.ecore#//PapyrusTextInstance/type"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustextinstance.ecore#//PapyrusTextInstance/name"/> + </genClasses> + </genPackages> +</genmodel:GenModel> diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/plugin.properties b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.properties index 6cb01adb217..1036a1530bc 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/plugin.properties +++ b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.properties @@ -1,15 +1,15 @@ -# 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
-#
-
-pluginName = Papyrus Text Editor Example (Incubation)
-providerName = Eclipse Modeling Project
-
+# 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 +# + +pluginName = Papyrus Text Editor Example (Incubation) +providerName = Eclipse Modeling Project + pluginDescription=This plugin provides the content model for the papyrus text editor
\ No newline at end of file diff --git a/examples/others/org.eclipse.papyrus.example.text.instance/plugin.xml b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.xml index 35c4d727312..436174b2165 100644 --- a/examples/others/org.eclipse.papyrus.example.text.instance/plugin.xml +++ b/examples/others/org.eclipse.papyrus.example.text.instance/plugin.xml @@ -1,26 +1,26 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<!--
- 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
-
--->
-
-<plugin>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance"
- class="org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage"
- genModel="model/papyrustextinstance.genmodel"/>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<!-- + 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 + +--> + +<plugin> + + <extension point="org.eclipse.emf.ecore.generated_package"> + <package + uri="http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance" + class="org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage" + genModel="model/papyrustextinstance.genmodel"/> + </extension> + +</plugin> diff --git a/examples/others/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..70fe01e0c41 100644 --- a/examples/others/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 @@ -1,115 +1,115 @@ -/**
- * 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.text.instance.papyrustextinstance;
-
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Papyrus Text Instance</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject <em>Edited Object</em>}</li>
- * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance()
- * @model
- * @generated
- */
-public interface PapyrusTextInstance extends EModelElement {
- /**
- * Returns the value of the '<em><b>Edited Object</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Edited Object</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Edited Object</em>' reference.
- * @see #setEditedObject(EObject)
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance_EditedObject()
- * @model
- * @generated
- */
- EObject getEditedObject();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject <em>Edited Object</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Edited Object</em>' reference.
- * @see #getEditedObject()
- * @generated
- */
- void setEditedObject(EObject value);
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see #setType(String)
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance_Type()
- * @model
- * @generated
- */
- String getType();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see #getType()
- * @generated
- */
- void setType(String value);
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance_Name()
- * @model
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // PapyrusTextInstance
+/** + * 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.text.instance.papyrustextinstance; + +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Papyrus Text Instance</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject <em>Edited Object</em>}</li> + * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType <em>Type</em>}</li> + * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance() + * @model + * @generated + */ +public interface PapyrusTextInstance extends EModelElement { + /** + * Returns the value of the '<em><b>Edited Object</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Edited Object</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Edited Object</em>' reference. + * @see #setEditedObject(EObject) + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance_EditedObject() + * @model + * @generated + */ + EObject getEditedObject(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject <em>Edited Object</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Edited Object</em>' reference. + * @see #getEditedObject() + * @generated + */ + void setEditedObject(EObject value); + + /** + * Returns the value of the '<em><b>Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Type</em>' attribute. + * @see #setType(String) + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance_Type() + * @model + * @generated + */ + String getType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType <em>Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Type</em>' attribute. + * @see #getType() + * @generated + */ + void setType(String value); + + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#getPapyrusTextInstance_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // PapyrusTextInstance diff --git a/examples/others/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..4d39347cad6 100644 --- a/examples/others/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 @@ -1,52 +1,52 @@ -/**
- * 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.text.instance.papyrustextinstance;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage
- * @generated
- */
-public interface PapyrustextinstanceFactory extends EFactory {
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- PapyrustextinstanceFactory eINSTANCE = org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstanceFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Papyrus Text Instance</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Papyrus Text Instance</em>'.
- * @generated
- */
- PapyrusTextInstance createPapyrusTextInstance();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the package supported by this factory.
- * @generated
- */
- PapyrustextinstancePackage getPapyrustextinstancePackage();
-
-} //PapyrustextinstanceFactory
+/** + * 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.text.instance.papyrustextinstance; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage + * @generated + */ +public interface PapyrustextinstanceFactory extends EFactory { + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + PapyrustextinstanceFactory eINSTANCE = org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstanceFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Papyrus Text Instance</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Papyrus Text Instance</em>'. + * @generated + */ + PapyrusTextInstance createPapyrusTextInstance(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + PapyrustextinstancePackage getPapyrustextinstancePackage(); + +} //PapyrustextinstanceFactory diff --git a/examples/others/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..ceb6ceefbff 100644 --- a/examples/others/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 @@ -1,226 +1,226 @@ -/**
- * 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.text.instance.papyrustextinstance;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory
- * @model kind="package"
- * @generated
- */
-public interface PapyrustextinstancePackage extends EPackage {
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNAME = "papyrustextinstance";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_URI = "http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- String eNS_PREFIX = "papyrustextinstance";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- PapyrustextinstancePackage eINSTANCE = org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstancePackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl <em>Papyrus Text Instance</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstancePackageImpl#getPapyrusTextInstance()
- * @generated
- */
- int PAPYRUS_TEXT_INSTANCE = 0;
-
- /**
- * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PAPYRUS_TEXT_INSTANCE__EANNOTATIONS = EcorePackage.EMODEL_ELEMENT__EANNOTATIONS;
-
- /**
- * The feature id for the '<em><b>Edited Object</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PAPYRUS_TEXT_INSTANCE__TYPE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PAPYRUS_TEXT_INSTANCE__NAME = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Papyrus Text Instance</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int PAPYRUS_TEXT_INSTANCE_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance <em>Papyrus Text Instance</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Papyrus Text Instance</em>'.
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance
- * @generated
- */
- EClass getPapyrusTextInstance();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject <em>Edited Object</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Edited Object</em>'.
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject()
- * @see #getPapyrusTextInstance()
- * @generated
- */
- EReference getPapyrusTextInstance_EditedObject();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType()
- * @see #getPapyrusTextInstance()
- * @generated
- */
- EAttribute getPapyrusTextInstance_Type();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName()
- * @see #getPapyrusTextInstance()
- * @generated
- */
- EAttribute getPapyrusTextInstance_Name();
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- PapyrustextinstanceFactory getPapyrustextinstanceFactory();
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- interface Literals {
- /**
- * The meta object literal for the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl <em>Papyrus Text Instance</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstancePackageImpl#getPapyrusTextInstance()
- * @generated
- */
- EClass PAPYRUS_TEXT_INSTANCE = eINSTANCE.getPapyrusTextInstance();
-
- /**
- * The meta object literal for the '<em><b>Edited Object</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EReference PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT = eINSTANCE.getPapyrusTextInstance_EditedObject();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PAPYRUS_TEXT_INSTANCE__TYPE = eINSTANCE.getPapyrusTextInstance_Type();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute PAPYRUS_TEXT_INSTANCE__NAME = eINSTANCE.getPapyrusTextInstance_Name();
-
- }
-
-} //PapyrustextinstancePackage
+/** + * 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.text.instance.papyrustextinstance; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory + * @model kind="package" + * @generated + */ +public interface PapyrustextinstancePackage extends EPackage { + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "papyrustextinstance"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "papyrustextinstance"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + PapyrustextinstancePackage eINSTANCE = org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstancePackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl <em>Papyrus Text Instance</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstancePackageImpl#getPapyrusTextInstance() + * @generated + */ + int PAPYRUS_TEXT_INSTANCE = 0; + + /** + * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_TEXT_INSTANCE__EANNOTATIONS = EcorePackage.EMODEL_ELEMENT__EANNOTATIONS; + + /** + * The feature id for the '<em><b>Edited Object</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_TEXT_INSTANCE__TYPE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_TEXT_INSTANCE__NAME = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 2; + + /** + * The number of structural features of the '<em>Papyrus Text Instance</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_TEXT_INSTANCE_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3; + + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance <em>Papyrus Text Instance</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Papyrus Text Instance</em>'. + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance + * @generated + */ + EClass getPapyrusTextInstance(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject <em>Edited Object</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Edited Object</em>'. + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getEditedObject() + * @see #getPapyrusTextInstance() + * @generated + */ + EReference getPapyrusTextInstance_EditedObject(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType <em>Type</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Type</em>'. + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getType() + * @see #getPapyrusTextInstance() + * @generated + */ + EAttribute getPapyrusTextInstance_Type(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance#getName() + * @see #getPapyrusTextInstance() + * @generated + */ + EAttribute getPapyrusTextInstance_Name(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + PapyrustextinstanceFactory getPapyrustextinstanceFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl <em>Papyrus Text Instance</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrustextinstancePackageImpl#getPapyrusTextInstance() + * @generated + */ + EClass PAPYRUS_TEXT_INSTANCE = eINSTANCE.getPapyrusTextInstance(); + + /** + * The meta object literal for the '<em><b>Edited Object</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT = eINSTANCE.getPapyrusTextInstance_EditedObject(); + + /** + * The meta object literal for the '<em><b>Type</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PAPYRUS_TEXT_INSTANCE__TYPE = eINSTANCE.getPapyrusTextInstance_Type(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PAPYRUS_TEXT_INSTANCE__NAME = eINSTANCE.getPapyrusTextInstance_Name(); + + } + +} //PapyrustextinstancePackage diff --git a/examples/others/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..358c23bd40a 100644 --- a/examples/others/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 @@ -1,289 +1,289 @@ -/**
- * 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.text.instance.papyrustextinstance.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.EModelElementImpl;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Papyrus Text Instance</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl#getEditedObject <em>Edited Object</em>}</li>
- * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class PapyrusTextInstanceImpl extends EModelElementImpl implements PapyrusTextInstance {
- /**
- * The cached value of the '{@link #getEditedObject() <em>Edited Object</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEditedObject()
- * @generated
- * @ordered
- */
- protected EObject editedObject;
-
- /**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected static final String TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected String type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PapyrusTextInstanceImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return PapyrustextinstancePackage.Literals.PAPYRUS_TEXT_INSTANCE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject getEditedObject() {
- if (editedObject != null && editedObject.eIsProxy()) {
- InternalEObject oldEditedObject = (InternalEObject)editedObject;
- editedObject = eResolveProxy(oldEditedObject);
- if (editedObject != oldEditedObject) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT, oldEditedObject, editedObject));
- }
- }
- return editedObject;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EObject basicGetEditedObject() {
- return editedObject;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setEditedObject(EObject newEditedObject) {
- EObject oldEditedObject = editedObject;
- editedObject = newEditedObject;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT, oldEditedObject, editedObject));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getType() {
- return type;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setType(String newType) {
- String oldType = type;
- type = newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE, oldType, type));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT:
- if (resolve) return getEditedObject();
- return basicGetEditedObject();
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE:
- return getType();
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT:
- setEditedObject((EObject)newValue);
- return;
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE:
- setType((String)newValue);
- return;
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT:
- setEditedObject((EObject)null);
- return;
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT:
- return editedObject != null;
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE:
- return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (type: ");
- result.append(type);
- result.append(", name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-} //PapyrusTextInstanceImpl
+/** + * 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.text.instance.papyrustextinstance.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EModelElementImpl; +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance; +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Papyrus Text Instance</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl#getEditedObject <em>Edited Object</em>}</li> + * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl#getType <em>Type</em>}</li> + * <li>{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.impl.PapyrusTextInstanceImpl#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class PapyrusTextInstanceImpl extends EModelElementImpl implements PapyrusTextInstance { + /** + * The cached value of the '{@link #getEditedObject() <em>Edited Object</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getEditedObject() + * @generated + * @ordered + */ + protected EObject editedObject; + + /** + * The default value of the '{@link #getType() <em>Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getType() + * @generated + * @ordered + */ + protected static final String TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getType() <em>Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getType() + * @generated + * @ordered + */ + protected String type = TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected PapyrusTextInstanceImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return PapyrustextinstancePackage.Literals.PAPYRUS_TEXT_INSTANCE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject getEditedObject() { + if (editedObject != null && editedObject.eIsProxy()) { + InternalEObject oldEditedObject = (InternalEObject)editedObject; + editedObject = eResolveProxy(oldEditedObject); + if (editedObject != oldEditedObject) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT, oldEditedObject, editedObject)); + } + } + return editedObject; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EObject basicGetEditedObject() { + return editedObject; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setEditedObject(EObject newEditedObject) { + EObject oldEditedObject = editedObject; + editedObject = newEditedObject; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT, oldEditedObject, editedObject)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getType() { + return type; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setType(String newType) { + String oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE, oldType, type)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT: + if (resolve) return getEditedObject(); + return basicGetEditedObject(); + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE: + return getType(); + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT: + setEditedObject((EObject)newValue); + return; + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE: + setType((String)newValue); + return; + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT: + setEditedObject((EObject)null); + return; + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE: + setType(TYPE_EDEFAULT); + return; + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT: + return editedObject != null; + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__TYPE: + return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (type: "); + result.append(type); + result.append(", name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //PapyrusTextInstanceImpl diff --git a/examples/others/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..1301cc712e4 100644 --- a/examples/others/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 @@ -1,105 +1,105 @@ -/**
- * 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.text.instance.papyrustextinstance.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.*;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class PapyrustextinstanceFactoryImpl extends EFactoryImpl implements PapyrustextinstanceFactory {
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static PapyrustextinstanceFactory init() {
- try {
- PapyrustextinstanceFactory thePapyrustextinstanceFactory = (PapyrustextinstanceFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance");
- if (thePapyrustextinstanceFactory != null) {
- return thePapyrustextinstanceFactory;
- }
- }
- catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new PapyrustextinstanceFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PapyrustextinstanceFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE: return createPapyrusTextInstance();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PapyrusTextInstance createPapyrusTextInstance() {
- PapyrusTextInstanceImpl papyrusTextInstance = new PapyrusTextInstanceImpl();
- return papyrusTextInstance;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PapyrustextinstancePackage getPapyrustextinstancePackage() {
- return (PapyrustextinstancePackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static PapyrustextinstancePackage getPackage() {
- return PapyrustextinstancePackage.eINSTANCE;
- }
-
-} //PapyrustextinstanceFactoryImpl
+/** + * 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.text.instance.papyrustextinstance.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.*; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class PapyrustextinstanceFactoryImpl extends EFactoryImpl implements PapyrustextinstanceFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static PapyrustextinstanceFactory init() { + try { + PapyrustextinstanceFactory thePapyrustextinstanceFactory = (PapyrustextinstanceFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/Papyrus/Example/0.9.0/papyrustextinstance"); + if (thePapyrustextinstanceFactory != null) { + return thePapyrustextinstanceFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new PapyrustextinstanceFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrustextinstanceFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE: return createPapyrusTextInstance(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrusTextInstance createPapyrusTextInstance() { + PapyrusTextInstanceImpl papyrusTextInstance = new PapyrusTextInstanceImpl(); + return papyrusTextInstance; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrustextinstancePackage getPapyrustextinstancePackage() { + return (PapyrustextinstancePackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static PapyrustextinstancePackage getPackage() { + return PapyrustextinstancePackage.eINSTANCE; + } + +} //PapyrustextinstanceFactoryImpl diff --git a/examples/others/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..ad510dc3592 100644 --- a/examples/others/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 @@ -1,218 +1,218 @@ -/**
- * 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.text.instance.papyrustextinstance.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcorePackage;
-
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- * @generated
- */
-public class PapyrustextinstancePackageImpl extends EPackageImpl implements PapyrustextinstancePackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass papyrusTextInstanceEClass = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#eNS_URI
- * @see #init()
- * @generated
- */
- private PapyrustextinstancePackageImpl() {
- super(eNS_URI, PapyrustextinstanceFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link PapyrustextinstancePackage#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static PapyrustextinstancePackage init() {
- if (isInited) return (PapyrustextinstancePackage)EPackage.Registry.INSTANCE.getEPackage(PapyrustextinstancePackage.eNS_URI);
-
- // Obtain or create and register package
- PapyrustextinstancePackageImpl thePapyrustextinstancePackage = (PapyrustextinstancePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PapyrustextinstancePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PapyrustextinstancePackageImpl());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
-
- // Create package meta-data objects
- thePapyrustextinstancePackage.createPackageContents();
-
- // Initialize created meta-data
- thePapyrustextinstancePackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- thePapyrustextinstancePackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(PapyrustextinstancePackage.eNS_URI, thePapyrustextinstancePackage);
- return thePapyrustextinstancePackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EClass getPapyrusTextInstance() {
- return papyrusTextInstanceEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EReference getPapyrusTextInstance_EditedObject() {
- return (EReference)papyrusTextInstanceEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPapyrusTextInstance_Type() {
- return (EAttribute)papyrusTextInstanceEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EAttribute getPapyrusTextInstance_Name() {
- return (EAttribute)papyrusTextInstanceEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PapyrustextinstanceFactory getPapyrustextinstanceFactory() {
- return (PapyrustextinstanceFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents() {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- papyrusTextInstanceEClass = createEClass(PAPYRUS_TEXT_INSTANCE);
- createEReference(papyrusTextInstanceEClass, PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT);
- createEAttribute(papyrusTextInstanceEClass, PAPYRUS_TEXT_INSTANCE__TYPE);
- createEAttribute(papyrusTextInstanceEClass, PAPYRUS_TEXT_INSTANCE__NAME);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents() {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- papyrusTextInstanceEClass.getESuperTypes().add(theEcorePackage.getEModelElement());
-
- // Initialize classes and features; add operations and parameters
- initEClass(papyrusTextInstanceEClass, PapyrusTextInstance.class, "PapyrusTextInstance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getPapyrusTextInstance_EditedObject(), theEcorePackage.getEObject(), null, "editedObject", null, 0, 1, PapyrusTextInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPapyrusTextInstance_Type(), ecorePackage.getEString(), "type", null, 0, 1, PapyrusTextInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getPapyrusTextInstance_Name(), ecorePackage.getEString(), "name", null, 0, 1, PapyrusTextInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Create resource
- createResource(eNS_URI);
- }
-
-} //PapyrustextinstancePackageImpl
+/** + * 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.text.instance.papyrustextinstance.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance; +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstanceFactory; +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class PapyrustextinstancePackageImpl extends EPackageImpl implements PapyrustextinstancePackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass papyrusTextInstanceEClass = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage#eNS_URI + * @see #init() + * @generated + */ + private PapyrustextinstancePackageImpl() { + super(eNS_URI, PapyrustextinstanceFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link PapyrustextinstancePackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static PapyrustextinstancePackage init() { + if (isInited) return (PapyrustextinstancePackage)EPackage.Registry.INSTANCE.getEPackage(PapyrustextinstancePackage.eNS_URI); + + // Obtain or create and register package + PapyrustextinstancePackageImpl thePapyrustextinstancePackage = (PapyrustextinstancePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PapyrustextinstancePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PapyrustextinstancePackageImpl()); + + isInited = true; + + // Initialize simple dependencies + EcorePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + thePapyrustextinstancePackage.createPackageContents(); + + // Initialize created meta-data + thePapyrustextinstancePackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + thePapyrustextinstancePackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(PapyrustextinstancePackage.eNS_URI, thePapyrustextinstancePackage); + return thePapyrustextinstancePackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getPapyrusTextInstance() { + return papyrusTextInstanceEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getPapyrusTextInstance_EditedObject() { + return (EReference)papyrusTextInstanceEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPapyrusTextInstance_Type() { + return (EAttribute)papyrusTextInstanceEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPapyrusTextInstance_Name() { + return (EAttribute)papyrusTextInstanceEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrustextinstanceFactory getPapyrustextinstanceFactory() { + return (PapyrustextinstanceFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + papyrusTextInstanceEClass = createEClass(PAPYRUS_TEXT_INSTANCE); + createEReference(papyrusTextInstanceEClass, PAPYRUS_TEXT_INSTANCE__EDITED_OBJECT); + createEAttribute(papyrusTextInstanceEClass, PAPYRUS_TEXT_INSTANCE__TYPE); + createEAttribute(papyrusTextInstanceEClass, PAPYRUS_TEXT_INSTANCE__NAME); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + papyrusTextInstanceEClass.getESuperTypes().add(theEcorePackage.getEModelElement()); + + // Initialize classes and features; add operations and parameters + initEClass(papyrusTextInstanceEClass, PapyrusTextInstance.class, "PapyrusTextInstance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPapyrusTextInstance_EditedObject(), theEcorePackage.getEObject(), null, "editedObject", null, 0, 1, PapyrusTextInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPapyrusTextInstance_Type(), ecorePackage.getEString(), "type", null, 0, 1, PapyrusTextInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPapyrusTextInstance_Name(), ecorePackage.getEString(), "name", null, 0, 1, PapyrusTextInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //PapyrustextinstancePackageImpl diff --git a/examples/others/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..611e831fc44 100644 --- a/examples/others/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 @@ -1,149 +1,149 @@ -/**
- * 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.text.instance.papyrustextinstance.util;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Adapter Factory</b> for the model.
- * It provides an adapter <code>createXXX</code> method for each class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage
- * @generated
- */
-public class PapyrustextinstanceAdapterFactory extends AdapterFactoryImpl {
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static PapyrustextinstancePackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PapyrustextinstanceAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = PapyrustextinstancePackage.eINSTANCE;
- }
- }
-
- /**
- * Returns whether this factory is applicable for the type of the object.
- * <!-- begin-user-doc -->
- * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
- * <!-- end-user-doc -->
- * @return whether this factory is applicable for the type of the object.
- * @generated
- */
- @Override
- public boolean isFactoryForType(Object object) {
- if (object == modelPackage) {
- return true;
- }
- if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
- }
- return false;
- }
-
- /**
- * The switch that delegates to the <code>createXXX</code> methods.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PapyrustextinstanceSwitch<Adapter> modelSwitch =
- new PapyrustextinstanceSwitch<Adapter>() {
- @Override
- public Adapter casePapyrusTextInstance(PapyrusTextInstance object) {
- return createPapyrusTextInstanceAdapter();
- }
- @Override
- public Adapter caseEModelElement(EModelElement object) {
- return createEModelElementAdapter();
- }
- @Override
- public Adapter defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
-
- /**
- * Creates an adapter for the <code>target</code>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param target the object to adapt.
- * @return the adapter for the <code>target</code>.
- * @generated
- */
- @Override
- public Adapter createAdapter(Notifier target) {
- return modelSwitch.doSwitch((EObject)target);
- }
-
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance <em>Papyrus Text Instance</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance
- * @generated
- */
- public Adapter createPapyrusTextInstanceAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement <em>EModel Element</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.emf.ecore.EModelElement
- * @generated
- */
- public Adapter createEModelElementAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for the default case.
- * <!-- begin-user-doc -->
- * This default implementation returns null.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @generated
- */
- public Adapter createEObjectAdapter() {
- return null;
- }
-
-} //PapyrustextinstanceAdapterFactory
+/** + * 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.text.instance.papyrustextinstance.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.*; + +/** + * <!-- begin-user-doc --> + * The <b>Adapter Factory</b> for the model. + * It provides an adapter <code>createXXX</code> method for each class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage + * @generated + */ +public class PapyrustextinstanceAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static PapyrustextinstancePackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrustextinstanceAdapterFactory() { + if (modelPackage == null) { + modelPackage = PapyrustextinstancePackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. + * <!-- end-user-doc --> + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected PapyrustextinstanceSwitch<Adapter> modelSwitch = + new PapyrustextinstanceSwitch<Adapter>() { + @Override + public Adapter casePapyrusTextInstance(PapyrusTextInstance object) { + return createPapyrusTextInstanceAdapter(); + } + @Override + public Adapter caseEModelElement(EModelElement object) { + return createEModelElementAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance <em>Papyrus Text Instance</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance + * @generated + */ + public Adapter createPapyrusTextInstanceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement <em>EModel Element</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.emf.ecore.EModelElement + * @generated + */ + public Adapter createEModelElementAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //PapyrustextinstanceAdapterFactory diff --git a/examples/others/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..98b3da42643 100644 --- a/examples/others/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 @@ -1,137 +1,137 @@ -/**
- * 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.text.instance.papyrustextinstance.util;
-
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.util.Switch;
-
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.*;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Switch</b> for the model's inheritance hierarchy.
- * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
- * to invoke the <code>caseXXX</code> method for each class of the model,
- * starting with the actual class of the object
- * and proceeding up the inheritance hierarchy
- * until a non-null result is returned,
- * which is the result of the switch.
- * <!-- end-user-doc -->
- * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage
- * @generated
- */
-public class PapyrustextinstanceSwitch<T> extends Switch<T> {
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected static PapyrustextinstancePackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PapyrustextinstanceSwitch() {
- if (modelPackage == null) {
- modelPackage = PapyrustextinstancePackage.eINSTANCE;
- }
- }
-
- /**
- * Checks whether this is a switch for the given package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @parameter ePackage the package in question.
- * @return whether this is a switch for the given package.
- * @generated
- */
- @Override
- protected boolean isSwitchFor(EPackage ePackage) {
- return ePackage == modelPackage;
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- @Override
- protected T doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE: {
- PapyrusTextInstance papyrusTextInstance = (PapyrusTextInstance)theEObject;
- T result = casePapyrusTextInstance(papyrusTextInstance);
- if (result == null) result = caseEModelElement(papyrusTextInstance);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- default: return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Papyrus Text Instance</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Papyrus Text Instance</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T casePapyrusTextInstance(PapyrusTextInstance object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>EModel Element</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>EModel Element</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseEModelElement(EModelElement object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject)
- * @generated
- */
- @Override
- public T defaultCase(EObject object) {
- return null;
- }
-
-} //PapyrustextinstanceSwitch
+/** + * 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.text.instance.papyrustextinstance.util; + +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.*; + +/** + * <!-- begin-user-doc --> + * The <b>Switch</b> for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the <code>caseXXX</code> method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrustextinstancePackage + * @generated + */ +public class PapyrustextinstanceSwitch<T> extends Switch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static PapyrustextinstancePackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrustextinstanceSwitch() { + if (modelPackage == null) { + modelPackage = PapyrustextinstancePackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case PapyrustextinstancePackage.PAPYRUS_TEXT_INSTANCE: { + PapyrusTextInstance papyrusTextInstance = (PapyrusTextInstance)theEObject; + T result = casePapyrusTextInstance(papyrusTextInstance); + if (result == null) result = caseEModelElement(papyrusTextInstance); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Papyrus Text Instance</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Papyrus Text Instance</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePapyrusTextInstance(PapyrusTextInstance object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EModel Element</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EModel Element</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEModelElement(EModelElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //PapyrustextinstanceSwitch diff --git a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath +++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project index 8a94e000222..6689b573ac9 100644 --- a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project +++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.example.uml.comment.editor.newresource</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.example.uml.comment.editor.newresource</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/examples/uml/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..af0f20f97a5 100644 --- a/examples/uml/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 @@ -1,7 +1,7 @@ -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
+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/uml/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..d35d5aed64c 100644 --- a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html +++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties index d5b16c20732..0b785fa6afe 100644 --- a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties +++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.newresource/build.properties @@ -1,10 +1,10 @@ -source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- icons/,\
- build.properties,\
- about.html,\
- plugin.properties
-src.includes = about.html
+source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + build.properties,\ + about.html,\ + plugin.properties +src.includes = about.html diff --git a/examples/uml/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..9961643e183 100644 --- a/examples/uml/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 @@ -1,67 +1,67 @@ -/*****************************************************************************
- * 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;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.example.uml.comment.editor.newresource"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- public static LogHelper log;
-
- /**
- * 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;
- log = new LogHelper(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;
- }
-
-}
+/***************************************************************************** + * 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; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.example.uml.comment.editor.newresource"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * 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; + log = new LogHelper(this); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath +++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project index fc3da8cd541..893c11e4657 100644 --- a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project +++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.example.uml.comment.editor.sharedresource</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.example.uml.comment.editor.sharedresource</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/examples/uml/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..af0f20f97a5 100644 --- a/examples/uml/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 @@ -1,7 +1,7 @@ -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
+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/uml/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..d35d5aed64c 100644 --- a/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html +++ b/examples/uml/org.eclipse.papyrus.example.uml.comment.editor.sharedresource/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/uml/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..9e5349827f7 100644 --- a/examples/uml/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 @@ -1,67 +1,67 @@ -/*****************************************************************************
- * 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;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.example.uml.comment.editor.sharedresource"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- public static LogHelper log;
-
- /**
- * 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;
- log = new LogHelper(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;
- }
-
-}
+/***************************************************************************** + * 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; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.example.uml.comment.editor.sharedresource"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * 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; + log = new LogHelper(this); + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/examples/uml/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..bcfe5f2e603 100644 --- a/examples/uml/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 @@ -1,102 +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.sharedresource.modelresource;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance;
-import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource;
-import org.eclipse.papyrus.infra.core.resource.IModel;
-
-
-public class TextEditorModelSharedResource extends AbstractModelWithSharedResource<PapyrusTextInstance> implements IModel {
-
-
- /**
- * File extension used for notation.
- */
- public static final String NOTATION_FILE_EXTENSION = "notation"; //$NON-NLS-1$
-
- /**
- * Model ID.
- */
- public static final String MODEL_ID = "org.eclipse.papyrus.example.text.TextEditorModelSharedResource"; //$NON-NLS-1$
-
-
- /**
- *
- * Constructor.
- *
- */
- public TextEditorModelSharedResource() {
-
- }
-
-
- /**
- * Get the file extension used for this model.
- *
- * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension()
- *
- * @return
- */
- @Override
- protected String getModelFileExtension() {
- return NOTATION_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) {
- getResource().getContents().add(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);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject)
- *
- * @param object
- * @return
- */
- @Override
- protected boolean isModelRoot(EObject object) {
- return false;
- }
-
-}
+/***************************************************************************** + * 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.modelresource; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.example.text.instance.papyrustextinstance.PapyrusTextInstance; +import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource; +import org.eclipse.papyrus.infra.core.resource.IModel; + + +public class TextEditorModelSharedResource extends AbstractModelWithSharedResource<PapyrusTextInstance> implements IModel { + + + /** + * File extension used for notation. + */ + public static final String NOTATION_FILE_EXTENSION = "notation"; //$NON-NLS-1$ + + /** + * Model ID. + */ + public static final String MODEL_ID = "org.eclipse.papyrus.example.text.TextEditorModelSharedResource"; //$NON-NLS-1$ + + + /** + * + * Constructor. + * + */ + public TextEditorModelSharedResource() { + + } + + + /** + * Get the file extension used for this model. + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension() + * + * @return + */ + @Override + protected String getModelFileExtension() { + return NOTATION_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) { + getResource().getContents().add(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); + } + + /** + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject) + * + * @param object + * @return + */ + @Override + protected boolean isModelRoot(EObject object) { + return false; + } + +} diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.classpath b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.classpath index 2d1a4302f04..64c5e31b7a2 100644 --- a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.classpath +++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/.classpath @@ -1,7 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/examples/uml/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..c585cc455ae 100644 --- a/examples/uml/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 @@ -1,291 +1,291 @@ -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
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=0
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=260
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=false
-org.eclipse.jdt.core.formatter.join_wrapped_lines=false
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=260
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+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 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF index 0b0d2819a20..f77cc4acde9 100644 --- a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF +++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/META-INF/MANIFEST.MF @@ -1,17 +1,17 @@ -Manifest-Version: 1.0
-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="[2.0.0,3.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
-Bundle-Version: 1.2.0.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.emftree.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.emftree;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.papyrus.infra.ui.extension.diagrameditor
+Manifest-Version: 1.0 +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="[2.0.0,3.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 +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-Activator: org.eclipse.papyrus.uml.diagram.emftree.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.emftree;singleton:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Import-Package: org.eclipse.papyrus.infra.ui.extension.diagrameditor diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/about.html b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/about.html index 82d49bf5f81..d35d5aed64c 100644 --- a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/about.html +++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/about.html @@ -1,28 +1,28 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 5, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html> diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/build.properties b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/build.properties index 89ca08f7e80..ad951c8a314 100644 --- a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/build.properties +++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/build.properties @@ -1,6 +1,6 @@ -#
-#Mon Sep 12 09:29:46 CEST 2011
-bin.includes=META-INF/,.,plugin.xml,icons/,about.html,plugin.properties
-output.. = bin/
-src.includes = about.html
+# +#Mon Sep 12 09:29:46 CEST 2011 +bin.includes=META-INF/,.,plugin.xml,icons/,about.html,plugin.properties +output.. = bin/ +src.includes = about.html source.. = src/
\ No newline at end of file diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties index 4b7251160db..6f337050c59 100644 --- a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties +++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.properties @@ -1,12 +1,12 @@ -#################################################################################
-# Copyright (c) 2008 CEA LIST.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# CEA LIST - initial API and implementation
-##################################################################################
-pluginName=Papyrus EMF Tree Example
-providerName=Eclipse Modeling Project
+################################################################################# +# Copyright (c) 2008 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +################################################################################## +pluginName=Papyrus EMF Tree Example +providerName=Eclipse Modeling Project diff --git a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml index 1a42a4f00f2..f2ab829ab06 100644 --- a/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml +++ b/examples/uml/org.eclipse.papyrus.uml.diagram.emftree/plugin.xml @@ -1,66 +1,66 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.ui.commands">
- <command
- description="Create an UML 2 Tree (EMF Tree)"
- id="com.cea.papyrus.ui.emftree.createTree"
- name="Create Tree">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.uml.diagram.emftree.CreateEMFTreeDiagramHandler"
- commandId="com.cea.papyrus.ui.emftree.createTree">
- <enabledWhen>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </enabledWhen>
- </handler>
- </extension>
-
- <extension
- point="org.eclipse.papyrus.infra.ui.papyrusDiagram">
- <editorDiagram
- actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor"
- contextId="defaultContext"
- factoryClass="org.eclipse.papyrus.uml.diagram.emftree.EmfTreeDiagramEditorFactory">
- </editorDiagram>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="menu:org.eclipse.papyrus.ui.menu">
- <menu
- id="org.eclipse.papyrus.uml.diagram.ui.menu.diagrams"
- label="Diagrams">
- <command
- commandId="com.cea.papyrus.ui.emftree.createTree"
- icon="icons/EmfTree.gif"
- label="Create a new EMF Tree"
- style="push"
- tooltip="Create a new EMF Tree">
- </command>
- </menu>
- </menuContribution>
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar
- id="org.eclipse.papyrus.ui.toolbar">
- <command
- commandId="com.cea.papyrus.ui.emftree.createTree"
- icon="icons/EmfTree.gif"
- label="Create a new EMF Tree"
- style="push"
- tooltip="Create a new EMF Tree">
- </command>
- </toolbar>
- </menuContribution>
- </extension>
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.2"?> +<plugin> + <extension + point="org.eclipse.ui.commands"> + <command + description="Create an UML 2 Tree (EMF Tree)" + id="com.cea.papyrus.ui.emftree.createTree" + name="Create Tree"> + </command> + </extension> + <extension + point="org.eclipse.ui.handlers"> + <handler + class="org.eclipse.papyrus.uml.diagram.emftree.CreateEMFTreeDiagramHandler" + commandId="com.cea.papyrus.ui.emftree.createTree"> + <enabledWhen> + <with + variable="activeEditorId"> + <equals + value="org.eclipse.papyrus.infra.core.papyrusEditor"> + </equals> + </with> + </enabledWhen> + </handler> + </extension> + + <extension + point="org.eclipse.papyrus.infra.ui.papyrusDiagram"> + <editorDiagram + actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor" + contextId="defaultContext" + factoryClass="org.eclipse.papyrus.uml.diagram.emftree.EmfTreeDiagramEditorFactory"> + </editorDiagram> + </extension> + <extension + point="org.eclipse.ui.menus"> + <menuContribution + locationURI="menu:org.eclipse.papyrus.ui.menu"> + <menu + id="org.eclipse.papyrus.uml.diagram.ui.menu.diagrams" + label="Diagrams"> + <command + commandId="com.cea.papyrus.ui.emftree.createTree" + icon="icons/EmfTree.gif" + label="Create a new EMF Tree" + style="push" + tooltip="Create a new EMF Tree"> + </command> + </menu> + </menuContribution> + <menuContribution + locationURI="toolbar:org.eclipse.ui.main.toolbar"> + <toolbar + id="org.eclipse.papyrus.ui.toolbar"> + <command + commandId="com.cea.papyrus.ui.emftree.createTree" + icon="icons/EmfTree.gif" + label="Create a new EMF Tree" + style="push" + tooltip="Create a new EMF Tree"> + </command> + </toolbar> + </menuContribution> + </extension> +</plugin> diff --git a/examples/uml/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..2e14705974d 100644 --- a/examples/uml/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 @@ -1,71 +1,71 @@ -/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.emftree;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.diagram.emftree";
-
- // The shared instance
- private static Activator plugin;
-
- public static LogHelper log;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- log = new LogHelper(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- 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;
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2008 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.emftree; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.diagram.emftree"; + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/examples/uml/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..5bfe443f44c 100644 --- a/examples/uml/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 @@ -1,29 +1,29 @@ -/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.emftree;
-
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.emf.diagram.common.handler.CreateDiagramHandler;
-
-public class CreateEMFTreeDiagramHandler extends CreateDiagramHandler {
-
- @Override
- protected void addNewDiagram(ServicesRegistry registry) {
- addNewDiagram("Emf Tree", EmfTreeDiagramEditorFactory.EMF_DIAGRAM_TYPE, null, registry);
- }
-
- public void createDiagram(ServicesRegistry registry) {
- addNewDiagram(registry);
- }
-}
+/***************************************************************************** + * Copyright (c) 2008 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.emftree; + +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.emf.diagram.common.handler.CreateDiagramHandler; + +public class CreateEMFTreeDiagramHandler extends CreateDiagramHandler { + + @Override + protected void addNewDiagram(ServicesRegistry registry) { + addNewDiagram("Emf Tree", EmfTreeDiagramEditorFactory.EMF_DIAGRAM_TYPE, null, registry); + } + + public void createDiagram(ServicesRegistry registry) { + addNewDiagram(registry); + } +} diff --git a/examples/uml/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..ae5360dd3dc 100644 --- a/examples/uml/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 @@ -1,225 +1,225 @@ -/*****************************************************************************
- * Copyright (c) 2008, 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Christian W. Damus (CEA) - Adapt to EMF codegen changes for bug 331055
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.emftree;
-
-import java.util.EventObject;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.command.CommandStackListener;
-import org.eclipse.emf.common.ui.viewer.IViewerProvider;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.papyrus.infra.core.editor.BackboneException;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-
-/**
- * This is an example of a EMF UML model editor. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
-public class UMLEditor extends org.eclipse.uml2.uml.editor.presentation.UMLEditor implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
-
- /**
- * ServiceRegistry used to retrieve needed services. This registry is provided by the multieditor.
- */
- protected ServicesRegistry servicesRegistry;
-
- protected CommandStackListener commandStackListener;
-
- /**
- *
- * Constructor. Create an DiEditor using the {@link ServicesRegistry}.
- *
- * @param servicesRegistry
- */
- public UMLEditor(ServicesRegistry servicesRegistry) throws ServiceException, BackboneException {
- this.servicesRegistry = servicesRegistry;
- initEditor();
- }
-
- /**
- * Init the editor from the specified context.
- *
- * @param editorContext
- * @throws ServiceException
- */
- private void initEditor() throws ServiceException {
-
- TransactionalEditingDomain papyrusEditingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
- CommandStack commandStack = papyrusEditingDomain.getCommandStack();
-
- // Add a listener to set the most recent command's affected objects to be the selection of
- // the viewer with focus.
- //
-
- commandStackListener = new CommandStackListener() {
-
- public void commandStackChanged(final EventObject event) {
- if (getContainer().isDisposed()) {
- return;
- }
- getContainer().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- firePropertyChange(IEditorPart.PROP_DIRTY);
-
- // Try to select the affected objects.
- //
- Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
- if (mostRecentCommand != null) {
- setSelectionToViewer(mostRecentCommand.getAffectedObjects());
- }
-
- for (Iterator<PropertySheetPage> i = propertySheetPages
- .iterator(); i.hasNext();) {
-
- PropertySheetPage propertySheetPage = i.next();
-
- if ((propertySheetPage.getControl() == null)
- || propertySheetPage.getControl().isDisposed()) {
-
- i.remove();
- } else {
- propertySheetPage.refresh();
- }
- }
- }
- });
- }
-
- };
-
- commandStack.addCommandStackListener(commandStackListener);
-
- // Create the editing domain with a special command stack.
- //
- // Set the resourceSet wth our own resourceSet.
- // editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new
- // HashMap<Resource, Boolean>());
-
- ResourceSet resourceSet = papyrusEditingDomain.getResourceSet();
- editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, resourceSet);
-
- // editingDomain = editorContext.getTransactionalEditingDomain();
- // editingDomain.setResourceToReadOnlyMap(new HashMap<Resource, Boolean>());
- }
-
- /**
- * This is the method called to load a resource into the editing domain's resource set based on
- * the editor's input. Put the existing model into the editingDomain. <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void createModel() {
- // model is already created and loaded. Do nothing.
- }
-
- /**
- * This is for implementing {@link IEditorPart} and simply saves the model file. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void doSave(IProgressMonitor progressMonitor) {
- }
-
- /**
- * This also changes the editor's input. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void doSaveAs() {
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected void doSaveAs(URI uri, IEditorInput editorInput) {
- }
-
- @Override
- public void init(IEditorSite site, IEditorInput editorInput) {
- super.init(site, editorInput);
- setPartName("emf tree");
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public IActionBars getActionBars() {
- try {
- return getActionBarContributor().getActionBars();
- } catch (NullPointerException e) {
- // If we are nested, we have not access to ActionBarContributor()
- return null;
- }
- }
-
- @Override
- public void dispose() {
- // super.dispose(); //FIXME: Fails on a ClassCastException: The ActionBarContributor is not accessible
- try {
- TransactionalEditingDomain papyrusEditingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
- CommandStack commandStack = papyrusEditingDomain.getCommandStack();
- commandStack.removeCommandStackListener(commandStackListener);
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
- }
-
- /**
- * Has we have no actionBarContributor, we can't get the status line. So skip this method.
- */
- @Override
- public void setStatusLineManager(ISelection selection) {
-
- }
-
- /**
- * Disable the native property sheet page.
- */
- @Override
- public IPropertySheetPage getPropertySheetPage() {
-
- return null;
- }
-}
+/***************************************************************************** + * Copyright (c) 2008, 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: + * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - Adapt to EMF codegen changes for bug 331055 + * + *****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.emftree; + +import java.util.EventObject; +import java.util.Iterator; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.command.CommandStackListener; +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.papyrus.infra.core.editor.BackboneException; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheetPage; + +/** + * This is an example of a EMF UML model editor. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ +public class UMLEditor extends org.eclipse.uml2.uml.editor.presentation.UMLEditor implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { + + /** + * ServiceRegistry used to retrieve needed services. This registry is provided by the multieditor. + */ + protected ServicesRegistry servicesRegistry; + + protected CommandStackListener commandStackListener; + + /** + * + * Constructor. Create an DiEditor using the {@link ServicesRegistry}. + * + * @param servicesRegistry + */ + public UMLEditor(ServicesRegistry servicesRegistry) throws ServiceException, BackboneException { + this.servicesRegistry = servicesRegistry; + initEditor(); + } + + /** + * Init the editor from the specified context. + * + * @param editorContext + * @throws ServiceException + */ + private void initEditor() throws ServiceException { + + TransactionalEditingDomain papyrusEditingDomain = servicesRegistry.getService(TransactionalEditingDomain.class); + CommandStack commandStack = papyrusEditingDomain.getCommandStack(); + + // Add a listener to set the most recent command's affected objects to be the selection of + // the viewer with focus. + // + + commandStackListener = new CommandStackListener() { + + public void commandStackChanged(final EventObject event) { + if (getContainer().isDisposed()) { + return; + } + getContainer().getDisplay().asyncExec(new Runnable() { + + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + + // Try to select the affected objects. + // + Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); + if (mostRecentCommand != null) { + setSelectionToViewer(mostRecentCommand.getAffectedObjects()); + } + + for (Iterator<PropertySheetPage> i = propertySheetPages + .iterator(); i.hasNext();) { + + PropertySheetPage propertySheetPage = i.next(); + + if ((propertySheetPage.getControl() == null) + || propertySheetPage.getControl().isDisposed()) { + + i.remove(); + } else { + propertySheetPage.refresh(); + } + } + } + }); + } + + }; + + commandStack.addCommandStackListener(commandStackListener); + + // Create the editing domain with a special command stack. + // + // Set the resourceSet wth our own resourceSet. + // editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new + // HashMap<Resource, Boolean>()); + + ResourceSet resourceSet = papyrusEditingDomain.getResourceSet(); + editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, resourceSet); + + // editingDomain = editorContext.getTransactionalEditingDomain(); + // editingDomain.setResourceToReadOnlyMap(new HashMap<Resource, Boolean>()); + } + + /** + * This is the method called to load a resource into the editing domain's resource set based on + * the editor's input. Put the existing model into the editingDomain. <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public void createModel() { + // model is already created and loaded. Do nothing. + } + + /** + * This is for implementing {@link IEditorPart} and simply saves the model file. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public void doSave(IProgressMonitor progressMonitor) { + } + + /** + * This also changes the editor's input. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public void doSaveAs() { + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + protected void doSaveAs(URI uri, IEditorInput editorInput) { + } + + @Override + public void init(IEditorSite site, IEditorInput editorInput) { + super.init(site, editorInput); + setPartName("emf tree"); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public IActionBars getActionBars() { + try { + return getActionBarContributor().getActionBars(); + } catch (NullPointerException e) { + // If we are nested, we have not access to ActionBarContributor() + return null; + } + } + + @Override + public void dispose() { + // super.dispose(); //FIXME: Fails on a ClassCastException: The ActionBarContributor is not accessible + try { + TransactionalEditingDomain papyrusEditingDomain = servicesRegistry.getService(TransactionalEditingDomain.class); + CommandStack commandStack = papyrusEditingDomain.getCommandStack(); + commandStack.removeCommandStackListener(commandStackListener); + } catch (ServiceException e) { + Activator.log.error(e); + } + } + + /** + * Has we have no actionBarContributor, we can't get the status line. So skip this method. + */ + @Override + public void setStatusLineManager(ISelection selection) { + + } + + /** + * Disable the native property sheet page. + */ + @Override + public IPropertySheetPage getPropertySheetPage() { + + return null; + } +} diff --git a/examples/user/org.eclipse.papyrus.examples.user.qvto/.project b/examples/user/org.eclipse.papyrus.examples.user.qvto/.project index 24109f6ecc2..71f46902240 100644 --- a/examples/user/org.eclipse.papyrus.examples.user.qvto/.project +++ b/examples/user/org.eclipse.papyrus.examples.user.qvto/.project @@ -1,28 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>QVToExamples</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>QVToExamples</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> |