Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Le Menez2018-01-09 10:09:46 +0000
committerQuentin Le Menez2018-01-09 13:18:15 +0000
commitd98116b5b376f18b6cf626ba4158a35fe9a4a64e (patch)
tree4458c9c5ada0a216b385813a56ea9a9b8c7b6509 /plugins/facet/editor
parent453e99bc2dcbd5fabad100f9d0d5f682013c3b19 (diff)
downloadorg.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 'plugins/facet/editor')
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/OSGI-INF/l10n/bundle.properties26
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/about.html54
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/build.properties16
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/plugin_dev.mediawiki52
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/user.mediawiki448
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/plugin.xml38
-rwxr-xr-xplugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/about.html56
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/build.properties8
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/plugin.xml16
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/resource/editor.textile348
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.classpath14
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.settings/org.eclipse.jdt.core.prefs582
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/META-INF/MANIFEST.MF46
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/about.html54
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/build.properties18
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/messages.properties194
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.properties296
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml88
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/pom.xml20
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Activator.java104
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ColorProvider.java132
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomActionBarContributor.java898
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditor.java4118
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditorPlugin.java218
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomModelWizard.java1286
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomViewer.java870
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/EMFUtil.java466
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/FormStyleSashForm.java284
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ImageProvider.java1540
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Messages.java244
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/messages.properties194
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.classpath14
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.settings/org.eclipse.jdt.core.prefs582
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/OSGI-INF/l10n/bundle.properties24
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/about.html54
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/index.html32
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/API_Policy.mediawiki154
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/capabilities.mediawiki88
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/checking_BREE.mediawiki38
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/new_and_noteworthy.mediawiki90
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/ramp_down.mediawiki22
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/retention_policy.mediawiki64
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/running_tests.mediawiki26
-rw-r--r--plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/src/org/eclipse/papyrus/emf/facet/doc/tasks/GenerateApiJavadocTask.java280
44 files changed, 7098 insertions, 7098 deletions
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/OSGI-INF/l10n/bundle.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/OSGI-INF/l10n/bundle.properties
index 37129f35e4f..3993d7a4804 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/OSGI-INF/l10n/bundle.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/OSGI-INF/l10n/bundle.properties
@@ -1,13 +1,13 @@
-###############################################################################
-# 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:
-# Nicolas Bros (Mia-Software) - Bug 375789 - Documentation
-###############################################################################
-#Properties file for org.eclipse.papyrus.emf.facet.custom.doc
-Bundle-Vendor = Eclipse Modeling Project
-Bundle-Name = Papyrus EMF Facet Customization Documentation
+###############################################################################
+# 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:
+# Nicolas Bros (Mia-Software) - Bug 375789 - Documentation
+###############################################################################
+#Properties file for org.eclipse.papyrus.emf.facet.custom.doc
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Papyrus EMF Facet Customization Documentation
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/about.html b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/about.html
index 3019b95b9cf..42595040e90 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/about.html
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/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>December 22, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>December 22, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/build.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/build.properties
index cdb6602c5fc..01f654c1381 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/build.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/build.properties
@@ -1,9 +1,9 @@
-bin.includes = META-INF/,\
- img/,\
- about.html,\
- plugin.xml,\
- mediawiki/,\
- toc-dev.xml,\
- OSGI-INF/,\
- toc-user.xml
+bin.includes = META-INF/,\
+ img/,\
+ about.html,\
+ plugin.xml,\
+ mediawiki/,\
+ toc-dev.xml,\
+ OSGI-INF/,\
+ toc-user.xml
src.includes = about.html
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/plugin_dev.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/plugin_dev.mediawiki
index 40541782a1e..83bf99c6b36 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/plugin_dev.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/plugin_dev.mediawiki
@@ -1,27 +1,27 @@
-== Customization selection dialog ==
-
-EMF Facet provides a customization selection dialog:
-
-[[Image:../img/LoadCustomizationsDialog.png]]
-
-To open this dialog to let the user select customizations, use <code>ILoadCustomizationsDialogFactory#createLoadCustomizationDialog</code> from the plug-in '''org.eclipse.papyrus.emf.facet.custom.ui'''. For example:
-
-<pre>
-ILoadCustomizationsDialogListener callback = new ILoadCustomizationsDialogListener() {
- public void okPressed(List<Customization> selection) {
- // do something with the selection
- }
-};
-ILoadCustomizationsDialog dialog = ILoadCustomizationsDialogFactory.DEFAULT.createLoadCustomizationDialog(
- getShell(), availableCustomizations, initiallySelectedCustomizations, callback);
-dialog.open();
-</pre>
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-Contributors: Nicolas Bros (Mia-Software)
+== Customization selection dialog ==
+
+EMF Facet provides a customization selection dialog:
+
+[[Image:../img/LoadCustomizationsDialog.png]]
+
+To open this dialog to let the user select customizations, use <code>ILoadCustomizationsDialogFactory#createLoadCustomizationDialog</code> from the plug-in '''org.eclipse.papyrus.emf.facet.custom.ui'''. For example:
+
+<pre>
+ILoadCustomizationsDialogListener callback = new ILoadCustomizationsDialogListener() {
+ public void okPressed(List<Customization> selection) {
+ // do something with the selection
+ }
+};
+ILoadCustomizationsDialog dialog = ILoadCustomizationsDialogFactory.DEFAULT.createLoadCustomizationDialog(
+ getShell(), availableCustomizations, initiallySelectedCustomizations, callback);
+dialog.open();
+</pre>
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+Contributors: Nicolas Bros (Mia-Software)
</font> \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/user.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/user.mediawiki
index 739c452d975..ae1d0f5d68e 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/user.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/mediawiki/user.mediawiki
@@ -1,224 +1,224 @@
-<h1>Table of Contents</h1>
-__TOC__
-
-EMF Facet provides a '''customization''' component, that can be used to define the appearance of model elements when viewed in an editor or view that supports this customization mechanism.
-
-== Description ==
-A customization is defined in a model that conforms to the EMF Facet customization metamodel. This model is saved in a file with the ".custom" file extension.
-
-== Customization Metamodel ==
-
-=== customizations ===
-
-A '''Customization''' is a '''FacetSet''':
-
-[[Image:../img/CustomizationMetaclass.png]]
-
-A '''Customization''' can contain customizations for Ecore metaclasses ('''EClassCustomization'''), or Facets ('''FacetCustomization'''). Both '''EClassCustomization''' and '''FacetCustomization''' are Facets.
-
-The '''extendedMetaclass''' of an '''EClassCustomization''' is the EClass whose instances will be customized.
-
-The '''extendedFacet''' of an '''EClassCustomization''' or '''FacetCustomization''' is the Facet that defines the customizable features (label, color, etc.) that will be customized.
-
-In case of facet customization, the '''customizedFacet''' of a '''FacetCustomization''' is the Facet for which model elements that conform to this Facet will be customized.
-
-[[Image:../img/EClassAndFacetCustomizationMetaclasses.png]]
-
-=== customizable features ===
-
-Customizable features are defined in Facets as FacetOperations. For example, this FacetSet defines basic customizable features such as label, icon, etc.: <code>platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet</code>
-
-The following instance diagram shows how a Facet named '''CustomizedEObject''' is defined in ''customproperties.efacet''. Its '''extendedMetaclass''' is '''EObject''', so it can be used to customize any model element. It contains '''FacetOperations''' (of which only two are represented here). These FacetOperations define the customizable features: here the '''label''' and '''image''' for a model element. The type of each of these FacetOperations is the customized feature's type : an '''EString''' for the label and an '''Image''' for the image.
-
-[[Image:../img/CustomizedEObject.png]]
-
-The operation is called each time the value of its customization is needed. For example, when displaying a model element in a viewer, we will need its label. So the '''label''' operation will be called on the model element for which the label is needed.
-
-=== customization override ===
-A FacetOperation that defines a customizable feature such as label, icon, color, font, etc. can be compared to a virtual method: it is meant to be overridden in extending Facets in order to provide a specific customization.
-
-To understand this override mechanism, remember that a '''EClassCustomization''' and '''FacetCustomization''' are '''Facets''' (the '''EClassCustomization''' and '''FacetCustomization''' metaclasses extend the '''Facet''' metaclass).
-
-==== customizing an EClass ====
-
-To create a customization for instances of an '''EClass''':
-* create an '''EClassCustomization'''
-* the new '''EClassCustomization''''s '''extendedMetaclass''' is the '''EClass''' whose instances you want to customize
-* the new '''EClassCustomization''''s '''extendedFacet''' is the Facet that defines the customizable feature you want to customize (i.e. the label, color, font,...)
-* you create a '''FacetOperation''' in your '''EClassCustomization''' for each customizable feature you want to customize
-* each of these '''FacetOperations''' '''overrides''' the '''FacetOperation''' (from the '''extendedFacet''') corresponding to the customizable feature you want to customize
-* the overriding FacetOperation and the overridden FacetOperation must have the same type
-* finally, you provide an implementation for your overriding '''FacetOperation''', by the means of a '''Query''' that will return the value of the customization when this Query is evaluated on an instance of the '''extendedMetaclass'''
-
-In the following example, we customize the label of instances of the '''Writer''' metaclass from a library metamodel (defined in ''library.ecore''). For this, we create an '''EClassCustomization''' which extends the '''CustomizedEObject''' Facet. This '''CustomizedEObject''' Facet provides the customizable feature '''label''' which we want to customize. So, we create a FacetOperation (in our EClassCustomization) which overrides the '''label''' FacetOperation (in CustomizedEObject). Finally, we choose to provide the label using a Java query, so we create a JavaQuery under our label FacetOperation's '''query''' reference. We set this JavaQuery's '''implementationClassName''' to the full qualified name of a Java class that implements the query and returns the label corresponding to a Writer instance passed as a '''source''' to this query.
-
-[[Image:../img/customizationWithOverride.png]]
-
-==== customizing a Facet ====
-
-To create a customization for model elements that conform to a '''Facet''':
-* create a '''FacetCustomization'''
-* the new '''FacetCustomization''''s '''extendedFacet''' is the '''Facet''' whose conforming elements you want to customize
-* you create a '''FacetOperation''' in your '''FacetCustomization''' for each customizable feature (label, font, color, etc.) you want to customize
-* each of these '''FacetOperations''' '''overrides''' the '''FacetOperation''' corresponding to the customizable feature you want to customize
-* the overriding FacetOperation and the overridden FacetOperation must have the same type
-* finally, you provide an implementation for your overriding '''FacetOperation''', by the means of a '''Query''' that will return the value of the customization when this Query is evaluated on a model element that conforms to the '''extendedFacet'''
-
-In the following example, we want to add an overlay icon on elements that conform to the '''UnproductiveWriter''' metaclass from the library FacetSet (defined in ''library.efacet''). For this, we create an '''FacetCustomization''' which extends the '''UnproductiveWriter''' Facet. We create a FacetOperation (in our FacetCustomization) which overrides the '''bottomRightOverlay''' FacetOperation that allows adding an overlay icon in the bottom right corner of an element's main icon. Finally, we provide the overlay icon using a query. This query will be evaluated with instances of '''Writer''' that conform to the '''UnproductiveWriter''' Facet, and will return the overlay icon.
-
-[[Image:../img/customizingFacetWithOverride.png]]
-
-=== customizing structural features ===
-
-Each FacetOperation that defines a customizable feature has a parameter named '''eStructuralFeature'''. This parameter is useful for customizing the structural feature corresponding to a single model element. For example, in the following screenshot, a '''Library''' model element contains '''Writers''' through a structural feature named '''writers'''. If we want to customize this '''writers''' structural feature in the context of its parent '''Library''', then we need both the '''Library''' model element and the '''writers''' feature. In this case, the FacetOperation would be called on the '''Library''' model element, and the value of the '''eStructuralFeature''' parameter would be the '''writers''' feature.
-
-[[Image:../img/LibraryModelInModelBrowser.png]]
-
-=== conditional customization ===
-
-To specify that a customization should only be applied to elements that satisfy certain criteria, you have two choices:
-* Either customize a Facet that applies to elements you want to customize. This is the preferred way.
-* Customize an EClass and set the '''conformanceTypedElement''' of the customization to a boolean attribute ('''EAttribute''' or '''FacetAttribute''') that returns whether the customization should be applied on the attribute's source element.
-
-=== customization cases ===
-
-To handle several cases in a customization (to return different values for a single customized feature depending on boolean conditions), you can implement the customized '''FacetOperation''' with an '''ETypedElementSwitchQuery'''. This type of query returns the value corresponding to the first of its cases that evaluates to '''true'''.
-
-[[Image:../img/ETypedElementSwitchQuery.png]]
-
-
-== Example ==
-Since there is no dedicated UI tooling as yet for editing customizations, you will have to use either a generic model editor or write the XMI by hand for now. Here is an example of a customization model in the XMI format. This example defines a customization for the '''Writer''' metaclass, that customizes the label for '''Writer''' model elements. And a second customization that customizes the '''UnproductiveWriter''' Facet, to add an overlay to the icon of model elements that conform to the '''UnproductiveWriter''' Facet.
-
-<pre>
-<custom:Customization
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:custom="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:efacet="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet"
- xmlns:javaQuery2="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation"
- name="org.eclipse.papyrus.emf.facet.efacet.examples.library.core.custom">
-
- <eClassifiers xsi:type="custom:EClassCustomization">
- <extendedMetaclass href="http://www.eclipse.org/papyrus/emf/facet/examples/library/0.2.incubation/library#//Writer"/>
- <extendedFacets href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
- <facetOperations xsi:type="efacet:FacetOperation" name="label" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.emf.facet.efacet.examples.library.core.internal.queries.WriterLabel"/>
- <override xsi:type="efacet:FacetOperation" href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
- <eParameters xsi:type="ecore:EParameter" name="eStructuralFeature">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
- </eParameters>
- </facetOperations>
- </eClassifiers>
-
- <eClassifiers xsi:type="custom:FacetCustomization">
- <extendedFacets href="platform:/plugin/org.eclipse.papyrus.emf.facet.efacet.examples.library.core/library.efacet#//writer/UnproductiveWriter"/>
- <facetOperations xsi:type="efacet:FacetOperation" name="bottomRightOverlay" lowerBound="1">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
- <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.emf.facet.efacet.examples.library.core.internal.queries.UnproductiveWriterOverlay"/>
- <override xsi:type="efacet:FacetOperation" href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/bottomRightOverlay"/>
- <eParameters xsi:type="ecore:EParameter" name="eStructuralFeature">
- <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
- </eParameters>
- </facetOperations>
- </eClassifiers>
-</custom:Customization>
-</pre>
-
-== Default Customizations ==
-=== label ===
-The text displayed for a model element can be customized with the '''label''' customization defined on CustomizedEObject.
-
-=== image ===
-The icon that appears before the text for a model element can be customized with the '''image''' customization defined on CustomizedEObject.
-
-=== color ===
-Both the text color ('''foreground''') and background color ('''background''') can be customized.
-
-=== font ===
-The following font-related properties are defined on CustomizedEObject and can be customized:
-* fontName
-* fontSize
-* isBold
-* isItalic
-* isUnderlined
-* isStruckthrough
-
-=== overlay ===
-In addition to the main icon displayed for a model element, up to six additional ''overlay'' icons can be displayed in the corners of the main icon. The following image depicts the position of each overlay relative to the main icon:
-
-{|style="text-align: center; border-style: solid; border-width: 2px; border-color: #000"
-|[[Image:../img/topLeftOverlay.png]]
-|[[Image:../img/topMiddleOverlay.png]]
-|[[Image:../img/topRightOverlay.png]]
-|-
-|topLeftOverlay
-|topMiddleOverlay
-|topRightOverlay
-|-
-|[[Image:../img/bottomLeftOverlay.png]]
-|[[Image:../img/bottomMiddleOverlay.png]]
-|[[Image:../img/bottomRightOverlay.png]]
-|-
-|bottomLeftOverlay
-|bottomMiddleOverlay
-|bottomRightOverlay
-|}
-
-Overlays should be defined on Facets (using a '''FacetCustomization'''). You will get a warning if you define an overlay on an EClass (with '''EClassCustomization'''). This warning may be disabled in the preferences, in section '''Model Validation > Constraints''' : check or uncheck '''EMF Facet Custom Model Validation > Avoid EClass Overlay'''.
-
-=== obtaining customization properties ===
-The default customization properties defined in EMF Facet can be obtained from the following set of interfaces:
-* IContentPropertiesHandler (instantiate through IContentPropertiesHandlerFactory)
-* ISelectionPropertiesHandler (instantiate through ISelectionPropertiesHandlerFactory)
-
-== Registration ==
-To make a customization available at runtime in the customization catalog, you must register it with extension point '''org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration''', like this:
-<pre>
-<extension point="org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration">
- <modeldeclaration file="myCustomization.custom"/>
-</extension>
-Also, your ".custom" file must be included in your plug-in's build.properties in order to be available in deployed plug-ins.
-</pre>
-
-== Catalog ==
-Customizations that have been [[#Registration|registered]] are available from the customization catalog.
-For example, if you want to retrieve the list of all registered customizations:
-<pre>
-ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT
- .getOrCreateCustomizationCatalogManager(new ResourceSetImpl());
-List<Customization> allCustomizations = customCatalog.getRegisteredCustomizations();
-</pre>
-Then you can for example look for a customization with a given name in the previous list:
-<pre>
-Customization myCustom = CustomizationUtils.getCustomization(allCustomizations, "MyCustomization");
-</pre>
-
-== Customization Manager ==
-
-The customization manager is used to manipulate customizations. To obtain an instance of the CustomizationManager, you must ask the customization manager factory:
-<pre>
-ICustomizationManager customManager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(resourceSet);
-</pre>
-The resourceSet parameter must be the same ResourceSet that was used to instantiate a customization catalog manager in <code>ICustomizationCatalogManagerFactory#getOrCreateCustomizationCatalogManager</code>.
-
-The customization manager provides these important methods:
-* getManagedCustomizations() : returns a modifiable list of customizations managed by this customization manager. For example, to add a customization: <code>customManager.getManagedCustomizations().add(custom);</code>
-* getCustomValueOf(EObject, FacetOperation, Class) : evaluates a customization property on a given object, and returns the result. The class parameter is used to typecheck the result and return a value of the correct type. For example: <code>Boolean result = customManager.getCustomValueOf(eObject, aBooleanProperty, Boolean.class);</code>
-
-== Customized Providers ==
-You don't always have to interact with the customization manager directly though: when you want to evaluate a standard customization property (label, image, visibility, etc.), you can use a customized label or content provider supplied by EMF Facet:
-* ICustomizedLabelProvider (instantiate through ICustomizedLabelProviderFactory or IResolvingCustomizedLabelProviderFactory)
-* ICustomizedTreeContentProvider (instantiate through ICustomizedContentProviderFactory)
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-Contributors: Nicolas Bros (Mia-Software) ; Laurent Pichierri (Soft-Maint) - Bug 375789 - Documentation
-</font>
+<h1>Table of Contents</h1>
+__TOC__
+
+EMF Facet provides a '''customization''' component, that can be used to define the appearance of model elements when viewed in an editor or view that supports this customization mechanism.
+
+== Description ==
+A customization is defined in a model that conforms to the EMF Facet customization metamodel. This model is saved in a file with the ".custom" file extension.
+
+== Customization Metamodel ==
+
+=== customizations ===
+
+A '''Customization''' is a '''FacetSet''':
+
+[[Image:../img/CustomizationMetaclass.png]]
+
+A '''Customization''' can contain customizations for Ecore metaclasses ('''EClassCustomization'''), or Facets ('''FacetCustomization'''). Both '''EClassCustomization''' and '''FacetCustomization''' are Facets.
+
+The '''extendedMetaclass''' of an '''EClassCustomization''' is the EClass whose instances will be customized.
+
+The '''extendedFacet''' of an '''EClassCustomization''' or '''FacetCustomization''' is the Facet that defines the customizable features (label, color, etc.) that will be customized.
+
+In case of facet customization, the '''customizedFacet''' of a '''FacetCustomization''' is the Facet for which model elements that conform to this Facet will be customized.
+
+[[Image:../img/EClassAndFacetCustomizationMetaclasses.png]]
+
+=== customizable features ===
+
+Customizable features are defined in Facets as FacetOperations. For example, this FacetSet defines basic customizable features such as label, icon, etc.: <code>platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet</code>
+
+The following instance diagram shows how a Facet named '''CustomizedEObject''' is defined in ''customproperties.efacet''. Its '''extendedMetaclass''' is '''EObject''', so it can be used to customize any model element. It contains '''FacetOperations''' (of which only two are represented here). These FacetOperations define the customizable features: here the '''label''' and '''image''' for a model element. The type of each of these FacetOperations is the customized feature's type : an '''EString''' for the label and an '''Image''' for the image.
+
+[[Image:../img/CustomizedEObject.png]]
+
+The operation is called each time the value of its customization is needed. For example, when displaying a model element in a viewer, we will need its label. So the '''label''' operation will be called on the model element for which the label is needed.
+
+=== customization override ===
+A FacetOperation that defines a customizable feature such as label, icon, color, font, etc. can be compared to a virtual method: it is meant to be overridden in extending Facets in order to provide a specific customization.
+
+To understand this override mechanism, remember that a '''EClassCustomization''' and '''FacetCustomization''' are '''Facets''' (the '''EClassCustomization''' and '''FacetCustomization''' metaclasses extend the '''Facet''' metaclass).
+
+==== customizing an EClass ====
+
+To create a customization for instances of an '''EClass''':
+* create an '''EClassCustomization'''
+* the new '''EClassCustomization''''s '''extendedMetaclass''' is the '''EClass''' whose instances you want to customize
+* the new '''EClassCustomization''''s '''extendedFacet''' is the Facet that defines the customizable feature you want to customize (i.e. the label, color, font,...)
+* you create a '''FacetOperation''' in your '''EClassCustomization''' for each customizable feature you want to customize
+* each of these '''FacetOperations''' '''overrides''' the '''FacetOperation''' (from the '''extendedFacet''') corresponding to the customizable feature you want to customize
+* the overriding FacetOperation and the overridden FacetOperation must have the same type
+* finally, you provide an implementation for your overriding '''FacetOperation''', by the means of a '''Query''' that will return the value of the customization when this Query is evaluated on an instance of the '''extendedMetaclass'''
+
+In the following example, we customize the label of instances of the '''Writer''' metaclass from a library metamodel (defined in ''library.ecore''). For this, we create an '''EClassCustomization''' which extends the '''CustomizedEObject''' Facet. This '''CustomizedEObject''' Facet provides the customizable feature '''label''' which we want to customize. So, we create a FacetOperation (in our EClassCustomization) which overrides the '''label''' FacetOperation (in CustomizedEObject). Finally, we choose to provide the label using a Java query, so we create a JavaQuery under our label FacetOperation's '''query''' reference. We set this JavaQuery's '''implementationClassName''' to the full qualified name of a Java class that implements the query and returns the label corresponding to a Writer instance passed as a '''source''' to this query.
+
+[[Image:../img/customizationWithOverride.png]]
+
+==== customizing a Facet ====
+
+To create a customization for model elements that conform to a '''Facet''':
+* create a '''FacetCustomization'''
+* the new '''FacetCustomization''''s '''extendedFacet''' is the '''Facet''' whose conforming elements you want to customize
+* you create a '''FacetOperation''' in your '''FacetCustomization''' for each customizable feature (label, font, color, etc.) you want to customize
+* each of these '''FacetOperations''' '''overrides''' the '''FacetOperation''' corresponding to the customizable feature you want to customize
+* the overriding FacetOperation and the overridden FacetOperation must have the same type
+* finally, you provide an implementation for your overriding '''FacetOperation''', by the means of a '''Query''' that will return the value of the customization when this Query is evaluated on a model element that conforms to the '''extendedFacet'''
+
+In the following example, we want to add an overlay icon on elements that conform to the '''UnproductiveWriter''' metaclass from the library FacetSet (defined in ''library.efacet''). For this, we create an '''FacetCustomization''' which extends the '''UnproductiveWriter''' Facet. We create a FacetOperation (in our FacetCustomization) which overrides the '''bottomRightOverlay''' FacetOperation that allows adding an overlay icon in the bottom right corner of an element's main icon. Finally, we provide the overlay icon using a query. This query will be evaluated with instances of '''Writer''' that conform to the '''UnproductiveWriter''' Facet, and will return the overlay icon.
+
+[[Image:../img/customizingFacetWithOverride.png]]
+
+=== customizing structural features ===
+
+Each FacetOperation that defines a customizable feature has a parameter named '''eStructuralFeature'''. This parameter is useful for customizing the structural feature corresponding to a single model element. For example, in the following screenshot, a '''Library''' model element contains '''Writers''' through a structural feature named '''writers'''. If we want to customize this '''writers''' structural feature in the context of its parent '''Library''', then we need both the '''Library''' model element and the '''writers''' feature. In this case, the FacetOperation would be called on the '''Library''' model element, and the value of the '''eStructuralFeature''' parameter would be the '''writers''' feature.
+
+[[Image:../img/LibraryModelInModelBrowser.png]]
+
+=== conditional customization ===
+
+To specify that a customization should only be applied to elements that satisfy certain criteria, you have two choices:
+* Either customize a Facet that applies to elements you want to customize. This is the preferred way.
+* Customize an EClass and set the '''conformanceTypedElement''' of the customization to a boolean attribute ('''EAttribute''' or '''FacetAttribute''') that returns whether the customization should be applied on the attribute's source element.
+
+=== customization cases ===
+
+To handle several cases in a customization (to return different values for a single customized feature depending on boolean conditions), you can implement the customized '''FacetOperation''' with an '''ETypedElementSwitchQuery'''. This type of query returns the value corresponding to the first of its cases that evaluates to '''true'''.
+
+[[Image:../img/ETypedElementSwitchQuery.png]]
+
+
+== Example ==
+Since there is no dedicated UI tooling as yet for editing customizations, you will have to use either a generic model editor or write the XMI by hand for now. Here is an example of a customization model in the XMI format. This example defines a customization for the '''Writer''' metaclass, that customizes the label for '''Writer''' model elements. And a second customization that customizes the '''UnproductiveWriter''' Facet, to add an overlay to the icon of model elements that conform to the '''UnproductiveWriter''' Facet.
+
+<pre>
+<custom:Customization
+ xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:custom="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:efacet="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet"
+ xmlns:javaQuery2="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation"
+ name="org.eclipse.papyrus.emf.facet.efacet.examples.library.core.custom">
+
+ <eClassifiers xsi:type="custom:EClassCustomization">
+ <extendedMetaclass href="http://www.eclipse.org/papyrus/emf/facet/examples/library/0.2.incubation/library#//Writer"/>
+ <extendedFacets href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject"/>
+ <facetOperations xsi:type="efacet:FacetOperation" name="label" lowerBound="1">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.emf.facet.efacet.examples.library.core.internal.queries.WriterLabel"/>
+ <override xsi:type="efacet:FacetOperation" href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/label"/>
+ <eParameters xsi:type="ecore:EParameter" name="eStructuralFeature">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ </facetOperations>
+ </eClassifiers>
+
+ <eClassifiers xsi:type="custom:FacetCustomization">
+ <extendedFacets href="platform:/plugin/org.eclipse.papyrus.emf.facet.efacet.examples.library.core/library.efacet#//writer/UnproductiveWriter"/>
+ <facetOperations xsi:type="efacet:FacetOperation" name="bottomRightOverlay" lowerBound="1">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
+ <query xsi:type="javaQuery2:JavaQuery" implementationClassName="org.eclipse.papyrus.emf.facet.efacet.examples.library.core.internal.queries.UnproductiveWriterOverlay"/>
+ <override xsi:type="efacet:FacetOperation" href="platform:/plugin/org.eclipse.papyrus.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/bottomRightOverlay"/>
+ <eParameters xsi:type="ecore:EParameter" name="eStructuralFeature">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EStructuralFeature"/>
+ </eParameters>
+ </facetOperations>
+ </eClassifiers>
+</custom:Customization>
+</pre>
+
+== Default Customizations ==
+=== label ===
+The text displayed for a model element can be customized with the '''label''' customization defined on CustomizedEObject.
+
+=== image ===
+The icon that appears before the text for a model element can be customized with the '''image''' customization defined on CustomizedEObject.
+
+=== color ===
+Both the text color ('''foreground''') and background color ('''background''') can be customized.
+
+=== font ===
+The following font-related properties are defined on CustomizedEObject and can be customized:
+* fontName
+* fontSize
+* isBold
+* isItalic
+* isUnderlined
+* isStruckthrough
+
+=== overlay ===
+In addition to the main icon displayed for a model element, up to six additional ''overlay'' icons can be displayed in the corners of the main icon. The following image depicts the position of each overlay relative to the main icon:
+
+{|style="text-align: center; border-style: solid; border-width: 2px; border-color: #000"
+|[[Image:../img/topLeftOverlay.png]]
+|[[Image:../img/topMiddleOverlay.png]]
+|[[Image:../img/topRightOverlay.png]]
+|-
+|topLeftOverlay
+|topMiddleOverlay
+|topRightOverlay
+|-
+|[[Image:../img/bottomLeftOverlay.png]]
+|[[Image:../img/bottomMiddleOverlay.png]]
+|[[Image:../img/bottomRightOverlay.png]]
+|-
+|bottomLeftOverlay
+|bottomMiddleOverlay
+|bottomRightOverlay
+|}
+
+Overlays should be defined on Facets (using a '''FacetCustomization'''). You will get a warning if you define an overlay on an EClass (with '''EClassCustomization'''). This warning may be disabled in the preferences, in section '''Model Validation > Constraints''' : check or uncheck '''EMF Facet Custom Model Validation > Avoid EClass Overlay'''.
+
+=== obtaining customization properties ===
+The default customization properties defined in EMF Facet can be obtained from the following set of interfaces:
+* IContentPropertiesHandler (instantiate through IContentPropertiesHandlerFactory)
+* ISelectionPropertiesHandler (instantiate through ISelectionPropertiesHandlerFactory)
+
+== Registration ==
+To make a customization available at runtime in the customization catalog, you must register it with extension point '''org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration''', like this:
+<pre>
+<extension point="org.eclipse.papyrus.emf.facet.util.emf.core.modeldeclaration">
+ <modeldeclaration file="myCustomization.custom"/>
+</extension>
+Also, your ".custom" file must be included in your plug-in's build.properties in order to be available in deployed plug-ins.
+</pre>
+
+== Catalog ==
+Customizations that have been [[#Registration|registered]] are available from the customization catalog.
+For example, if you want to retrieve the list of all registered customizations:
+<pre>
+ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT
+ .getOrCreateCustomizationCatalogManager(new ResourceSetImpl());
+List<Customization> allCustomizations = customCatalog.getRegisteredCustomizations();
+</pre>
+Then you can for example look for a customization with a given name in the previous list:
+<pre>
+Customization myCustom = CustomizationUtils.getCustomization(allCustomizations, "MyCustomization");
+</pre>
+
+== Customization Manager ==
+
+The customization manager is used to manipulate customizations. To obtain an instance of the CustomizationManager, you must ask the customization manager factory:
+<pre>
+ICustomizationManager customManager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(resourceSet);
+</pre>
+The resourceSet parameter must be the same ResourceSet that was used to instantiate a customization catalog manager in <code>ICustomizationCatalogManagerFactory#getOrCreateCustomizationCatalogManager</code>.
+
+The customization manager provides these important methods:
+* getManagedCustomizations() : returns a modifiable list of customizations managed by this customization manager. For example, to add a customization: <code>customManager.getManagedCustomizations().add(custom);</code>
+* getCustomValueOf(EObject, FacetOperation, Class) : evaluates a customization property on a given object, and returns the result. The class parameter is used to typecheck the result and return a value of the correct type. For example: <code>Boolean result = customManager.getCustomValueOf(eObject, aBooleanProperty, Boolean.class);</code>
+
+== Customized Providers ==
+You don't always have to interact with the customization manager directly though: when you want to evaluate a standard customization property (label, image, visibility, etc.), you can use a customized label or content provider supplied by EMF Facet:
+* ICustomizedLabelProvider (instantiate through ICustomizedLabelProviderFactory or IResolvingCustomizedLabelProviderFactory)
+* ICustomizedTreeContentProvider (instantiate through ICustomizedContentProviderFactory)
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+Contributors: Nicolas Bros (Mia-Software) ; Laurent Pichierri (Soft-Maint) - Bug 375789 - Documentation
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/plugin.xml b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/plugin.xml
index 3a3503d18c5..d268aa50cf8 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/plugin.xml
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.doc/plugin.xml
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- 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:
- Nicolas Bros (Mia-Software) - Bug 375789 - Documentation
--->
-<plugin>
- <extension point="org.eclipse.help.toc">
- <toc file="toc-user.xml" primary="false"/>
- <toc file="toc-dev.xml" primary="false"/>
- </extension>
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ 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:
+ Nicolas Bros (Mia-Software) - Bug 375789 - Documentation
+-->
+<plugin>
+ <extension point="org.eclipse.help.toc">
+ <toc file="toc-user.xml" primary="false"/>
+ <toc file="toc-dev.xml" primary="false"/>
+ </extension>
+</plugin>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/about.html b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/about.html
index 77ef6958f99..d194d3dce4d 100755
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/about.html
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/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>March, 2014</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!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>March, 2014</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/build.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/build.properties
index 267d1353e99..9fe73983418 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/build.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/build.properties
@@ -1,5 +1,5 @@
-bin.includes = META-INF/,\
- resource/,\
- plugin.xml,\
- about.html
+bin.includes = META-INF/,\
+ resource/,\
+ plugin.xml,\
+ about.html
src.includes = about.html
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/plugin.xml b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/plugin.xml
index bf9f4621285..3919222b939 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/plugin.xml
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/plugin.xml
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension point="org.eclipse.help.toc">
- <toc file="resource/editor-toc.xml" primary="true"/>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension point="org.eclipse.help.toc">
+ <toc file="resource/editor-toc.xml" primary="true"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/resource/editor.textile b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/resource/editor.textile
index c94e8675e91..b31e6871ef4 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/resource/editor.textile
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor.doc/resource/editor.textile
@@ -1,174 +1,174 @@
-h1. Customization of model with EMF Facet
-
-
-
-{toc}
-
-
-
-
-EMF Facet provides a customization component, that can be used to define the appearance of model elements when viewed in an editor or view that supports this customization mechanism.
-
-
-
-h1. Creation of .custom file
-
-
-
-A customization is defined in a model that conforms to the EMF Facet customization metamodel. This model is saved in a file with the ".custom" file extension. The file can be created via a wizard in Eclipse from “New -> EMF Facet -> Create a customization 0.2” option in menu and will prompt the user for the nsURI and prefix for the customization model. The following screen captures show step by step the creation process :
-
-
-
-!WizardCreation1.png!
-Figure 1 : custom file creation wizard
-
-
-
-!WizardCreation2.png!
-Figure 2 : file name selection
-
-
-
-!WizardCreation2.png!
-Figure 3 : nsURI and prefix specification for the model
-
-
-
-Upon the creation of the customization model file, the editor will open and allow the user to populate the model:
-
-
-!EditorWithEmptyFile.png!
-Figure 4 : empty Customization created from the wizard
-
-
-
-Customization is a specific FacetSet acting as the main container for the customization elements. These elements may be customization for
-EClass or Facet; each of them containing DerivedTypedElement such as FacetAttribute, FacetReference, and FacetOperation.
-
-
-
-h1. EClassCustom and FacetCustom
-
-
-
-h2. Creation and basic edition
-
-
-
-Custom classes can be created when a Customization element is selected, the far right panel displays buttons to ease the creation of such
-elements:
-
-!EClassCustomCreation1.png!
-Figure 5 : creation of an EClassCustom
-
-
-The dialog allows specifying generic features for Custom classes and the properties view is always there to fine-tune different features:
-
-!EClassCustomEdition.png!
-Figure 6 : Edition of an EClassCustom
-
-
-In this example, the EClassCustom extends the metaclass from the org.eclipse.papyrus.emf.facet.examples.library metamodel, the editor will
-automatically load every model in which a facet specifies this metamodel, hence the loading of .efacet and .custom files available in the
-platform. This allow an easy access of all declared facets bound to an element of the customized metamodel.
-
-The process is identical for the creation of a FacetCustom:
-
-!FacetCustomCreation1.png!
-Figure 7 : creation of a FacetCustom
-
-
-
-h2. Fine-tune edition
-
-If needed, properties view allows the user to have a more advanced control on custom elements:
-
-!FineTuneEClassCustomization.png!
-Figure 8 : fine-tune edition of an EClassCustom
-
-
-
-Also, applied customization are strongly affected by the order the manager load them up, the editor provides a way to modify this order by
-selecting an element and press either the “Up” or “Down” bottom. This results in modifying the index of the selected element in its
-containment list.
-
-
-
-h1. DerivedTypedElement
-
-
-
-h2. Creation and basic edition
-
-
-
-Custom element, either ECLassCustom or FacetCustom, contains DerivedTypeElement. Those elements can be FacetAttribute, FacetReference or
-FacetOperation. The most used lement for Customization is the FacetOperation: each of these FacetOperations overrides the FacetOperation
-corresponding to the customizable feature you want to customize: label, font, color, etc…
-In order to create a FacetOperation, a FacetCustom or an EClassCustom must be selected:
-
-!FacetOperationCreation1.png!
-Figure 9 : creation of a FacetOperation
-
-
-
-Finally, the user must provide an implementation for an overriding FacetOperation, by the means of a Query that will return the value of the
-customization when this Query is evaluated on a model element that conforms to the extendedFacet. If the query has not been written yet, the
-wizard provides an easy wizard to create the Query directly extending one of the Query class available, or the editor will scan the project
-and prompt the user to choose among a list of available query classes.
-
-!FacetOperationSpecifyQuery.png!
-Figure 10 : Creation of a Query for a FacetOperation
-
-
-If a FacetOperation is selected, it is possible to add parameters. This parameter is useful for customizing the structural feature
-corresponding to a single customized model element:
-
-
-!addParameter.png!
-Figure 11 : adding a parameter to a FacetOperation
-
-
-
-h2. Structured views
-
-
-
-The left tree is the main navigator of the model in the editor, when a Custom element is selected or any DerivedTypeElement, the right panel
-shows the list of all child derivedTypeElements, or brother depending on the nature of the left panel selection. This panel offers a quick
-overview of the DerivedTypeElement:
-
-!RightPaneldescription.png!
-Figure 12 : detailed view of the right panel
-
-
-An icon symbolizes the override customization facet, all icons are as follow:
-* !attributes.gif! means the derivedTypeElement is not a FacetOperation
-* !customizationLabel.png! stands for “label”
-* !fontBold.png! stands for “isBold”
-* !fontItalic.bmp! stands for “isItalic”
-* !fontName.png! stands for “fontName”
-* !fontSize.png! stands for “fontSize”
-* !fontStrukethrough.bmp! stands for “isStrikethrough”
-* !fontUnderline.bmp! stands for “isUnderlined”
-* !imageCustomization.png! stands for “image”
-* !rgb.png! stands for “foreground” or “background”
-* !middleLeftOverlay.png! stands for “middleLeftOverlay”
-* !middleRightOverlay.png! stands for “middleRightOverlay”
-* !topLeftOverlay.png! stands for “topLeftOverlay”
-* !topMiddleOverlay.png! stands for “topMiddleOverlay”
-* !topRightOverlay.png! stands for “topRightOverlay”
-* !bottomRightOverlay.png! stands for “bottomRightOverlay”
-* !bottomMiddleOverlay.png! stands for “bottomMiddleOverlay”
-* !bottomLeftOverlay.png! stands for “bottomLeftOverlay”
-
-
-
-h2. Fine-tune edition
-
-
-
-An advanced control of FacetOperation, and moreover DerivedTypeElement, is available via the properties view:
-
-!facetOperationWithPropertiesView.png!
-Figure 13 : fine-tune edition of a FacetOperation
+h1. Customization of model with EMF Facet
+
+
+
+{toc}
+
+
+
+
+EMF Facet provides a customization component, that can be used to define the appearance of model elements when viewed in an editor or view that supports this customization mechanism.
+
+
+
+h1. Creation of .custom file
+
+
+
+A customization is defined in a model that conforms to the EMF Facet customization metamodel. This model is saved in a file with the ".custom" file extension. The file can be created via a wizard in Eclipse from “New -> EMF Facet -> Create a customization 0.2” option in menu and will prompt the user for the nsURI and prefix for the customization model. The following screen captures show step by step the creation process :
+
+
+
+!WizardCreation1.png!
+Figure 1 : custom file creation wizard
+
+
+
+!WizardCreation2.png!
+Figure 2 : file name selection
+
+
+
+!WizardCreation2.png!
+Figure 3 : nsURI and prefix specification for the model
+
+
+
+Upon the creation of the customization model file, the editor will open and allow the user to populate the model:
+
+
+!EditorWithEmptyFile.png!
+Figure 4 : empty Customization created from the wizard
+
+
+
+Customization is a specific FacetSet acting as the main container for the customization elements. These elements may be customization for
+EClass or Facet; each of them containing DerivedTypedElement such as FacetAttribute, FacetReference, and FacetOperation.
+
+
+
+h1. EClassCustom and FacetCustom
+
+
+
+h2. Creation and basic edition
+
+
+
+Custom classes can be created when a Customization element is selected, the far right panel displays buttons to ease the creation of such
+elements:
+
+!EClassCustomCreation1.png!
+Figure 5 : creation of an EClassCustom
+
+
+The dialog allows specifying generic features for Custom classes and the properties view is always there to fine-tune different features:
+
+!EClassCustomEdition.png!
+Figure 6 : Edition of an EClassCustom
+
+
+In this example, the EClassCustom extends the metaclass from the org.eclipse.papyrus.emf.facet.examples.library metamodel, the editor will
+automatically load every model in which a facet specifies this metamodel, hence the loading of .efacet and .custom files available in the
+platform. This allow an easy access of all declared facets bound to an element of the customized metamodel.
+
+The process is identical for the creation of a FacetCustom:
+
+!FacetCustomCreation1.png!
+Figure 7 : creation of a FacetCustom
+
+
+
+h2. Fine-tune edition
+
+If needed, properties view allows the user to have a more advanced control on custom elements:
+
+!FineTuneEClassCustomization.png!
+Figure 8 : fine-tune edition of an EClassCustom
+
+
+
+Also, applied customization are strongly affected by the order the manager load them up, the editor provides a way to modify this order by
+selecting an element and press either the “Up” or “Down” bottom. This results in modifying the index of the selected element in its
+containment list.
+
+
+
+h1. DerivedTypedElement
+
+
+
+h2. Creation and basic edition
+
+
+
+Custom element, either ECLassCustom or FacetCustom, contains DerivedTypeElement. Those elements can be FacetAttribute, FacetReference or
+FacetOperation. The most used lement for Customization is the FacetOperation: each of these FacetOperations overrides the FacetOperation
+corresponding to the customizable feature you want to customize: label, font, color, etc…
+In order to create a FacetOperation, a FacetCustom or an EClassCustom must be selected:
+
+!FacetOperationCreation1.png!
+Figure 9 : creation of a FacetOperation
+
+
+
+Finally, the user must provide an implementation for an overriding FacetOperation, by the means of a Query that will return the value of the
+customization when this Query is evaluated on a model element that conforms to the extendedFacet. If the query has not been written yet, the
+wizard provides an easy wizard to create the Query directly extending one of the Query class available, or the editor will scan the project
+and prompt the user to choose among a list of available query classes.
+
+!FacetOperationSpecifyQuery.png!
+Figure 10 : Creation of a Query for a FacetOperation
+
+
+If a FacetOperation is selected, it is possible to add parameters. This parameter is useful for customizing the structural feature
+corresponding to a single customized model element:
+
+
+!addParameter.png!
+Figure 11 : adding a parameter to a FacetOperation
+
+
+
+h2. Structured views
+
+
+
+The left tree is the main navigator of the model in the editor, when a Custom element is selected or any DerivedTypeElement, the right panel
+shows the list of all child derivedTypeElements, or brother depending on the nature of the left panel selection. This panel offers a quick
+overview of the DerivedTypeElement:
+
+!RightPaneldescription.png!
+Figure 12 : detailed view of the right panel
+
+
+An icon symbolizes the override customization facet, all icons are as follow:
+* !attributes.gif! means the derivedTypeElement is not a FacetOperation
+* !customizationLabel.png! stands for “label”
+* !fontBold.png! stands for “isBold”
+* !fontItalic.bmp! stands for “isItalic”
+* !fontName.png! stands for “fontName”
+* !fontSize.png! stands for “fontSize”
+* !fontStrukethrough.bmp! stands for “isStrikethrough”
+* !fontUnderline.bmp! stands for “isUnderlined”
+* !imageCustomization.png! stands for “image”
+* !rgb.png! stands for “foreground” or “background”
+* !middleLeftOverlay.png! stands for “middleLeftOverlay”
+* !middleRightOverlay.png! stands for “middleRightOverlay”
+* !topLeftOverlay.png! stands for “topLeftOverlay”
+* !topMiddleOverlay.png! stands for “topMiddleOverlay”
+* !topRightOverlay.png! stands for “topRightOverlay”
+* !bottomRightOverlay.png! stands for “bottomRightOverlay”
+* !bottomMiddleOverlay.png! stands for “bottomMiddleOverlay”
+* !bottomLeftOverlay.png! stands for “bottomLeftOverlay”
+
+
+
+h2. Fine-tune edition
+
+
+
+An advanced control of FacetOperation, and moreover DerivedTypeElement, is available via the properties view:
+
+!facetOperationWithPropertiesView.png!
+Figure 13 : fine-tune edition of a FacetOperation
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.classpath b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.classpath
index da1049abda9..e721d0c4eaa 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.classpath
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.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/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..c585cc455ae 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/.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/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/META-INF/MANIFEST.MF b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/META-INF/MANIFEST.MF
index 14d2078d81a..00c0f9c5552 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/META-INF/MANIFEST.MF
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/META-INF/MANIFEST.MF
@@ -1,23 +1,23 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.11.0,4.0.0)";visibility:=reexport,
- org.eclipse.papyrus.emf.facet.custom.metamodel.edit;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
- org.eclipse.emf.ecore.xmi;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
- org.eclipse.emf.edit.ui;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
- org.eclipse.ui.ide;bundle-version="[3.12.0,4.0.0)";visibility:=reexport,
- org.eclipse.ui.forms;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.papyrus.emf.facet.util.core;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.papyrus.emf.facet.efacet.sdk.ui;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.emf.facet.custom.sdk.ui;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.papyrus.emf.facet.query.java.metamodel;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.papyrus.emf.facet.query.ocl.metamodel;bundle-version="[1.2.0,2.0.0)"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Version: 1.3.0.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.Activator
-Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.metamodel.editor;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.core.resources;bundle-version="[3.11.0,4.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.emf.facet.custom.metamodel.edit;bundle-version="[1.3.0,2.0.0)";visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.edit.ui;bundle-version="[2.12.0,3.0.0)";visibility:=reexport,
+ org.eclipse.ui.ide;bundle-version="[3.12.0,4.0.0)";visibility:=reexport,
+ org.eclipse.ui.forms;bundle-version="[3.7.0,4.0.0)",
+ org.eclipse.papyrus.emf.facet.util.core;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.papyrus.emf.facet.efacet.sdk.ui;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.emf.facet.custom.sdk.ui;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.emf.facet.query.java.metamodel;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.papyrus.emf.facet.query.ocl.metamodel;bundle-version="[1.2.0,2.0.0)"
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
+Bundle-Version: 1.3.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.emf.facet.custom.metamodel.editor;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/about.html b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/about.html
index fb3b4b23fce..39526b48010 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/about.html
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/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>September 28, 2012</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!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>September 28, 2012</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/build.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/build.properties
index 794269ef0dd..b3841af73ef 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/build.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/build.properties
@@ -1,10 +1,10 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- icons/,\
- about.html,\
- plugin.xml,\
- plugin.properties,\
- src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/messages.properties
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ icons/,\
+ about.html,\
+ plugin.xml,\
+ plugin.properties,\
+ src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/messages.properties
src.includes = about.html \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/messages.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/messages.properties
index e213977eea5..556357fdfd1 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/messages.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/messages.properties
@@ -1,97 +1,97 @@
-###############################################################################
-# Copyright (c) 2009, 2010 Mia-Software.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Nicolas Bros (Mia-Software) - initial API and implementation
-###############################################################################
-CustomizationEditor_add=&Add...
-CustomizationEditor_appliesToSubInstances=Applies to &Sub-Instances
-CustomizationEditor_bold=Bold
-CustomizationEditor_btnOpenElementSelectionDialogText=...
-CustomizationEditor_btnOpenFontDialogText=...
-CustomizationEditor_btnProperties=&Properties
-CustomizationEditor_btnTooltipViewErrors=View errors
-CustomizationEditor_cannotFindMetamodel=Couldn't find metamodel with URI "{0}"
-CustomizationEditor_changeProperties=Change Properties
-CustomizationEditor_collapseLink=Collapse link
-CustomizationEditor_conditions=Conditions :
-CustomizationEditor_conflictingUnsavedChanges=There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
-CustomizationEditor_customizationsWillBeDeleted=All the customizations for metaclass "{0}" will be deleted. Are you sure?
-CustomizationEditor_customViewFor=custom view for "{0}" ({1})
-CustomizationEditor_down=&Down
-CustomizationEditor_edit=&Edit...
-CustomizationEditor_editFeatureValue=Edit feature &value...
-CustomizationEditor_error=Error
-CustomizationEditor_errorLoadingResource=Error loading resource. See log for more information.
-CustomizationEditor_fileConflict=File Conflict
-CustomizationEditor_hideMetaclassName=Hide metaclass name
-CustomizationEditor_iconSelection=Icon selection
-CustomizationEditor_invalidSelection=Invalid selection
-CustomizationEditor_italic=Italic
-CustomizationEditor_missingQuery=Couldn't find Query named "{0}" in query set "{1}".
-CustomizationEditor_missingQuerySet=Couldn't find Query Set named "{0}".
-CustomizationEditor_nonExistingQuery=Non-existing Query
-CustomizationEditor_nonExistingQuerySet=Non-existing Query Set
-CustomizationEditor_notFileSelected=You haven't selected a file
-CustomizationEditor_promptCleanCustomizations=Do you want to remove customizations that don't correspond to the new metamodel?
-CustomizationEditor_readonly=READONLY
-CustomizationEditor_remove=&Remove
-CustomizationEditor_removeIrrelevantCustomizations=Remove Irrelevant Customizations
-CustomizationEditor_resetDefaults=Reset Defaults
-CustomizationEditor_sectionName_customizations=Customizations
-CustomizationEditor_sectionName_types=Types
-CustomizationEditor_selectAnIcon=Select an icon:
-CustomizationEditor_strikethrough=Strikethrough
-CustomizationEditor_text=Text
-CustomizationEditor_Title_cleanCustomization=Clean customization
-CustomizationEditor_underlined=Underlined
-CustomizationEditor_unknown=<unknown>
-CustomizationEditor_up=&Up
-CustomizationEditor_visible=Visible
-CustomizationEditor_metaclassVisible=Visible in Types Panel
-CustomizationEditor_youChangedMetamodel=You have changed the metamodel.\n
-CustomizationPropertiesDialog_customizationProperties=Customization Properties
-CustomizationPropertiesDialog_metamodel=Metamodel
-CustomizationPropertiesDialog_metamodelMustBeSelected=A metamodel must be selected
-CustomizationPropertiesDialog_noMetamodelSelected=No metamodel selected
-CustomizationPropertiesDialog_querySets=Query Sets
-CustomizationViewer_backgroundColor=Background Color
-CustomizationViewer_collapseLink=Collapse Link
-CustomizationViewer_defaultValue=<default value>
-CustomizationViewer_feature=Feature
-CustomizationViewer_hideMetaclassName=Hide Metaclass Name
-CustomizationViewer_typeIcon=Type Icon
-CustomizationViewer_isBold=Is Bold
-CustomizationViewer_isItalic=Is Italic
-CustomizationViewer_isStruckthrough=Is Struckthrough
-CustomizationViewer_isUnderlined=Is Underlined
-CustomizationViewer_isVisible=Is Visible
-CustomizationViewer_metaclassVisible=Visible in Types Panel
-CustomizationViewer_label=Label
-CustomizationViewer_instanceIcon=Instance Icon
-CustomizationViewer_overlayIcon=Overlay Icon
-CustomizationViewer_textColor=Text Color
-CustomizationViewer_textFontName=Text Font Name
-CustomizationViewer_value=Value
-ErrorsDialog_diagnosticMessage={0}\nin: {1}\nline: {2} column: {3}
-ErrorsDialog_errors=Errors
-MetaclassViewToolBar_showDerivedLinks=Show Derived Links
-MetaclassViewToolBar_showFullQualifiedNames=Show Full Qualified Names
-MetaclassViewToolBar_showMultiplicity=Show Multiplicity
-MetaclassViewToolBar_sortLinks=Sort Links
-MetaclassViewToolBar_sortLinksByType=Sort Links by Type
-EditFeatureValueDialog_conditionQueryMustBeSelected=A condition query must be selected
-EditFeatureValueDialog_defaultValue=Default value
-EditFeatureValueDialog_editFeatureValue=Edit Feature Value
-EditFeatureValueDialog_featureValue=Feature value
-EditFeatureValueDialog_noConditionQuerySelected=No condition query selected
-EditFeatureValueDialog_noQuerySelected=No query selected
-EditFeatureValueDialog_queryForCondition=Query for condition
-EditFeatureValueDialog_queryMustBeSelected=A query must be selected
-EditFeatureValueDialog_queryValue=Value computed by a query
-EditFeatureValueDialog_staticValue=Static value
-EditFeatureValueDialog_type=Type
+###############################################################################
+# Copyright (c) 2009, 2010 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Bros (Mia-Software) - initial API and implementation
+###############################################################################
+CustomizationEditor_add=&Add...
+CustomizationEditor_appliesToSubInstances=Applies to &Sub-Instances
+CustomizationEditor_bold=Bold
+CustomizationEditor_btnOpenElementSelectionDialogText=...
+CustomizationEditor_btnOpenFontDialogText=...
+CustomizationEditor_btnProperties=&Properties
+CustomizationEditor_btnTooltipViewErrors=View errors
+CustomizationEditor_cannotFindMetamodel=Couldn't find metamodel with URI "{0}"
+CustomizationEditor_changeProperties=Change Properties
+CustomizationEditor_collapseLink=Collapse link
+CustomizationEditor_conditions=Conditions :
+CustomizationEditor_conflictingUnsavedChanges=There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+CustomizationEditor_customizationsWillBeDeleted=All the customizations for metaclass "{0}" will be deleted. Are you sure?
+CustomizationEditor_customViewFor=custom view for "{0}" ({1})
+CustomizationEditor_down=&Down
+CustomizationEditor_edit=&Edit...
+CustomizationEditor_editFeatureValue=Edit feature &value...
+CustomizationEditor_error=Error
+CustomizationEditor_errorLoadingResource=Error loading resource. See log for more information.
+CustomizationEditor_fileConflict=File Conflict
+CustomizationEditor_hideMetaclassName=Hide metaclass name
+CustomizationEditor_iconSelection=Icon selection
+CustomizationEditor_invalidSelection=Invalid selection
+CustomizationEditor_italic=Italic
+CustomizationEditor_missingQuery=Couldn't find Query named "{0}" in query set "{1}".
+CustomizationEditor_missingQuerySet=Couldn't find Query Set named "{0}".
+CustomizationEditor_nonExistingQuery=Non-existing Query
+CustomizationEditor_nonExistingQuerySet=Non-existing Query Set
+CustomizationEditor_notFileSelected=You haven't selected a file
+CustomizationEditor_promptCleanCustomizations=Do you want to remove customizations that don't correspond to the new metamodel?
+CustomizationEditor_readonly=READONLY
+CustomizationEditor_remove=&Remove
+CustomizationEditor_removeIrrelevantCustomizations=Remove Irrelevant Customizations
+CustomizationEditor_resetDefaults=Reset Defaults
+CustomizationEditor_sectionName_customizations=Customizations
+CustomizationEditor_sectionName_types=Types
+CustomizationEditor_selectAnIcon=Select an icon:
+CustomizationEditor_strikethrough=Strikethrough
+CustomizationEditor_text=Text
+CustomizationEditor_Title_cleanCustomization=Clean customization
+CustomizationEditor_underlined=Underlined
+CustomizationEditor_unknown=<unknown>
+CustomizationEditor_up=&Up
+CustomizationEditor_visible=Visible
+CustomizationEditor_metaclassVisible=Visible in Types Panel
+CustomizationEditor_youChangedMetamodel=You have changed the metamodel.\n
+CustomizationPropertiesDialog_customizationProperties=Customization Properties
+CustomizationPropertiesDialog_metamodel=Metamodel
+CustomizationPropertiesDialog_metamodelMustBeSelected=A metamodel must be selected
+CustomizationPropertiesDialog_noMetamodelSelected=No metamodel selected
+CustomizationPropertiesDialog_querySets=Query Sets
+CustomizationViewer_backgroundColor=Background Color
+CustomizationViewer_collapseLink=Collapse Link
+CustomizationViewer_defaultValue=<default value>
+CustomizationViewer_feature=Feature
+CustomizationViewer_hideMetaclassName=Hide Metaclass Name
+CustomizationViewer_typeIcon=Type Icon
+CustomizationViewer_isBold=Is Bold
+CustomizationViewer_isItalic=Is Italic
+CustomizationViewer_isStruckthrough=Is Struckthrough
+CustomizationViewer_isUnderlined=Is Underlined
+CustomizationViewer_isVisible=Is Visible
+CustomizationViewer_metaclassVisible=Visible in Types Panel
+CustomizationViewer_label=Label
+CustomizationViewer_instanceIcon=Instance Icon
+CustomizationViewer_overlayIcon=Overlay Icon
+CustomizationViewer_textColor=Text Color
+CustomizationViewer_textFontName=Text Font Name
+CustomizationViewer_value=Value
+ErrorsDialog_diagnosticMessage={0}\nin: {1}\nline: {2} column: {3}
+ErrorsDialog_errors=Errors
+MetaclassViewToolBar_showDerivedLinks=Show Derived Links
+MetaclassViewToolBar_showFullQualifiedNames=Show Full Qualified Names
+MetaclassViewToolBar_showMultiplicity=Show Multiplicity
+MetaclassViewToolBar_sortLinks=Sort Links
+MetaclassViewToolBar_sortLinksByType=Sort Links by Type
+EditFeatureValueDialog_conditionQueryMustBeSelected=A condition query must be selected
+EditFeatureValueDialog_defaultValue=Default value
+EditFeatureValueDialog_editFeatureValue=Edit Feature Value
+EditFeatureValueDialog_featureValue=Feature value
+EditFeatureValueDialog_noConditionQuerySelected=No condition query selected
+EditFeatureValueDialog_noQuerySelected=No query selected
+EditFeatureValueDialog_queryForCondition=Query for condition
+EditFeatureValueDialog_queryMustBeSelected=A query must be selected
+EditFeatureValueDialog_queryValue=Value computed by a query
+EditFeatureValueDialog_staticValue=Static value
+EditFeatureValueDialog_type=Type
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.properties
index 87822b3d1d6..1a48d69b0b3 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.properties
@@ -1,148 +1,148 @@
-# Copyright (c) 2011 Mia-Software.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
-# Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
-# Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
-
-pluginName = Papyrus EMF Facet Custom Editor
-providerName = Eclipse Modeling Project
-
-_UI_CustomEditor_menu = &Custom Editor
-
-_UI_CreateChild_menu_item = &New Child
-_UI_CreateSibling_menu_item = N&ew Sibling
-
-_UI_ShowPropertiesView_menu_item = Show &Properties View
-_UI_RefreshViewer_menu_item = &Refresh
-
-_UI_SelectionPage_label = Selection
-_UI_ParentPage_label = Parent
-_UI_ListPage_label = List
-_UI_TreePage_label = Tree
-_UI_TablePage_label = Table
-_UI_TreeWithColumnsPage_label = Tree with Columns
-_UI_ObjectColumn_label = Object
-_UI_SelfColumn_label = Self
-
-_UI_NoObjectSelected = Selected Nothing
-_UI_SingleObjectSelected = Selected Object: {0}
-_UI_MultiObjectSelected = Selected {0} Objects
-
-_UI_OpenEditorError_label = Open Editor
-
-_UI_CreateModelError_message = Problems encountered in file "{0}"
-
-_UI_CustomModelWizard_label = Custom Model
-_UI_CustomModelWizard_description = Create a new Custom model
-
-_UI_CustomEditor_label = Custom Model Editor
-
-_UI_CustomEditorFilenameDefaultBase = My
-_UI_CustomEditorFilenameExtensions = custom
-
-_UI_Wizard_label = New
-
-_WARN_FilenameExtension = The file name must end in ''.{0}''
-_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
-
-_UI_ModelObject = &Model Object
-_UI_XMLEncoding = &XML Encoding
-_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
-_UI_Wizard_initial_object_description = Select a model object to create
-
-_UI_FileConflict_label = File Conflict
-_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
-
-CustomizationEditor_add=&Add...
-CustomizationEditor_appliesToSubInstances=Applies to &Sub-Instances
-CustomizationEditor_bold=Bold
-CustomizationEditor_btnOpenElementSelectionDialogText=...
-CustomizationEditor_btnOpenFontDialogText=...
-CustomizationEditor_btnProperties=&Properties
-CustomizationEditor_btnTooltipViewErrors=View errors
-CustomizationEditor_cannotFindMetamodel=Couldn't find metamodel with URI "{0}"
-CustomizationEditor_changeProperties=Change Properties
-CustomizationEditor_collapseLink=Collapse link
-CustomizationEditor_conditions=Conditions :
-CustomizationEditor_conflictingUnsavedChanges=There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
-CustomizationEditor_customizationsWillBeDeleted=All the customizations for metaclass "{0}" will be deleted. Are you sure?
-CustomizationEditor_customViewFor=custom view for "{0}" ({1})
-CustomizationEditor_down=&Down
-CustomizationEditor_edit=&Edit...
-CustomizationEditor_editFeatureValue=Edit feature &value...
-CustomizationEditor_error=Error
-CustomizationEditor_errorLoadingResource=Error loading resource. See log for more information.
-CustomizationEditor_fileConflict=File Conflict
-CustomizationEditor_hideMetaclassName=Hide metaclass name
-CustomizationEditor_iconSelection=Icon selection
-CustomizationEditor_invalidSelection=Invalid selection
-CustomizationEditor_italic=Italic
-CustomizationEditor_missingQuery=Couldn't find Query named "{0}" in query set "{1}".
-CustomizationEditor_missingQuerySet=Couldn't find Query Set named "{0}".
-CustomizationEditor_nonExistingQuery=Non-existing Query
-CustomizationEditor_nonExistingQuerySet=Non-existing Query Set
-CustomizationEditor_notFileSelected=You haven't selected a file
-CustomizationEditor_promptCleanCustomizations=Do you want to remove customizations that don't correspond to the new metamodel?
-CustomizationEditor_readonly=READONLY
-CustomizationEditor_remove=&Remove
-CustomizationEditor_removeIrrelevantCustomizations=Remove Irrelevant Customizations
-CustomizationEditor_resetDefaults=Reset Defaults
-CustomizationEditor_sectionName_customizations=Customizations
-CustomizationEditor_sectionName_types=Types
-CustomizationEditor_selectAnIcon=Select an icon:
-CustomizationEditor_strikethrough=Strikethrough
-CustomizationEditor_text=Text
-CustomizationEditor_Title_cleanCustomization=Clean customization
-CustomizationEditor_underlined=Underlined
-CustomizationEditor_unknown=<unknown>
-CustomizationEditor_up=&Up
-CustomizationEditor_visible=Visible
-CustomizationEditor_metaclassVisible=Visible in Types Panel
-CustomizationEditor_youChangedMetamodel=You have changed the metamodel.\n
-CustomizationPropertiesDialog_customizationProperties=Customization Properties
-CustomizationPropertiesDialog_metamodel=Metamodel
-CustomizationPropertiesDialog_metamodelMustBeSelected=A metamodel must be selected
-CustomizationPropertiesDialog_noMetamodelSelected=No metamodel selected
-CustomizationPropertiesDialog_querySets=Query Sets
-CustomizationViewer_backgroundColor=Background Color
-CustomizationViewer_collapseLink=Collapse Link
-CustomizationViewer_defaultValue=<default value>
-CustomizationViewer_feature=Feature
-CustomizationViewer_hideMetaclassName=Hide Metaclass Name
-CustomizationViewer_typeIcon=Type Icon
-CustomizationViewer_isBold=Is Bold
-CustomizationViewer_isItalic=Is Italic
-CustomizationViewer_isStruckthrough=Is Struckthrough
-CustomizationViewer_isUnderlined=Is Underlined
-CustomizationViewer_isVisible=Is Visible
-CustomizationViewer_metaclassVisible=Visible in Types Panel
-CustomizationViewer_label=Label
-CustomizationViewer_instanceIcon=Instance Icon
-CustomizationViewer_overlayIcon=Overlay Icon
-CustomizationViewer_textColor=Text Color
-CustomizationViewer_textFontName=Text Font Name
-CustomizationViewer_value=Value
-ErrorsDialog_diagnosticMessage={0}\nin: {1}\nline: {2} column: {3}
-ErrorsDialog_errors=Errors
-MetaclassViewToolBar_showDerivedLinks=Show Derived Links
-MetaclassViewToolBar_showFullQualifiedNames=Show Full Qualified Names
-MetaclassViewToolBar_showMultiplicity=Show Multiplicity
-MetaclassViewToolBar_sortLinks=Sort Links
-MetaclassViewToolBar_sortLinksByType=Sort Links by Type
-EditFeatureValueDialog_conditionQueryMustBeSelected=A condition query must be selected
-EditFeatureValueDialog_defaultValue=Default value
-EditFeatureValueDialog_editFeatureValue=Edit Feature Value
-EditFeatureValueDialog_featureValue=Feature value
-EditFeatureValueDialog_noConditionQuerySelected=No condition query selected
-EditFeatureValueDialog_noQuerySelected=No query selected
-EditFeatureValueDialog_queryForCondition=Query for condition
-EditFeatureValueDialog_queryMustBeSelected=A query must be selected
-EditFeatureValueDialog_queryValue=Value computed by a query
-EditFeatureValueDialog_staticValue=Static value
-EditFeatureValueDialog_type=Type
+# Copyright (c) 2011 Mia-Software.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+# Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+# Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+
+pluginName = Papyrus EMF Facet Custom Editor
+providerName = Eclipse Modeling Project
+
+_UI_CustomEditor_menu = &Custom Editor
+
+_UI_CreateChild_menu_item = &New Child
+_UI_CreateSibling_menu_item = N&ew Sibling
+
+_UI_ShowPropertiesView_menu_item = Show &Properties View
+_UI_RefreshViewer_menu_item = &Refresh
+
+_UI_SelectionPage_label = Selection
+_UI_ParentPage_label = Parent
+_UI_ListPage_label = List
+_UI_TreePage_label = Tree
+_UI_TablePage_label = Table
+_UI_TreeWithColumnsPage_label = Tree with Columns
+_UI_ObjectColumn_label = Object
+_UI_SelfColumn_label = Self
+
+_UI_NoObjectSelected = Selected Nothing
+_UI_SingleObjectSelected = Selected Object: {0}
+_UI_MultiObjectSelected = Selected {0} Objects
+
+_UI_OpenEditorError_label = Open Editor
+
+_UI_CreateModelError_message = Problems encountered in file "{0}"
+
+_UI_CustomModelWizard_label = Custom Model
+_UI_CustomModelWizard_description = Create a new Custom model
+
+_UI_CustomEditor_label = Custom Model Editor
+
+_UI_CustomEditorFilenameDefaultBase = My
+_UI_CustomEditorFilenameExtensions = custom
+
+_UI_Wizard_label = New
+
+_WARN_FilenameExtension = The file name must end in ''.{0}''
+_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
+
+_UI_ModelObject = &Model Object
+_UI_XMLEncoding = &XML Encoding
+_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
+_UI_Wizard_initial_object_description = Select a model object to create
+
+_UI_FileConflict_label = File Conflict
+_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+
+CustomizationEditor_add=&Add...
+CustomizationEditor_appliesToSubInstances=Applies to &Sub-Instances
+CustomizationEditor_bold=Bold
+CustomizationEditor_btnOpenElementSelectionDialogText=...
+CustomizationEditor_btnOpenFontDialogText=...
+CustomizationEditor_btnProperties=&Properties
+CustomizationEditor_btnTooltipViewErrors=View errors
+CustomizationEditor_cannotFindMetamodel=Couldn't find metamodel with URI "{0}"
+CustomizationEditor_changeProperties=Change Properties
+CustomizationEditor_collapseLink=Collapse link
+CustomizationEditor_conditions=Conditions :
+CustomizationEditor_conflictingUnsavedChanges=There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+CustomizationEditor_customizationsWillBeDeleted=All the customizations for metaclass "{0}" will be deleted. Are you sure?
+CustomizationEditor_customViewFor=custom view for "{0}" ({1})
+CustomizationEditor_down=&Down
+CustomizationEditor_edit=&Edit...
+CustomizationEditor_editFeatureValue=Edit feature &value...
+CustomizationEditor_error=Error
+CustomizationEditor_errorLoadingResource=Error loading resource. See log for more information.
+CustomizationEditor_fileConflict=File Conflict
+CustomizationEditor_hideMetaclassName=Hide metaclass name
+CustomizationEditor_iconSelection=Icon selection
+CustomizationEditor_invalidSelection=Invalid selection
+CustomizationEditor_italic=Italic
+CustomizationEditor_missingQuery=Couldn't find Query named "{0}" in query set "{1}".
+CustomizationEditor_missingQuerySet=Couldn't find Query Set named "{0}".
+CustomizationEditor_nonExistingQuery=Non-existing Query
+CustomizationEditor_nonExistingQuerySet=Non-existing Query Set
+CustomizationEditor_notFileSelected=You haven't selected a file
+CustomizationEditor_promptCleanCustomizations=Do you want to remove customizations that don't correspond to the new metamodel?
+CustomizationEditor_readonly=READONLY
+CustomizationEditor_remove=&Remove
+CustomizationEditor_removeIrrelevantCustomizations=Remove Irrelevant Customizations
+CustomizationEditor_resetDefaults=Reset Defaults
+CustomizationEditor_sectionName_customizations=Customizations
+CustomizationEditor_sectionName_types=Types
+CustomizationEditor_selectAnIcon=Select an icon:
+CustomizationEditor_strikethrough=Strikethrough
+CustomizationEditor_text=Text
+CustomizationEditor_Title_cleanCustomization=Clean customization
+CustomizationEditor_underlined=Underlined
+CustomizationEditor_unknown=<unknown>
+CustomizationEditor_up=&Up
+CustomizationEditor_visible=Visible
+CustomizationEditor_metaclassVisible=Visible in Types Panel
+CustomizationEditor_youChangedMetamodel=You have changed the metamodel.\n
+CustomizationPropertiesDialog_customizationProperties=Customization Properties
+CustomizationPropertiesDialog_metamodel=Metamodel
+CustomizationPropertiesDialog_metamodelMustBeSelected=A metamodel must be selected
+CustomizationPropertiesDialog_noMetamodelSelected=No metamodel selected
+CustomizationPropertiesDialog_querySets=Query Sets
+CustomizationViewer_backgroundColor=Background Color
+CustomizationViewer_collapseLink=Collapse Link
+CustomizationViewer_defaultValue=<default value>
+CustomizationViewer_feature=Feature
+CustomizationViewer_hideMetaclassName=Hide Metaclass Name
+CustomizationViewer_typeIcon=Type Icon
+CustomizationViewer_isBold=Is Bold
+CustomizationViewer_isItalic=Is Italic
+CustomizationViewer_isStruckthrough=Is Struckthrough
+CustomizationViewer_isUnderlined=Is Underlined
+CustomizationViewer_isVisible=Is Visible
+CustomizationViewer_metaclassVisible=Visible in Types Panel
+CustomizationViewer_label=Label
+CustomizationViewer_instanceIcon=Instance Icon
+CustomizationViewer_overlayIcon=Overlay Icon
+CustomizationViewer_textColor=Text Color
+CustomizationViewer_textFontName=Text Font Name
+CustomizationViewer_value=Value
+ErrorsDialog_diagnosticMessage={0}\nin: {1}\nline: {2} column: {3}
+ErrorsDialog_errors=Errors
+MetaclassViewToolBar_showDerivedLinks=Show Derived Links
+MetaclassViewToolBar_showFullQualifiedNames=Show Full Qualified Names
+MetaclassViewToolBar_showMultiplicity=Show Multiplicity
+MetaclassViewToolBar_sortLinks=Sort Links
+MetaclassViewToolBar_sortLinksByType=Sort Links by Type
+EditFeatureValueDialog_conditionQueryMustBeSelected=A condition query must be selected
+EditFeatureValueDialog_defaultValue=Default value
+EditFeatureValueDialog_editFeatureValue=Edit Feature Value
+EditFeatureValueDialog_featureValue=Feature value
+EditFeatureValueDialog_noConditionQuerySelected=No condition query selected
+EditFeatureValueDialog_noQuerySelected=No query selected
+EditFeatureValueDialog_queryForCondition=Query for condition
+EditFeatureValueDialog_queryMustBeSelected=A query must be selected
+EditFeatureValueDialog_queryValue=Value computed by a query
+EditFeatureValueDialog_staticValue=Static value
+EditFeatureValueDialog_type=Type
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml
index 5c257f1ff98..b40d5f9e818 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/plugin.xml
@@ -1,44 +1,44 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<!--
- Copyright (c) 2011 Mia-Software.
-
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
- Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
- Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
--->
-
-<plugin>
-
- <extension point="org.eclipse.ui.newWizards">
- <!-- @generated NOT -->
- <wizard
- id="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomModelWizardID"
- name="%_UI_CustomModelWizard_label"
- class="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomModelWizard"
- category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category"
- icon="icons/full/obj16/CustomModelFile.gif">
- <description>%_UI_CustomModelWizard_description</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
- </extension>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- id="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomEditorID"
- name="%_UI_CustomEditor_label"
- icon="icons/full/obj16/CustomModelFile.gif"
- extensions="custom"
- class="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomEditor"
- contributorClass="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomActionBarContributor">
- </editor>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2011 Mia-Software.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+ Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated NOT -->
+ <wizard
+ id="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomModelWizardID"
+ name="%_UI_CustomModelWizard_label"
+ class="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomModelWizard"
+ category="org.eclipse.papyrus.wizards.category/org.eclipse.papyrus.wizards.addons.category"
+ icon="icons/full/obj16/CustomModelFile.gif">
+ <description>%_UI_CustomModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <editor
+ id="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomEditorID"
+ name="%_UI_CustomEditor_label"
+ icon="icons/full/obj16/CustomModelFile.gif"
+ extensions="custom"
+ class="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomEditor"
+ contributorClass="org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation.CustomActionBarContributor">
+ </editor>
+ </extension>
+
+</plugin>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/pom.xml b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/pom.xml
index dd1bf9a1089..7d568495a3f 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/pom.xml
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/pom.xml
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>org.eclipse.papyrus.facet-editor</artifactId>
- <groupId>org.eclipse.papyrus</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <artifactId>org.eclipse.papyrus.emf.facet.custom.metamodel.editor</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
+<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.facet-editor</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.emf.facet.custom.metamodel.editor</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Activator.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Activator.java
index 587a2858988..230ec3cb7b1 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Activator.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Activator.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-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.emf.facet.custom.metamodel.editor"; //$NON-NLS-1$
-
- /** The shared instance */
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- // nothing
- }
-
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- Activator.plugin = this;
- }
-
- @Override
- public void stop(final BundleContext context) throws Exception {
- Activator.plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return Activator.plugin;
- }
-
+/*******************************************************************************
+ * Copyright (c) 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+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.emf.facet.custom.metamodel.editor"; //$NON-NLS-1$
+
+ /** The shared instance */
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ // nothing
+ }
+
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ Activator.plugin = this;
+ }
+
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ Activator.plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return Activator.plugin;
+ }
+
} \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ColorProvider.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ColorProvider.java
index 11636c7a787..18d2af23ef4 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ColorProvider.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ColorProvider.java
@@ -1,66 +1,66 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-public final class ColorProvider {
-
- private static ColorProvider instance;
-
- public static ColorProvider getInstance() {
- if (ColorProvider.instance == null) {
- ColorProvider.instance = new ColorProvider();
- }
- return ColorProvider.instance;
- }
-
- /** The color used for elements that are empty or not used */
- private final Color gray;
- /** The color used for elements that are not part of the first resource */
- private final Color externalResourceColor;
- /** The color used for elements that are not in any resource */
- private final Color nullResourceColor;
-
- private ColorProvider() {
- final Display display = Display.getCurrent();
-
- final RGB rgbGray = new RGB(128, 128, 128);
- this.gray = new Color(display, rgbGray);
-
- final RGB rgbBlue = new RGB(0, 0, 255);
- this.externalResourceColor = new Color(display, rgbBlue);
-
- final RGB rgbDarkRed = new RGB(192, 0, 0);
- this.nullResourceColor = new Color(display, rgbDarkRed);
- }
-
- public Color getGray() {
- return this.gray;
- }
-
- public Color getExternalResourceColor() {
- return this.externalResourceColor;
- }
-
- public Color getNullResourceColor() {
- return this.nullResourceColor;
- }
-
- public Color getUnresolvedProxyColor() {
- return JFaceColors.getErrorText(Display.getCurrent());
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ *
+ *******************************************************************************/
+
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import org.eclipse.jface.resource.JFaceColors;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+public final class ColorProvider {
+
+ private static ColorProvider instance;
+
+ public static ColorProvider getInstance() {
+ if (ColorProvider.instance == null) {
+ ColorProvider.instance = new ColorProvider();
+ }
+ return ColorProvider.instance;
+ }
+
+ /** The color used for elements that are empty or not used */
+ private final Color gray;
+ /** The color used for elements that are not part of the first resource */
+ private final Color externalResourceColor;
+ /** The color used for elements that are not in any resource */
+ private final Color nullResourceColor;
+
+ private ColorProvider() {
+ final Display display = Display.getCurrent();
+
+ final RGB rgbGray = new RGB(128, 128, 128);
+ this.gray = new Color(display, rgbGray);
+
+ final RGB rgbBlue = new RGB(0, 0, 255);
+ this.externalResourceColor = new Color(display, rgbBlue);
+
+ final RGB rgbDarkRed = new RGB(192, 0, 0);
+ this.nullResourceColor = new Color(display, rgbDarkRed);
+ }
+
+ public Color getGray() {
+ return this.gray;
+ }
+
+ public Color getExternalResourceColor() {
+ return this.externalResourceColor;
+ }
+
+ public Color getNullResourceColor() {
+ return this.nullResourceColor;
+ }
+
+ public Color getUnresolvedProxyColor() {
+ return JFaceColors.getErrorText(Display.getCurrent());
+ }
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomActionBarContributor.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomActionBarContributor.java
index 67096d088aa..1a5244b4c98 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomActionBarContributor.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomActionBarContributor.java
@@ -1,450 +1,450 @@
-/**
- * Copyright (c) 2011 Mia-Software.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
- * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
- * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
- */
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.common.ui.viewer.IViewerProvider;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.edit.ui.action.ControlAction;
-import org.eclipse.emf.edit.ui.action.CreateChildAction;
-import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
-import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
-import org.eclipse.emf.edit.ui.action.LoadResourceAction;
-import org.eclipse.emf.edit.ui.action.ValidateAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.SubContributionItem;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-
-/**
- * This is the action bar contributor for the Custom model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class CustomActionBarContributor
- extends EditingDomainActionBarContributor
- implements ISelectionChangedListener {
- /**
- * This keeps track of the active editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IEditorPart activeEditorPart;
-
- /**
- * This keeps track of the current selection provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected ISelectionProvider selectionProvider;
-
- /**
- * This action opens the Properties view.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IAction showPropertiesViewAction =
- new Action(CustomEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
- @Override
- public void run() {
- try {
- getPage().showView("org.eclipse.ui.views.PropertySheet");
- }
- catch (PartInitException exception) {
- CustomEditorPlugin.INSTANCE.log(exception);
- }
- }
- };
-
- /**
- * This action refreshes the viewer of the current editor if the editor
- * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IAction refreshViewerAction =
- new Action(CustomEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
- @Override
- public boolean isEnabled() {
- return activeEditorPart instanceof IViewerProvider;
- }
-
- @Override
- public void run() {
- if (activeEditorPart instanceof IViewerProvider) {
- Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer();
- if (viewer != null) {
- viewer.refresh();
- }
- }
- }
- };
-
- /**
- * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
- * generated for the current selection by the item provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> createChildActions;
-
- /**
- * This is the menu manager into which menu contribution items should be added for CreateChild actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IMenuManager createChildMenuManager;
-
- /**
- * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
- * generated for the current selection by the item provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> createSiblingActions;
-
- /**
- * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IMenuManager createSiblingMenuManager;
-
- /**
- * This creates an instance of the contributor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public CustomActionBarContributor() {
- super(ADDITIONS_LAST_STYLE);
- loadResourceAction = new LoadResourceAction();
- validateAction = new ValidateAction();
- controlAction = new ControlAction();
- }
-
- /**
- * This adds Separators for editor additions to the tool bar.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void contributeToToolBar(IToolBarManager toolBarManager) {
- toolBarManager.add(new Separator("custom-settings"));
- toolBarManager.add(new Separator("custom-additions"));
- }
-
- /**
- * This adds to the menu bar a menu and some separators for editor additions,
- * as well as the sub-menus for object creation items.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void contributeToMenu(IMenuManager menuManager) {
- super.contributeToMenu(menuManager);
-
- IMenuManager submenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditor_menu"), "org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.customMenuID");
- menuManager.insertAfter("additions", submenuManager);
- submenuManager.add(new Separator("settings"));
- submenuManager.add(new Separator("actions"));
- submenuManager.add(new Separator("additions"));
- submenuManager.add(new Separator("additions-end"));
-
- // Prepare for CreateChild item addition or removal.
- //
- createChildMenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
- submenuManager.insertBefore("additions", createChildMenuManager);
-
- // Prepare for CreateSibling item addition or removal.
- //
- createSiblingMenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
- submenuManager.insertBefore("additions", createSiblingMenuManager);
-
- // Force an update because Eclipse hides empty menus now.
- //
- submenuManager.addMenuListener
- (new IMenuListener() {
- public void menuAboutToShow(IMenuManager menuManager) {
- menuManager.updateAll(true);
- }
- });
-
- addGlobalActions(submenuManager);
- }
-
- /**
- * When the active editor changes, this remembers the change and registers with it as a selection provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- // @Override
- // public void setActiveEditor(IEditorPart part) {
- // super.setActiveEditor(part);
- // activeEditorPart = part;
- //
- // // Switch to the new selection provider.
- // //
- // if (selectionProvider != null) {
- // selectionProvider.removeSelectionChangedListener(this);
- // }
- // if (part == null) {
- // selectionProvider = null;
- // }
- // else {
- // selectionProvider = part.getSite().getSelectionProvider();
- // selectionProvider.addSelectionChangedListener(this);
- //
- // // Fake a selection changed event to update the menus.
- // //
- // if (selectionProvider.getSelection() != null) {
- // selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
- // }
- // }
- // }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
- * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
- * that can be added to the selected object and updating the menus accordingly.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void selectionChanged(SelectionChangedEvent event) {
- // Remove any menu items for old selection.
- //
- if (createChildMenuManager != null) {
- depopulateManager(createChildMenuManager, createChildActions);
- }
- if (createSiblingMenuManager != null) {
- depopulateManager(createSiblingMenuManager, createSiblingActions);
- }
-
- // Query the new selection for appropriate new child/sibling descriptors
- //
- Collection<?> newChildDescriptors = null;
- Collection<?> newSiblingDescriptors = null;
-
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) {
- Object object = ((IStructuredSelection) selection).getFirstElement();
-
- EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain();
-
- newChildDescriptors = domain.getNewChildDescriptors(object, null);
- newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
- }
-
- // Generate actions for selection; populate and redraw the menus.
- //
- createChildActions = generateCreateChildActions(newChildDescriptors, selection);
- createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
-
- if (createChildMenuManager != null) {
- populateManager(createChildMenuManager, createChildActions, null);
- createChildMenuManager.update(true);
- }
- if (createSiblingMenuManager != null) {
- populateManager(createSiblingMenuManager, createSiblingActions, null);
- createSiblingMenuManager.update(true);
- }
- }
-
- /**
- * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
- * and returns the collection of these actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
- Collection<IAction> actions = new ArrayList<IAction>();
- if (descriptors != null) {
- for (Object descriptor : descriptors) {
- actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
- }
- }
- return actions;
- }
-
- /**
- * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
- * and returns the collection of these actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
- Collection<IAction> actions = new ArrayList<IAction>();
- if (descriptors != null) {
- for (Object descriptor : descriptors) {
- actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
- }
- }
- return actions;
- }
-
- /**
- * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
- * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
- * by inserting them before the specified contribution item <code>contributionID</code>.
- * If <code>contributionID</code> is <code>null</code>, they are simply added.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
- if (actions != null) {
- for (IAction action : actions) {
- if (contributionID != null) {
- manager.insertBefore(contributionID, action);
- }
- else {
- manager.add(action);
- }
- }
- }
- }
-
- /**
- * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
- * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
- if (actions != null) {
- IContributionItem[] items = manager.getItems();
- for (int i = 0; i < items.length; i++) {
- // Look into SubContributionItems
- //
- IContributionItem contributionItem = items[i];
- while (contributionItem instanceof SubContributionItem) {
- contributionItem = ((SubContributionItem) contributionItem).getInnerItem();
- }
-
- // Delete the ActionContributionItems with matching action.
- //
- if (contributionItem instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem) contributionItem).getAction();
- if (actions.contains(action)) {
- manager.remove(contributionItem);
- }
- }
- }
- }
- }
-
- /**
- * This populates the pop-up menu before it appears.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void menuAboutToShow(IMenuManager menuManager) {
- super.menuAboutToShow(menuManager);
- MenuManager submenuManager = null;
-
- submenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
- populateManager(submenuManager, createChildActions, null);
- menuManager.insertBefore("edit", submenuManager);
-
- submenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
- populateManager(submenuManager, createSiblingActions, null);
- menuManager.insertBefore("edit", submenuManager);
- }
-
- /**
- * This inserts global actions before the "additions-end" separator.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected void addGlobalActions(IMenuManager menuManager) {
- menuManager.insertAfter("additions-end", new Separator("ui-actions"));
- menuManager.insertAfter("ui-actions", showPropertiesViewAction);
-
- refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
- menuManager.insertAfter("ui-actions", refreshViewerAction);
-
- super.addGlobalActions(menuManager);
- }
-
- /**
- * This ensures that a delete action will clean up all references to deleted objects.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected boolean removeAllReferencesOnDelete() {
- return true;
- }
-
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ */
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the Custom model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class CustomActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(CustomEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ CustomEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(CustomEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public CustomActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("custom-settings"));
+ toolBarManager.add(new Separator("custom-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditor_menu"), "org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.customMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ // @Override
+ // public void setActiveEditor(IEditorPart part) {
+ // super.setActiveEditor(part);
+ // activeEditorPart = part;
+ //
+ // // Switch to the new selection provider.
+ // //
+ // if (selectionProvider != null) {
+ // selectionProvider.removeSelectionChangedListener(this);
+ // }
+ // if (part == null) {
+ // selectionProvider = null;
+ // }
+ // else {
+ // selectionProvider = part.getSite().getSelectionProvider();
+ // selectionProvider.addSelectionChangedListener(this);
+ //
+ // // Fake a selection changed event to update the menus.
+ // //
+ // if (selectionProvider.getSelection() != null) {
+ // selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ // }
+ // }
+ // }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) {
+ Object object = ((IStructuredSelection) selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem) contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem) contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(CustomEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
} \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditor.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditor.java
index 4453eb5a6ad..51dc381d8a9 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditor.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditor.java
@@ -1,2059 +1,2059 @@
-/**
- * Copyright (c) 2011 Mia-Software.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
- * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
- * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
- */
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EventObject;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.command.BasicCommandStack;
-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.MarkerHelper;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.ui.ViewerPane;
-import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
-import org.eclipse.emf.common.ui.viewer.IViewerProvider;
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EValidator;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.xmi.XMIResource;
-import org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl;
-import org.eclipse.emf.edit.command.MoveCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
-import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
-import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
-import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
-import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
-import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
-import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.FacetCustomization;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomItemProviderAdapterFactory;
-import org.eclipse.papyrus.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.provider.ExtensibleItemProviderAdapterFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.EFacetItemProviderAdapterFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.provider.QueryItemProviderAdapterFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.provider.RuntimeItemProviderAdapterFactory;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.serialization.provider.SerializationItemProviderAdapterFactory;
-import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.SaveAsDialog;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.PropertySheet;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-
-
-/**
- * This is an example of a Custom model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class CustomEditor
- extends EditorPart
- implements IGotoMarker, ISelectionProvider, IMenuListener, IEditingDomainProvider, IViewerProvider {
-
- protected Customization mainCustomization;
-
- protected ComposedAdapterFactory adapterFactory;
-
- protected CustomViewer customizationViewer;
-
- /**
- * Resources that have been changed since last activation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<Resource> changedResources = new ArrayList<Resource>();
-
- /**
- * Resources that have been saved.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<Resource> savedResources = new ArrayList<Resource>();
-
- /**
- * Resources that have been removed since last activation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<Resource> removedResources = new ArrayList<Resource>();
-
- /**
- * This keeps track of the selection of the editor as a whole.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected ISelection editorSelection = StructuredSelection.EMPTY;
-
- /**
- * This listens to which ever viewer is active.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected ISelectionChangedListener selectionChangedListener;
-
- /**
- * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
-
- /**
- * Controls whether the problem indication should be updated.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected boolean updateProblemIndication = true;
-
- /**
- * This is the content outline page's viewer.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected TreeViewer contentOutlineViewer;
-
- /**
- * This is a kludge...
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IStatusLineManager contentOutlineStatusLineManager;
-
- /**
- * Map to store the diagnostic associated with a resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
-
- /**
- * The MarkerHelper is responsible for creating workspace resource markers presented
- * in Eclipse's Problems View.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected MarkerHelper markerHelper = new EditUIMarkerHelper();
-
- /**
- * This is the property sheet page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected PropertySheetPage propertySheetPage;
-
- /**
- * This is the content outline page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IContentOutlinePage contentOutlinePage;
-
- protected Composite buttonsPaneComposite;
-
- private static final int VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS = 30;
- private static final int VERTICAL_SPACE_BEFORE_FIRST_BUTTON = 10;
- public static final String ID = "org.eclipse.papyrus.emf.facet.infra.browser.custom.editor"; //$NON-NLS-1$
- private static final int MAIN_FORM_MARGIN_WIDTH = 4;
- private static final int MAIN_FORM_MARGIN_HEIGHT = 6;
- private static final int LEFT_PANE_SASH_WEIGHT = 400;
- private static final int RIGHT_PANE_SASH_WEIGHT = 600;
-
- private TreeViewer selectionViewer;
- private Button btnEdit;
- private Button btnRemove;
- private Button btnUp;
- private Button btnDown;
- private Button cbAppliesToSubinstances;
- private FormToolkit toolkit;
- private boolean readOnly;
-
- protected int listenerCounter = 0;
-
- private Form fForm;
- private AdapterFactoryEditingDomain editingDomain;
-
- public CustomEditor() {
- super();
- initializeEditingDomain();
- }
-
- /**
- * This sets up the editing domain for the model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void initializeEditingDomain() {
- // Create an adapter factory that yields item providers.
- //
- adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new CustomItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new EFacetItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new SerializationItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new ExtensibleItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new QueryItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new RuntimeItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
-
- // Create the command stack that will notify this editor as commands are executed.
- //
- BasicCommandStack commandStack = new BasicCommandStack();
-
- // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
- //
- commandStack.addCommandStackListener
- (new CommandStackListener() {
- public void commandStackChanged(final EventObject event) {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable() {
- public void run() {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- // setDirty(commandStack.isSaveNeeded());
- // Try to select the affected objects.
- //
- Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
- if (mostRecentCommand != null) {
- setSelectionToViewer(mostRecentCommand.getAffectedObjects());
- }
- if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
- propertySheetPage.refresh();
- }
- }
- });
- }
- });
-
- // Create the editing domain with a special command stack.
- //
- editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
- }
-
- @Override
- public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
- setSite(site);
- setInputWithNotify(input);
- setPartName(input.getName());
- site.setSelectionProvider(this);
- site.getPage().addPartListener(partListener);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
- }
-
- /**
- * This sets the selection into whichever viewer is active.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setSelectionToViewer(Collection<?> collection) {
- final Collection<?> theSelection = collection;
- // Make sure it's okay.
- //
- if (theSelection != null && !theSelection.isEmpty()) {
- Runnable runnable =
- new Runnable() {
- public void run() {
- // Try to select the items in the current content viewer of the editor.
- //
- if (selectionViewer != null) {
- selectionViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
- }
- }
- };
- getSite().getShell().getDisplay().asyncExec(runnable);
- }
- }
-
- @Override
- public void createPartControl(final Composite parent) {
- java.net.URI locationURI;
- String fileName = ""; //$NON-NLS-1$
- final IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput) {
- final IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
- try {
- if (fileEditorInput.getFile().exists()) {
- locationURI = new java.net.URI(URI.createPlatformResourceURI(
- fileEditorInput.getFile().getFullPath().toString(), true).toString());
- } else {
- locationURI = fileEditorInput.getFile().getLocationURI();
- }
- } catch (URISyntaxException e) {
- locationURI = fileEditorInput.getFile().getLocationURI();
- }
- fileName = fileEditorInput.getFile().getName();
- } else if (editorInput instanceof URIEditorInput) {
- final URIEditorInput uriEditorInput = (URIEditorInput) editorInput;
- try {
- locationURI = new java.net.URI(uriEditorInput.getURI().toString());
- } catch (final URISyntaxException e) {
- throw new IllegalArgumentException(e);
- }
- fileName = new Path(locationURI.getPath()).lastSegment();
- } else {
- throw new IllegalStateException("wrong kind of input: " //$NON-NLS-1$
- + editorInput.getClass().getName());
- }
-
- loadResource(org.eclipse.emf.common.util.URI.createURI(locationURI.toString()));
- setPartName(fileName);
-
- createContents(parent);
-
- this.selectionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(final SelectionChangedEvent event) {
- if (listenerCounter == 0) {
- ISelection eventSelection = event.getSelection();
- setSelection(eventSelection);
- final ITreeSelection selection = (ITreeSelection) CustomEditor.this.selectionViewer
- .getSelection();
- listenerCounter++;
- CustomEditor.this.handleSelectionViewerSelectionChanged(selection.getFirstElement());
- listenerCounter = 0;
- CustomEditor.this.customizationViewer.getViewer().getControl()
- .setRedraw(false);
- CustomEditor.this.customizationViewer.getViewer().expandAll();
- CustomEditor.this.customizationViewer.getViewer().getControl()
- .setRedraw(true);
- } else {
- listenerCounter = 0;
- }
- }
- });
-
- setSelection(selectionViewer == null ? StructuredSelection.EMPTY : selectionViewer.getSelection());
- }
-
- public void loadResource(URI resourceURI) {
- Exception exception = null;
- Resource resource = null;
- try {
- // Load the resource through the editing domain.
- //
- resource = editingDomain.getResourceSet().getResource(resourceURI, true);
- } catch (Exception e) {
- exception = e;
- resource = editingDomain.getResourceSet().getResource(resourceURI, false);
- }
- if (resource instanceof XMIResource) {
- ((XMIResource)resource).getDefaultSaveOptions().put(XMIResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware());
- }
- this.mainCustomization = (Customization) resource.getContents().get(0);
- }
-
- private void createContents(final Composite parent) {
- this.toolkit = new FormToolkit(parent.getDisplay());
- this.fForm = this.toolkit.createForm(parent);
- this.toolkit.decorateFormHeading(this.fForm);
-
- final FillLayout fillLayout = new FillLayout();
- fillLayout.marginWidth = CustomEditor.MAIN_FORM_MARGIN_WIDTH;
- fillLayout.marginHeight = CustomEditor.MAIN_FORM_MARGIN_HEIGHT;
- this.fForm.getBody().setLayout(fillLayout);
- createBottomPane(this.fForm.getBody());
- }
-
- protected IResourceChangeListener resourceChangeListener =
- new IResourceChangeListener() {
-
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta = event.getDelta();
- try {
- class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected ResourceSet resourceSet = editingDomain.getResourceSet();
- protected Collection<Resource> changedResources = new ArrayList<Resource>();
- protected Collection<Resource> removedResources = new ArrayList<Resource>();
-
- public boolean visit(IResourceDelta delta) {
- if (delta.getResource().getType() == IResource.FILE) {
- if (delta.getKind() == IResourceDelta.REMOVED ||
- delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
- Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
- if (resource != null) {
- if (delta.getKind() == IResourceDelta.REMOVED) {
- removedResources.add(resource);
- }
- else if (!savedResources.remove(resource)) {
- changedResources.add(resource);
- }
- }
- }
- }
-
- return true;
- }
-
- public Collection<Resource> getChangedResources() {
- return changedResources;
- }
-
- public Collection<Resource> getRemovedResources() {
- return removedResources;
- }
- }
-
- final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
- delta.accept(visitor);
-
- if (!visitor.getRemovedResources().isEmpty()) {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable() {
- public void run() {
- removedResources.addAll(visitor.getRemovedResources());
- if (!isDirty()) {
- getSite().getPage().closeEditor(CustomEditor.this, false);
- }
- }
- });
- }
-
- if (!visitor.getChangedResources().isEmpty()) {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable() {
- public void run() {
- changedResources.addAll(visitor.getChangedResources());
- if (getSite().getPage().getActiveEditor() == CustomEditor.this) {
- handleActivate();
- }
- }
- });
- }
- }
- catch (CoreException exception) {
- CustomEditorPlugin.INSTANCE.log(exception);
- }
- }
- };
-
- private Composite rightPaneComposite;
-
- private Composite createBottomPane(final Composite parent) {
- final SashForm sashForm = new FormStyleSashForm(parent, SWT.HORIZONTAL, this.toolkit) {
- @Override
- protected void createContents() {
- createLeftPane(this);
- createRightPane(this);
- }
- };
-
- sashForm.setWeights(new int[] { CustomEditor.LEFT_PANE_SASH_WEIGHT,
- CustomEditor.RIGHT_PANE_SASH_WEIGHT
- });
- sashForm.setSashWidth(5);
-
- return sashForm;
- }
-
- private void createLeftPane(final Composite parent) {
-
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), CustomEditor.this) {
- @Override
- public Viewer createViewer(Composite composite) {
- Tree tree = new Tree(composite, SWT.MULTI);
- TreeViewer newTreeViewer = new TreeViewer(tree);
- return newTreeViewer;
- }
- };
- viewerPane.createControl(parent);
-
- selectionViewer = (TreeViewer) viewerPane.getViewer();
- selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
-
- selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- selectionViewer.setInput(editingDomain.getResourceSet());
- selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(editingDomain.getResourceSet());
-
- new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
-
- createContextMenuFor(selectionViewer);
- }
-
- /** Right pane : treeviewer + fixed buttons pane */
-
- private Composite createRightPane(final Composite parent) {
- final Section section = this.toolkit.createSection(parent, ExpandableComposite.TITLE_BAR
- | ExpandableComposite.EXPANDED);
-
- this.rightPaneComposite = this.toolkit.createComposite(section, SWT.NONE);
- section.setClient(rightPaneComposite);
-
- final GridLayout gridLayout = new GridLayout(2, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- rightPaneComposite.setLayout(gridLayout);
-
- // tree + bottom options
- final Composite middle = new Composite(rightPaneComposite, SWT.NONE);
- final GridLayout middleLayout = new GridLayout();
- middleLayout.marginHeight = 0;
- middleLayout.marginWidth = 0;
- middle.setLayout(middleLayout);
- middle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- this.customizationViewer = new CustomViewer(middle);
- this.customizationViewer.getViewer().getControl()
- .setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- final Composite optionsPane = this.toolkit.createComposite(middle);
- optionsPane.setLayout(new GridLayout());
- optionsPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
- this.customizationViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(final SelectionChangedEvent event) {
- if (listenerCounter == 0) {
- ISelection eventSelection = event.getSelection();
- setSelection(eventSelection);
- final ITreeSelection selection = (ITreeSelection) CustomEditor.this.customizationViewer
- .getSelection();
- CustomEditor.this.handleCustomzizationViewerSelectionChanged(selection.getFirstElement());
- listenerCounter++;
- } else {
- listenerCounter = 0;
- }
- }
- });
-
- if (this.readOnly) {
- this.cbAppliesToSubinstances.setEnabled(false);
- }
-
- final GridData customizationViewerGridData = new GridData();
- customizationViewerGridData.grabExcessHorizontalSpace = true;
- customizationViewerGridData.grabExcessVerticalSpace = true;
- customizationViewerGridData.horizontalAlignment = SWT.FILL;
- customizationViewerGridData.verticalAlignment = SWT.FILL;
- this.customizationViewer.getViewer().getControl()
- .setLayoutData(customizationViewerGridData);
-
- if (!this.readOnly) {
- createButtonsPane(rightPaneComposite);
- }
-
-
- return rightPaneComposite;
- }
-
- private void setInputInCustomizationTreeviewer(Facet facet) {
- List<DerivedTypedElement> inputs = new ArrayList<DerivedTypedElement>();
- inputs.addAll(facet.getFacetOperations());
- EList<EStructuralFeature> facetElements = facet.getFacetElements();
- for (EStructuralFeature eStructuralFeature : facetElements) {
- if (eStructuralFeature instanceof DerivedTypedElement) {
- inputs.add((DerivedTypedElement) eStructuralFeature);
- }
- }
- this.customizationViewer.setInput(inputs);
- }
-
- private void handleSelectionViewerSelectionChanged(final Object selectedElement) {
- if (selectedElement instanceof EClassCustomization || selectedElement instanceof FacetCustomization) {
- final Facet facet = (Facet) selectedElement;
-
-
- setInputInCustomizationTreeviewer(facet);
- buttonsPaneComposite.dispose();
- createButtonsPaneWhenFacetIsSelected(rightPaneComposite);
- rightPaneComposite.layout();
- } else if (selectedElement instanceof Customization) {
- buttonsPaneComposite.dispose();
- createButtonsPaneWhenCustomizationIsSelected(rightPaneComposite);
- rightPaneComposite.layout();
- }
- else if (selectedElement instanceof DerivedTypedElement) {
- buttonsPaneComposite.dispose();
- createButtonsPaneWhenDerivedIsSelected(rightPaneComposite);
- rightPaneComposite.layout();
-
-
- // Update customViewer input
- DerivedTypedElement derivedTypeElement = (DerivedTypedElement) selectedElement;
- Facet facet = (Facet) derivedTypeElement.eContainer();
- List<DerivedTypedElement> inputs = new ArrayList<DerivedTypedElement>();
- inputs.addAll(facet.getFacetOperations());
- EList<EStructuralFeature> facetElements = facet.getFacetElements();
- for (EStructuralFeature eStructuralFeature : facetElements) {
- if (eStructuralFeature instanceof DerivedTypedElement) {
- inputs.add((DerivedTypedElement) eStructuralFeature);
- }
- }
- this.customizationViewer.setInput(inputs);
- this.customizationViewer.getViewer().setSelection(getSelection(), true);
-
-
- }
- }
-
- private void handleCustomzizationViewerSelectionChanged(final Object selectedElement) {
- setSelection(this.customizationViewer.getViewer().getSelection());
-
- if (selectedElement instanceof FacetOperation || selectedElement instanceof FacetElement) {
- buttonsPaneComposite.dispose();
- createButtonsPaneWhenDerivedIsSelected(rightPaneComposite);
- rightPaneComposite.layout();
- }
- }
-
- private void btnEditClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (selectedElement instanceof TreeSelection) {
- final Object selectedObject = ((TreeSelection) selectedElement).getFirstElement();
- if (selectedObject != null) {
- if (selectedObject instanceof Facet) {
- IFacetDialogFactory.INSTANCE.openEditFacetDialog();
- } else if (selectedObject instanceof FacetAttribute) {
- IFacetDialogFactory.INSTANCE.openEditFacetAttributeDialog();
- } else if (selectedObject instanceof FacetOperation) {
- IFacetDialogFactory.INSTANCE.openEditFacetOperationDialog();
- } else if (selectedObject instanceof FacetReference) {
- IFacetDialogFactory.INSTANCE.openEditFacetReferenceDialog();
- } else if (selectedObject instanceof DerivedTypedElement) {
- IFacetDialogFactory.INSTANCE.openEditFacetOperationParameterDialog();
- } else if (selectedObject instanceof Customization) {
- ICustomizationDialogFactory.DEFAULT.openAddCustomizationPropertyDialog(getSite().getShell().getDisplay(), editingDomain);
- }
- }
- }
- }
-
- @Override
- public void doSave(final IProgressMonitor monitor) {
- // Save only resources that have actually changed.
- //
- final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
-
- // Do the work within an operation because this is a long running activity that modifies the workbench.
- //
- WorkspaceModifyOperation operation =
- new WorkspaceModifyOperation() {
- // This is the method that gets invoked when the operation runs.
- //
- @Override
- public void execute(IProgressMonitor monitor) {
- // Save the resources to the file system.
- //
- boolean first = true;
- for (Resource resource : editingDomain.getResourceSet().getResources()) {
- if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
- try {
- long timeStamp = resource.getTimeStamp();
- resource.save(saveOptions);
- if (resource.getTimeStamp() != timeStamp) {
- savedResources.add(resource);
- }
- }
- catch (Exception exception) {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
- }
- first = false;
- }
- }
- }
- };
-
- updateProblemIndication = false;
- try {
- // This runs the options, and shows progress.
- //
- new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
-
- // Refresh the necessary state.
- //
- ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
- firePropertyChange(IEditorPart.PROP_DIRTY);
- } catch (Exception exception) {
- // Something went wrong that shouldn't.
- //
- CustomEditorPlugin.INSTANCE.log(exception);
- }
- updateProblemIndication = true;
- updateProblemIndication();
- }
-
- /**
- * This returns whether something has been persisted to the URI of the specified resource.
- * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected boolean isPersisted(Resource resource) {
- boolean result = false;
- try {
- InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
- if (stream != null) {
- result = true;
- stream.close();
- }
- } catch (IOException e) {
- // Ignore
- }
- return result;
- }
-
- /**
- * This accesses a cached version of the content outliner.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public IContentOutlinePage getContentOutlinePage() {
- if (contentOutlinePage == null) {
- // The content outline is just a tree.
- //
- class MyContentOutlinePage extends ContentOutlinePage {
- @Override
- public void createControl(Composite parent) {
- super.createControl(parent);
- contentOutlineViewer = getTreeViewer();
- contentOutlineViewer.addSelectionChangedListener(this);
-
- // Set up the tree viewer.
- //
- contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- contentOutlineViewer.setInput(editingDomain.getResourceSet());
-
- // Make sure our popups work.
- //
- createContextMenuFor(contentOutlineViewer);
-
- if (!editingDomain.getResourceSet().getResources().isEmpty()) {
- // Select the root object in the view.
- //
- contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
- }
- }
-
- @Override
- public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
- super.makeContributions(menuManager, toolBarManager, statusLineManager);
- contentOutlineStatusLineManager = statusLineManager;
- }
-
- @Override
- public void setActionBars(IActionBars actionBars) {
- super.setActionBars(actionBars);
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- }
-
- contentOutlinePage = new MyContentOutlinePage();
-
- // Listen to selection so that we can handle it is a special way.
- //
- contentOutlinePage.addSelectionChangedListener
- (new ISelectionChangedListener() {
- // This ensures that we handle selections correctly.
- //
- public void selectionChanged(SelectionChangedEvent event) {
- handleContentOutlineSelection(event.getSelection());
- }
- });
- }
-
- return contentOutlinePage;
- }
-
- /**
- * This accesses a cached version of the property sheet.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public IPropertySheetPage getPropertySheetPage() {
- if (propertySheetPage == null) {
- propertySheetPage =
- new ExtendedPropertySheetPage(editingDomain) {
- @Override
- public void setSelectionToViewer(List<?> selection) {
- CustomEditor.this.setSelectionToViewer(selection);
- CustomEditor.this.setFocus();
- }
-
- @Override
- public void setActionBars(IActionBars actionBars) {
- super.setActionBars(actionBars);
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- };
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
- }
-
- return propertySheetPage;
- }
-
- /**
- * This is how the framework determines which interfaces we implement.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class key) {
- if (key.equals(IContentOutlinePage.class)) {
- return showOutlineView() ? getContentOutlinePage() : null;
- }
- else if (key.equals(IPropertySheetPage.class)) {
- return getPropertySheetPage();
- }
- else if (key.equals(IGotoMarker.class)) {
- return this;
- }
- else {
- return super.getAdapter(key);
- }
- }
-
- /**
- * Returns whether the outline view should be presented to the user.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected boolean showOutlineView() {
- return true;
- }
-
- /**
- * This deals with how we want selection in the outliner to affect the other views.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void handleContentOutlineSelection(ISelection selection) {
- if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
- Iterator<?> selectedElements = ((IStructuredSelection) selection).iterator();
- if (selectedElements.hasNext()) {
- // Get the first selected element.
- //
- Object selectedElement = selectedElements.next();
-
- // If it's the selection viewer, then we want it to select the same selection as this selection.
- //
- ArrayList<Object> selectionList = new ArrayList<Object>();
- selectionList.add(selectedElement);
- while (selectedElements.hasNext()) {
- selectionList.add(selectedElements.next());
- }
-
- // Set the selection to the widget.
- //
- selectionViewer.setSelection(new StructuredSelection(selectionList));
-
- }
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void doSaveAs(URI uri, IEditorInput editorInput) {
- (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
- setInputWithNotify(editorInput);
- setPartName(editorInput.getName());
- IProgressMonitor progressMonitor =
- getActionBars().getStatusLineManager() != null ?
- getActionBars().getStatusLineManager().getProgressMonitor() :
- new NullProgressMonitor();
- doSave(progressMonitor);
- }
-
- //
- /**
- * This is for implementing {@link IEditorPart} and simply tests the command stack.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean isDirty() {
- return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded();
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- //
- @Override
- public void setFocus() {
- // nothing
- }
-
- @Override
- public void dispose() {
- updateProblemIndication = false;
-
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
-
- getSite().getPage().removePartListener(partListener);
-
- adapterFactory.dispose();
-
- if (getActionBarContributor().getActiveEditor() == this) {
- getActionBarContributor().setActiveEditor(null);
- }
-
- if (propertySheetPage != null) {
- propertySheetPage.dispose();
- }
-
- if (contentOutlinePage != null) {
- contentOutlinePage.dispose();
- }
-
- super.dispose();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void gotoMarker(IMarker marker) {
- try {
- if (marker.getType().equals(EValidator.MARKER)) {
- String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
- if (uriAttribute != null) {
- URI uri = URI.createURI(uriAttribute);
- EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
- if (eObject != null) {
- setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
- }
- }
- }
- } catch (CoreException exception) {
- CustomEditorPlugin.INSTANCE.log(exception);
- }
- }
-
- //
- private final IPartListener partListener =
- new IPartListener() {
- public void partActivated(IWorkbenchPart p) {
- if (p instanceof ContentOutline) {
- if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) {
- getActionBarContributor().setActiveEditor(CustomEditor.this);
-
- if (selectionChangedListener == null) {
- // Create the listener on demand.
- //
- selectionChangedListener =
- new ISelectionChangedListener() {
- // This just notifies those things that are affected by the section.
- //
- public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
- setSelection(selectionChangedEvent.getSelection());
- }
- };
- }
- setSelection(selectionViewer == null ? StructuredSelection.EMPTY : selectionViewer.getSelection());
- }
- }
- else if (p instanceof PropertySheet) {
- if (((PropertySheet) p).getCurrentPage() == propertySheetPage) {
- getActionBarContributor().setActiveEditor(CustomEditor.this);
- handleActivate();
- }
- }
- else if (p == CustomEditor.this) {
- handleActivate();
- if (selectionChangedListener == null) {
- // Create the listener on demand.
- //
- selectionChangedListener =
- new ISelectionChangedListener() {
- // This just notifies those things that are affected by the section.
- //
- public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
- setSelection(selectionChangedEvent.getSelection());
- }
- };
- }
- selectionViewer.addSelectionChangedListener(selectionChangedListener);
- setSelection(selectionViewer.getSelection());
- }
- }
-
- public void partBroughtToTop(IWorkbenchPart p) {
- // Ignore.
- }
-
- public void partClosed(IWorkbenchPart p) {
- // Ignore.
- }
-
- public void partDeactivated(IWorkbenchPart p) {
- // Ignore.
- }
-
- public void partOpened(IWorkbenchPart p) {
- // Ignore.
- }
- };
-
- private Button btnAddFacetSet;
-
- private Button btnAddFacet;
-
- private Button btnAddEClassCustom;
-
- private Button btnAddFacetCustom;
-
- private Button btnAddFacetAttr;
-
- private Button btnAddFacetRef;
-
- private Button btnAddFacetOp;
-
- private Button btnAddFacetParam;
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public ISelection getSelection() {
- return editorSelection;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EditingDomainActionBarContributor getActionBarContributor() {
- return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public IActionBars getActionBars() {
- return getActionBarContributor().getActionBars();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setStatusLineManager(ISelection selection) {
- IStatusLineManager statusLineManager = selectionViewer != null && selectionViewer == contentOutlineViewer ?
- contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
-
- if (statusLineManager != null) {
- if (selection instanceof IStructuredSelection) {
- Collection<?> collection = ((IStructuredSelection) selection).toList();
- switch (collection.size()) {
- case 0: {
- statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
- break;
- }
- case 1: {
- String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
- statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
- break;
- }
- default: {
- statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
- break;
- }
- }
- }
- else {
- statusLineManager.setMessage("");
- }
- }
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
- * Calling this result will notify the listeners.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setSelection(ISelection selection) {
- editorSelection = selection;
-
- for (ISelectionChangedListener listener : selectionChangedListeners) {
- listener.selectionChanged(new SelectionChangedEvent(this, selection));
- }
- setStatusLineManager(selection);
- }
-
- /**
- * Returns a diagnostic describing the errors and warnings listed in the resource
- * and the specified exception (if any).
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
- if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
- BasicDiagnostic basicDiagnostic =
- new BasicDiagnostic
- (Diagnostic.ERROR,
- "org.eclipse.papyrus.emf.facet.custom.metamodel.editor",
- 0,
- getString("_UI_CreateModelError_message", resource.getURI()),
- new Object[] { exception == null ? (Object) resource : exception });
- basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
- return basicDiagnostic;
- }
- else if (exception != null) {
- return new BasicDiagnostic(Diagnostic.ERROR,
- "org.eclipse.papyrus.emf.facet.custom.metamodel.editor",
- 0,
- getString("_UI_CreateModelError_message", resource.getURI()),
- new Object[] { exception });
- }
- else {
- return Diagnostic.OK_INSTANCE;
- }
- }
-
- /**
- * Handles activation of the editor or it's associated views.
- */
- protected void handleActivate() {
- // Recompute the read only state.
- //
- if (editingDomain.getResourceToReadOnlyMap() != null) {
- editingDomain.getResourceToReadOnlyMap().clear();
-
- // Refresh any actions that may become enabled or disabled.
- //
- setSelection(getSelection());
- }
-
- if (!removedResources.isEmpty()) {
- if (handleDirtyConflict()) {
- getSite().getPage().closeEditor(CustomEditor.this, false);
- }
- else {
- removedResources.clear();
- changedResources.clear();
- savedResources.clear();
- }
- }
- else if (!changedResources.isEmpty()) {
- changedResources.removeAll(savedResources);
- handleChangedResources();
- changedResources.clear();
- savedResources.clear();
- }
- }
-
- /** Shows a dialog that asks if conflicting changes should be discarded. */
- protected boolean handleDirtyConflict() {
- return MessageDialog.openQuestion(getSite().getShell(),
- "CustomEditor_fileConflict",
- "CustomEditor_conflictingUnsavedChanges");
- }
-
- /**
- * Updates the problems indication with the information described in the specified diagnostic.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void updateProblemIndication() {
- if (updateProblemIndication) {
- BasicDiagnostic diagnostic =
- new BasicDiagnostic
- (Diagnostic.OK,
- "org.eclipse.papyrus.emf.facet.custom.metamodel.editor",
- 0,
- null,
- new Object[] { editingDomain.getResourceSet() });
- for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
- if (childDiagnostic.getSeverity() != Diagnostic.OK) {
- diagnostic.add(childDiagnostic);
- }
- }
-
- if (diagnostic.getSeverity() != Diagnostic.OK) {
- ProblemEditorPart problemEditorPart = new ProblemEditorPart();
- problemEditorPart.setDiagnostic(diagnostic);
- problemEditorPart.setMarkerHelper(markerHelper);
- }
-
- if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
- markerHelper.deleteMarkers(editingDomain.getResourceSet());
- if (diagnostic.getSeverity() != Diagnostic.OK) {
- try {
- markerHelper.createMarkers(diagnostic);
- } catch (CoreException exception) {
- CustomEditorPlugin.INSTANCE.log(exception);
- }
- }
- }
- }
- }
-
- /** Handles what to do with changed resources on activation. */
- protected void handleChangedResources() {
- if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
- if (isDirty()) {
- changedResources.addAll(editingDomain.getResourceSet().getResources());
- }
- editingDomain.getCommandStack().flush();
-
- updateProblemIndication = false;
- for (Resource resource : changedResources) {
- if (resource.isLoaded()) {
- resource.unload();
- try {
- resource.load(Collections.EMPTY_MAP);
- } catch (IOException exception) {
- if (!resourceToDiagnosticMap.containsKey(resource)) {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
- }
- }
- }
- }
-
- if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
- setSelection(StructuredSelection.EMPTY);
- }
-
- updateProblemIndication = true;
- updateProblemIndication();
- }
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.add(listener);
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- selectionChangedListeners.remove(listener);
- }
-
- /**
- * This looks up a string in the plugin's plugin.properties file.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private static String getString(String key) {
- return CustomEditorPlugin.INSTANCE.getString(key);
- }
-
- /**
- * This looks up a string in plugin.properties, making a substitution.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private static String getString(String key, Object s1) {
- return CustomEditorPlugin.INSTANCE.getString(key, new Object[] { s1 });
- }
-
- /**
- * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void createContextMenuFor(StructuredViewer viewer) {
- MenuManager contextMenu = new MenuManager("#PopUp");
- contextMenu.add(new Separator("additions"));
- contextMenu.setRemoveAllWhenShown(true);
- contextMenu.addMenuListener(this);
- Menu menu = contextMenu.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
-
- int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
- Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
- viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
- }
-
- /**
- * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void menuAboutToShow(IMenuManager menuManager) {
- ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
- }
-
- private Object buttonsGridData() {
- final GridData buttonsGridData = new GridData();
- buttonsGridData.grabExcessHorizontalSpace = true;
- buttonsGridData.grabExcessVerticalSpace = false;
- buttonsGridData.horizontalAlignment = SWT.FILL;
- buttonsGridData.verticalAlignment = SWT.FILL;
- return buttonsGridData;
- }
-
- private Composite createButtonsPane(final Composite parent) {
- return createButtonsPaneWhenCustomizationIsSelected(parent);
- }
-
- private Composite createButtonsPaneWhenCustomizationIsSelected(final Composite parent) {
- this.buttonsPaneComposite = new Composite(parent, SWT.NONE);
- final GridData buttonsPaneGridData = new GridData();
- buttonsPaneGridData.grabExcessHorizontalSpace = false;
- buttonsPaneGridData.grabExcessVerticalSpace = true;
- buttonsPaneGridData.horizontalAlignment = SWT.FILL;
- buttonsPaneGridData.verticalAlignment = SWT.FILL;
- buttonsPaneComposite.setLayoutData(buttonsPaneGridData);
-
- buttonsPaneComposite.setLayout(new GridLayout());
-
- final Composite spacer1 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer1GridData = new GridData();
- spacer1GridData.heightHint = CustomEditor.VERTICAL_SPACE_BEFORE_FIRST_BUTTON;
- spacer1.setLayoutData(spacer1GridData);
-
- final Composite spacer2 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer2GridData = new GridData();
- spacer2GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
- spacer2.setLayoutData(spacer2GridData);
-
- final Label lblConditions = new Label(buttonsPaneComposite, SWT.NONE);
- lblConditions.setText("add");
-
- this.btnAddFacetSet = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddFacetSet.setText("FacetSet");
- this.btnAddFacetSet.setLayoutData(buttonsGridData());
- this.btnAddFacetSet.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddFacetSetClicked();
- }
- });
-
- this.btnAddFacet = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddFacet.setText("Facet");
- this.btnAddFacet.setLayoutData(buttonsGridData());
- this.btnAddFacet.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddFacetClicked();
- }
- });
-
- this.btnAddEClassCustom = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddEClassCustom.setText("EClassCustom");
- this.btnAddEClassCustom.setLayoutData(buttonsGridData());
- this.btnAddEClassCustom.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddECLassCustomClicked();
- }
- });
-
- this.btnAddFacetCustom = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddFacetCustom.setText("FacetCustom");
- this.btnAddFacetCustom.setLayoutData(buttonsGridData());
- this.btnAddFacetCustom.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddFacetCustomClicked();
- }
- });
-
- return buttonsPaneComposite;
- }
-
- protected void btnRemoveClicked() {
- if (this.readOnly) {
- return;
- }
- final TreeSelection selectedElement = (TreeSelection) getSelection();
- final Object selectedObject = selectedElement.getFirstElement();
- if (selectedObject instanceof EObject) {
- final EObject eObject = (EObject) selectedObject;
- final EObject eContainer = eObject.eContainer();
-
- if (eContainer instanceof Customization) {
-
- Command command = RemoveCommand.create(this.editingDomain,
- eContainer,
- EcorePackage.eINSTANCE.getEPackage_EClassifiers(),
- eObject);
- this.editingDomain.getCommandStack().execute(command);
- // refresh();
- } else if (eContainer instanceof Facet) {
- if (selectedObject instanceof FacetOperation) {
- Command command = RemoveCommand.create(this.editingDomain,
- eContainer,
- EFacetPackage.eINSTANCE.getFacet_FacetOperations(),
- eObject);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
-
- } else if (selectedObject instanceof FacetAttribute || selectedObject instanceof FacetReference) {
- Command command = RemoveCommand.create(this.editingDomain,
- eContainer,
- EFacetPackage.eINSTANCE.getFacet_FacetElements(),
- eObject);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
- }
- } else if (eContainer instanceof FacetOperation) {
- Command command = RemoveCommand.create(this.editingDomain,
- eContainer,
- EcorePackage.eINSTANCE.getEOperation_EParameters(),
- eObject);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
-
- }
-
- }
- }
-
- protected void btnDownClicked() {
- if (this.readOnly) {
- return;
- }
- final TreeSelection selectedElement = (TreeSelection) getSelection();
- final Object selectedObject = selectedElement.getFirstElement();
- if (selectedObject instanceof EObject) {
- final EObject eObject = (EObject) selectedObject;
- final EObject eContainer = eObject.eContainer();
-
- if (eContainer instanceof Customization) {
- EList<EClassifier> list = ((Customization) eContainer).getEClassifiers();
- final int index = list.indexOf(eObject);
- if (index + 1 < list.size()) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EcorePackage.eINSTANCE.getEPackage_EClassifiers(),
- list.get(index), index + 1);
- this.editingDomain.getCommandStack().execute(command);
- }
- // refresh();
- } else if (eContainer instanceof Facet) {
- if (selectedObject instanceof FacetOperation) {
- EList<FacetOperation> list = ((Facet) eContainer).getFacetOperations();
- final int index = list.indexOf(eObject);
- if (index + 1 < list.size()) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EFacetPackage.eINSTANCE.getFacet_FacetOperations(),
- list.get(index), index + 1);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
- }
- } else if (selectedObject instanceof FacetAttribute || selectedObject instanceof FacetReference) {
- EList<EStructuralFeature> list = ((Facet) eContainer).getFacetElements();
- final int index = list.indexOf(eObject);
- if (index + 1 < list.size()) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EFacetPackage.eINSTANCE.getFacet_FacetElements(),
- list.get(index), index + 1);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
- }
- }
- } else if (eContainer instanceof FacetOperation) {
- EList<EParameter> list = ((FacetOperation) eContainer).getEParameters();
- final int index = list.indexOf(eObject);
- if (index + 1 < list.size()) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EcorePackage.eINSTANCE.getEOperation_EParameters(),
- list.get(index), index + 1);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
- }
- }
-
- }
- }
-
- protected void btnUpClicked() {
- if (this.readOnly) {
- return;
- }
- final TreeSelection selectedElement = (TreeSelection) getSelection();
- final Object selectedObject = selectedElement.getFirstElement();
- if (selectedObject instanceof EObject) {
- final EObject eObject = (EObject) selectedObject;
- final EObject eContainer = eObject.eContainer();
-
- if (eContainer instanceof Customization) {
- EList<EClassifier> list = ((Customization) eContainer).getEClassifiers();
- final int index = list.indexOf(eObject);
- if (index - 1 >= 0) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EcorePackage.eINSTANCE.getEPackage_EClassifiers(),
- list.get(index), index - 1);
- this.editingDomain.getCommandStack().execute(command);
- }
- // refresh();
- } else if (eContainer instanceof Facet) {
- if (selectedObject instanceof FacetOperation) {
- EList<FacetOperation> list = ((Facet) eContainer).getFacetOperations();
- final int index = list.indexOf(eObject);
- if (index - 1 >= 0) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EFacetPackage.eINSTANCE.getFacet_FacetOperations(),
- list.get(index), index - 1);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
- }
- } else if (selectedObject instanceof FacetAttribute || selectedObject instanceof FacetReference) {
- EList<EStructuralFeature> list = ((Facet) eContainer).getFacetElements();
- final int index = list.indexOf(eObject);
- if (index - 1 >= 0) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EFacetPackage.eINSTANCE.getFacet_FacetElements(),
- list.get(index), index - 1);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
- }
- }
- } else if (eContainer instanceof FacetOperation) {
- EList<EParameter> list = ((FacetOperation) eContainer).getEParameters();
- final int index = list.indexOf(eObject);
- if (index - 1 >= 0) {
- Command command = MoveCommand.create(this.editingDomain,
- eContainer,
- EcorePackage.eINSTANCE.getEOperation_EParameters(),
- list.get(index), index - 1);
- this.editingDomain.getCommandStack().execute(command);
-
- setInputInCustomizationTreeviewer((Facet) eContainer);
- this.customizationViewer.getViewer().refresh();
- }
- }
-
- }
-
- }
-
- protected void btnAddFacetCustomClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
- ICustomizationDialogFactory.DEFAULT.openCreateFacetCustomizationDialog(getSite().getShell().getDisplay(), editingDomain);
- }
-
- }
-
- protected void btnAddECLassCustomClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
- ICustomizationDialogFactory.DEFAULT.openCreateEClassCustomizationDialog(getSite().getShell().getDisplay(), editingDomain);
- }
-
- }
-
- protected void btnAddFacetClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
- IFacetDialogFactory.INSTANCE.openCreateFacetInFacetSetDialog();
- }
- }
-
- protected void btnAddFacetSetClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
- IFacetDialogFactory.INSTANCE.openCreateFacetSetInFacetSetDialog();
- }
- }
-
- private Composite createButtonsPaneWhenFacetIsSelected(final Composite parent) {
- this.buttonsPaneComposite = new Composite(parent, SWT.NONE);
- final GridData buttonsPaneGridData = new GridData();
- buttonsPaneGridData.grabExcessHorizontalSpace = false;
- buttonsPaneGridData.grabExcessVerticalSpace = true;
- buttonsPaneGridData.horizontalAlignment = SWT.FILL;
- buttonsPaneGridData.verticalAlignment = SWT.FILL;
- buttonsPaneComposite.setLayoutData(buttonsPaneGridData);
-
- buttonsPaneComposite.setLayout(new GridLayout());
-
- final Composite spacer1 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer1GridData = new GridData();
- spacer1GridData.heightHint = CustomEditor.VERTICAL_SPACE_BEFORE_FIRST_BUTTON;
- spacer1.setLayoutData(spacer1GridData);
-
- final Composite spacer2 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer2GridData = new GridData();
- spacer2GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
- spacer2.setLayoutData(spacer2GridData);
-
- final Label lblConditions = new Label(buttonsPaneComposite, SWT.NONE);
- lblConditions.setText("add");
-
- this.btnAddFacetAttr = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddFacetAttr.setText("Facet Attribute");
- this.btnAddFacetAttr.setLayoutData(buttonsGridData());
- this.btnAddFacetAttr.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddFacetAttributeClicked();
- }
- });
-
- this.btnAddFacetRef = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddFacetRef.setText("Facet Reference");
- this.btnAddFacetRef.setLayoutData(buttonsGridData());
- this.btnAddFacetRef.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddFacetReferenceClicked();
- }
- });
-
- this.btnAddFacetOp = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddFacetOp.setText("Facet Operation");
- this.btnAddFacetOp.setLayoutData(buttonsGridData());
- this.btnAddFacetOp.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddFacetOperationClicked();
- }
- });
-
- final Composite spacer3 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer3GridData = new GridData();
- spacer3GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
- spacer3.setLayoutData(spacer2GridData);
-
- final Label lblEditions = new Label(buttonsPaneComposite, SWT.NONE);
- lblEditions.setText("edit");
-
- this.btnEdit = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnEdit.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_edit"));
- this.btnEdit.setLayoutData(buttonsGridData());
- this.btnEdit.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnEditClicked();
- }
- });
-
- this.btnRemove = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnRemove.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_remove"));
- this.btnRemove.setLayoutData(buttonsGridData());
- this.btnRemove.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnRemoveClicked();
- }
- });
-
- this.btnUp = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnUp.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_up"));
- this.btnUp.setLayoutData(buttonsGridData());
- this.btnUp.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnUpClicked();
- }
- });
-
- this.btnDown = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnDown.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_down"));
- this.btnDown.setLayoutData(buttonsGridData());
- this.btnDown.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnDownClicked();
- }
- });
-
- return buttonsPaneComposite;
- }
-
- protected void btnAddFacetOperationClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (((TreeSelection) selectedElement).getFirstElement() instanceof Facet) {
- IFacetDialogFactory.INSTANCE.openAddOperationInFacetDialog();
- }
-
- }
-
- protected void btnAddFacetReferenceClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (((TreeSelection) selectedElement).getFirstElement() instanceof Facet) {
- IFacetDialogFactory.INSTANCE.openAddReferenceInFacetDialog();
- }
- }
-
- protected void btnAddFacetAttributeClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (((TreeSelection) selectedElement).getFirstElement() instanceof Facet) {
- IFacetDialogFactory.INSTANCE.openAddAttributeInFacetDialog();
- }
- }
-
- private Composite createButtonsPaneWhenDerivedIsSelected(final Composite parent) {
- this.buttonsPaneComposite = new Composite(parent, SWT.NONE);
- final GridData buttonsPaneGridData = new GridData();
- buttonsPaneGridData.grabExcessHorizontalSpace = false;
- buttonsPaneGridData.grabExcessVerticalSpace = true;
- buttonsPaneGridData.horizontalAlignment = SWT.FILL;
- buttonsPaneGridData.verticalAlignment = SWT.FILL;
- buttonsPaneComposite.setLayoutData(buttonsPaneGridData);
-
- buttonsPaneComposite.setLayout(new GridLayout());
-
- final Composite spacer1 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer1GridData = new GridData();
- spacer1GridData.heightHint = CustomEditor.VERTICAL_SPACE_BEFORE_FIRST_BUTTON;
- spacer1.setLayoutData(spacer1GridData);
-
- final Composite spacer2 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer2GridData = new GridData();
- spacer2GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
- spacer2.setLayoutData(spacer2GridData);
-
- final Label lblConditions = new Label(buttonsPaneComposite, SWT.NONE);
- lblConditions.setText("add");
-
- this.btnAddFacetParam = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnAddFacetParam.setText("Parameter");
- this.btnAddFacetParam.setLayoutData(buttonsGridData());
- this.btnAddFacetParam.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnAddParameterClicked();
- }
- });
-
- if (!(((TreeSelection) getSelection()).getFirstElement() instanceof FacetOperation)) {
- this.btnAddFacetParam.setEnabled(false);
- } else {
- this.btnAddFacetParam.setEnabled(true);
- }
-
- final Composite spacer3 = new Composite(buttonsPaneComposite, SWT.NONE);
- final GridData spacer3GridData = new GridData();
- spacer3GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
- spacer3.setLayoutData(spacer2GridData);
-
- final Label lblEditions = new Label(buttonsPaneComposite, SWT.NONE);
- lblEditions.setText("edit");
-
- this.btnEdit = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnEdit.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_edit"));
- this.btnEdit.setLayoutData(buttonsGridData());
- this.btnEdit.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnEditClicked();
- }
- });
-
- this.btnRemove = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnRemove.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_remove"));
- this.btnRemove.setLayoutData(buttonsGridData());
- this.btnRemove.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnRemoveClicked();
- }
- });
-
- this.btnUp = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnUp.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_up"));
- this.btnUp.setLayoutData(buttonsGridData());
- this.btnUp.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnUpClicked();
- }
- });
-
- this.btnDown = new Button(buttonsPaneComposite, SWT.PUSH);
- this.btnDown.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_down"));
- this.btnDown.setLayoutData(buttonsGridData());
- this.btnDown.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(final SelectionEvent e) {
- btnDownClicked();
- }
- });
-
- return buttonsPaneComposite;
- }
-
- protected void btnAddParameterClicked() {
- if (this.readOnly) {
- return;
- }
- final Object selectedElement = getSelection();
- if (selectedElement instanceof TreeSelection) {
- final Object selectedObject = ((TreeSelection) selectedElement).getFirstElement();
- if (selectedObject instanceof FacetOperation) {
- IFacetDialogFactory.INSTANCE.openAddParameterInOperationDialog();
- }
- }
- }
-
- public EditingDomain getEditingDomain() {
- return editingDomain;
- }
-
- public Viewer getViewer() {
- return selectionViewer;
- }
-
- /**
- * This also changes the editor's input.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void doSaveAs() {
- SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
- saveAsDialog.open();
- IPath path = saveAsDialog.getResult();
- if (path != null) {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file != null) {
- doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
- }
- }
- }
-
-}
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ */
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.command.BasicCommandStack;
+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.MarkerHelper;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.common.ui.ViewerPane;
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EValidator;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl;
+import org.eclipse.emf.edit.command.MoveCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.EClassCustomization;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.FacetCustomization;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomItemProviderAdapterFactory;
+import org.eclipse.papyrus.emf.facet.custom.sdk.ui.dialog.ICustomizationDialogFactory;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.Facet;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetElement;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.provider.ExtensibleItemProviderAdapterFactory;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.EFacetItemProviderAdapterFactory;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.provider.QueryItemProviderAdapterFactory;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.provider.RuntimeItemProviderAdapterFactory;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.serialization.provider.SerializationItemProviderAdapterFactory;
+import org.eclipse.papyrus.emf.facet.efacet.sdk.ui.dialog.IFacetDialogFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+
+/**
+ * This is an example of a Custom model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class CustomEditor
+ extends EditorPart
+ implements IGotoMarker, ISelectionProvider, IMenuListener, IEditingDomainProvider, IViewerProvider {
+
+ protected Customization mainCustomization;
+
+ protected ComposedAdapterFactory adapterFactory;
+
+ protected CustomViewer customizationViewer;
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PropertySheetPage propertySheetPage;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ protected Composite buttonsPaneComposite;
+
+ private static final int VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS = 30;
+ private static final int VERTICAL_SPACE_BEFORE_FIRST_BUTTON = 10;
+ public static final String ID = "org.eclipse.papyrus.emf.facet.infra.browser.custom.editor"; //$NON-NLS-1$
+ private static final int MAIN_FORM_MARGIN_WIDTH = 4;
+ private static final int MAIN_FORM_MARGIN_HEIGHT = 6;
+ private static final int LEFT_PANE_SASH_WEIGHT = 400;
+ private static final int RIGHT_PANE_SASH_WEIGHT = 600;
+
+ private TreeViewer selectionViewer;
+ private Button btnEdit;
+ private Button btnRemove;
+ private Button btnUp;
+ private Button btnDown;
+ private Button cbAppliesToSubinstances;
+ private FormToolkit toolkit;
+ private boolean readOnly;
+
+ protected int listenerCounter = 0;
+
+ private Form fForm;
+ private AdapterFactoryEditingDomain editingDomain;
+
+ public CustomEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CustomItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EFacetItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new SerializationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtensibleItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new QueryItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new RuntimeItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ // setDirty(commandStack.isSaveNeeded());
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
+ propertySheetPage.refresh();
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ @Override
+ public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
+ setSite(site);
+ setInputWithNotify(input);
+ setPartName(input.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (selectionViewer != null) {
+ selectionViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ @Override
+ public void createPartControl(final Composite parent) {
+ java.net.URI locationURI;
+ String fileName = ""; //$NON-NLS-1$
+ final IEditorInput editorInput = getEditorInput();
+ if (editorInput instanceof IFileEditorInput) {
+ final IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
+ try {
+ if (fileEditorInput.getFile().exists()) {
+ locationURI = new java.net.URI(URI.createPlatformResourceURI(
+ fileEditorInput.getFile().getFullPath().toString(), true).toString());
+ } else {
+ locationURI = fileEditorInput.getFile().getLocationURI();
+ }
+ } catch (URISyntaxException e) {
+ locationURI = fileEditorInput.getFile().getLocationURI();
+ }
+ fileName = fileEditorInput.getFile().getName();
+ } else if (editorInput instanceof URIEditorInput) {
+ final URIEditorInput uriEditorInput = (URIEditorInput) editorInput;
+ try {
+ locationURI = new java.net.URI(uriEditorInput.getURI().toString());
+ } catch (final URISyntaxException e) {
+ throw new IllegalArgumentException(e);
+ }
+ fileName = new Path(locationURI.getPath()).lastSegment();
+ } else {
+ throw new IllegalStateException("wrong kind of input: " //$NON-NLS-1$
+ + editorInput.getClass().getName());
+ }
+
+ loadResource(org.eclipse.emf.common.util.URI.createURI(locationURI.toString()));
+ setPartName(fileName);
+
+ createContents(parent);
+
+ this.selectionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(final SelectionChangedEvent event) {
+ if (listenerCounter == 0) {
+ ISelection eventSelection = event.getSelection();
+ setSelection(eventSelection);
+ final ITreeSelection selection = (ITreeSelection) CustomEditor.this.selectionViewer
+ .getSelection();
+ listenerCounter++;
+ CustomEditor.this.handleSelectionViewerSelectionChanged(selection.getFirstElement());
+ listenerCounter = 0;
+ CustomEditor.this.customizationViewer.getViewer().getControl()
+ .setRedraw(false);
+ CustomEditor.this.customizationViewer.getViewer().expandAll();
+ CustomEditor.this.customizationViewer.getViewer().getControl()
+ .setRedraw(true);
+ } else {
+ listenerCounter = 0;
+ }
+ }
+ });
+
+ setSelection(selectionViewer == null ? StructuredSelection.EMPTY : selectionViewer.getSelection());
+ }
+
+ public void loadResource(URI resourceURI) {
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ } catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+ if (resource instanceof XMIResource) {
+ ((XMIResource)resource).getDefaultSaveOptions().put(XMIResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware());
+ }
+ this.mainCustomization = (Customization) resource.getContents().get(0);
+ }
+
+ private void createContents(final Composite parent) {
+ this.toolkit = new FormToolkit(parent.getDisplay());
+ this.fForm = this.toolkit.createForm(parent);
+ this.toolkit.decorateFormHeading(this.fForm);
+
+ final FillLayout fillLayout = new FillLayout();
+ fillLayout.marginWidth = CustomEditor.MAIN_FORM_MARGIN_WIDTH;
+ fillLayout.marginHeight = CustomEditor.MAIN_FORM_MARGIN_HEIGHT;
+ this.fForm.getBody().setLayout(fillLayout);
+ createBottomPane(this.fForm.getBody());
+ }
+
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(CustomEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == CustomEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ CustomEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ private Composite rightPaneComposite;
+
+ private Composite createBottomPane(final Composite parent) {
+ final SashForm sashForm = new FormStyleSashForm(parent, SWT.HORIZONTAL, this.toolkit) {
+ @Override
+ protected void createContents() {
+ createLeftPane(this);
+ createRightPane(this);
+ }
+ };
+
+ sashForm.setWeights(new int[] { CustomEditor.LEFT_PANE_SASH_WEIGHT,
+ CustomEditor.RIGHT_PANE_SASH_WEIGHT
+ });
+ sashForm.setSashWidth(5);
+
+ return sashForm;
+ }
+
+ private void createLeftPane(final Composite parent) {
+
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CustomEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ };
+ viewerPane.createControl(parent);
+
+ selectionViewer = (TreeViewer) viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ }
+
+ /** Right pane : treeviewer + fixed buttons pane */
+
+ private Composite createRightPane(final Composite parent) {
+ final Section section = this.toolkit.createSection(parent, ExpandableComposite.TITLE_BAR
+ | ExpandableComposite.EXPANDED);
+
+ this.rightPaneComposite = this.toolkit.createComposite(section, SWT.NONE);
+ section.setClient(rightPaneComposite);
+
+ final GridLayout gridLayout = new GridLayout(2, false);
+ gridLayout.marginHeight = 0;
+ gridLayout.marginWidth = 0;
+ rightPaneComposite.setLayout(gridLayout);
+
+ // tree + bottom options
+ final Composite middle = new Composite(rightPaneComposite, SWT.NONE);
+ final GridLayout middleLayout = new GridLayout();
+ middleLayout.marginHeight = 0;
+ middleLayout.marginWidth = 0;
+ middle.setLayout(middleLayout);
+ middle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ this.customizationViewer = new CustomViewer(middle);
+ this.customizationViewer.getViewer().getControl()
+ .setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ final Composite optionsPane = this.toolkit.createComposite(middle);
+ optionsPane.setLayout(new GridLayout());
+ optionsPane.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ this.customizationViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(final SelectionChangedEvent event) {
+ if (listenerCounter == 0) {
+ ISelection eventSelection = event.getSelection();
+ setSelection(eventSelection);
+ final ITreeSelection selection = (ITreeSelection) CustomEditor.this.customizationViewer
+ .getSelection();
+ CustomEditor.this.handleCustomzizationViewerSelectionChanged(selection.getFirstElement());
+ listenerCounter++;
+ } else {
+ listenerCounter = 0;
+ }
+ }
+ });
+
+ if (this.readOnly) {
+ this.cbAppliesToSubinstances.setEnabled(false);
+ }
+
+ final GridData customizationViewerGridData = new GridData();
+ customizationViewerGridData.grabExcessHorizontalSpace = true;
+ customizationViewerGridData.grabExcessVerticalSpace = true;
+ customizationViewerGridData.horizontalAlignment = SWT.FILL;
+ customizationViewerGridData.verticalAlignment = SWT.FILL;
+ this.customizationViewer.getViewer().getControl()
+ .setLayoutData(customizationViewerGridData);
+
+ if (!this.readOnly) {
+ createButtonsPane(rightPaneComposite);
+ }
+
+
+ return rightPaneComposite;
+ }
+
+ private void setInputInCustomizationTreeviewer(Facet facet) {
+ List<DerivedTypedElement> inputs = new ArrayList<DerivedTypedElement>();
+ inputs.addAll(facet.getFacetOperations());
+ EList<EStructuralFeature> facetElements = facet.getFacetElements();
+ for (EStructuralFeature eStructuralFeature : facetElements) {
+ if (eStructuralFeature instanceof DerivedTypedElement) {
+ inputs.add((DerivedTypedElement) eStructuralFeature);
+ }
+ }
+ this.customizationViewer.setInput(inputs);
+ }
+
+ private void handleSelectionViewerSelectionChanged(final Object selectedElement) {
+ if (selectedElement instanceof EClassCustomization || selectedElement instanceof FacetCustomization) {
+ final Facet facet = (Facet) selectedElement;
+
+
+ setInputInCustomizationTreeviewer(facet);
+ buttonsPaneComposite.dispose();
+ createButtonsPaneWhenFacetIsSelected(rightPaneComposite);
+ rightPaneComposite.layout();
+ } else if (selectedElement instanceof Customization) {
+ buttonsPaneComposite.dispose();
+ createButtonsPaneWhenCustomizationIsSelected(rightPaneComposite);
+ rightPaneComposite.layout();
+ }
+ else if (selectedElement instanceof DerivedTypedElement) {
+ buttonsPaneComposite.dispose();
+ createButtonsPaneWhenDerivedIsSelected(rightPaneComposite);
+ rightPaneComposite.layout();
+
+
+ // Update customViewer input
+ DerivedTypedElement derivedTypeElement = (DerivedTypedElement) selectedElement;
+ Facet facet = (Facet) derivedTypeElement.eContainer();
+ List<DerivedTypedElement> inputs = new ArrayList<DerivedTypedElement>();
+ inputs.addAll(facet.getFacetOperations());
+ EList<EStructuralFeature> facetElements = facet.getFacetElements();
+ for (EStructuralFeature eStructuralFeature : facetElements) {
+ if (eStructuralFeature instanceof DerivedTypedElement) {
+ inputs.add((DerivedTypedElement) eStructuralFeature);
+ }
+ }
+ this.customizationViewer.setInput(inputs);
+ this.customizationViewer.getViewer().setSelection(getSelection(), true);
+
+
+ }
+ }
+
+ private void handleCustomzizationViewerSelectionChanged(final Object selectedElement) {
+ setSelection(this.customizationViewer.getViewer().getSelection());
+
+ if (selectedElement instanceof FacetOperation || selectedElement instanceof FacetElement) {
+ buttonsPaneComposite.dispose();
+ createButtonsPaneWhenDerivedIsSelected(rightPaneComposite);
+ rightPaneComposite.layout();
+ }
+ }
+
+ private void btnEditClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (selectedElement instanceof TreeSelection) {
+ final Object selectedObject = ((TreeSelection) selectedElement).getFirstElement();
+ if (selectedObject != null) {
+ if (selectedObject instanceof Facet) {
+ IFacetDialogFactory.INSTANCE.openEditFacetDialog();
+ } else if (selectedObject instanceof FacetAttribute) {
+ IFacetDialogFactory.INSTANCE.openEditFacetAttributeDialog();
+ } else if (selectedObject instanceof FacetOperation) {
+ IFacetDialogFactory.INSTANCE.openEditFacetOperationDialog();
+ } else if (selectedObject instanceof FacetReference) {
+ IFacetDialogFactory.INSTANCE.openEditFacetReferenceDialog();
+ } else if (selectedObject instanceof DerivedTypedElement) {
+ IFacetDialogFactory.INSTANCE.openEditFacetOperationParameterDialog();
+ } else if (selectedObject instanceof Customization) {
+ ICustomizationDialogFactory.DEFAULT.openAddCustomizationPropertyDialog(getSite().getShell().getDisplay(), editingDomain);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void doSave(final IProgressMonitor monitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ } catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ CustomEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ } catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ if (propertySheetPage == null) {
+ propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ CustomEditor.this.setSelectionToViewer(selection);
+ CustomEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ }
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection) selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ //
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ //
+ @Override
+ public void setFocus() {
+ // nothing
+ }
+
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ if (propertySheetPage != null) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ try {
+ if (marker.getType().equals(EValidator.MARKER)) {
+ String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
+ if (uriAttribute != null) {
+ URI uri = URI.createURI(uriAttribute);
+ EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
+ if (eObject != null) {
+ setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
+ }
+ }
+ }
+ } catch (CoreException exception) {
+ CustomEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ //
+ private final IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(CustomEditor.this);
+
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+ setSelection(selectionViewer == null ? StructuredSelection.EMPTY : selectionViewer.getSelection());
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (((PropertySheet) p).getCurrentPage() == propertySheetPage) {
+ getActionBarContributor().setActiveEditor(CustomEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == CustomEditor.this) {
+ handleActivate();
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+ selectionViewer.addSelectionChangedListener(selectionChangedListener);
+ setSelection(selectionViewer.getSelection());
+ }
+ }
+
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ private Button btnAddFacetSet;
+
+ private Button btnAddFacet;
+
+ private Button btnAddEClassCustom;
+
+ private Button btnAddFacetCustom;
+
+ private Button btnAddFacetAttr;
+
+ private Button btnAddFacetRef;
+
+ private Button btnAddFacetOp;
+
+ private Button btnAddFacetParam;
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = selectionViewer != null && selectionViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection) selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.papyrus.emf.facet.custom.metamodel.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception == null ? (Object) resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return new BasicDiagnostic(Diagnostic.ERROR,
+ "org.eclipse.papyrus.emf.facet.custom.metamodel.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(CustomEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /** Shows a dialog that asks if conflicting changes should be discarded. */
+ protected boolean handleDirtyConflict() {
+ return MessageDialog.openQuestion(getSite().getShell(),
+ "CustomEditor_fileConflict",
+ "CustomEditor_conflictingUnsavedChanges");
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.papyrus.emf.facet.custom.metamodel.editor",
+ 0,
+ null,
+ new Object[] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ } catch (CoreException exception) {
+ CustomEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /** Handles what to do with changed resources on activation. */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ } catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static String getString(String key) {
+ return CustomEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return CustomEditorPlugin.INSTANCE.getString(key, new Object[] { s1 });
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu = contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ private Object buttonsGridData() {
+ final GridData buttonsGridData = new GridData();
+ buttonsGridData.grabExcessHorizontalSpace = true;
+ buttonsGridData.grabExcessVerticalSpace = false;
+ buttonsGridData.horizontalAlignment = SWT.FILL;
+ buttonsGridData.verticalAlignment = SWT.FILL;
+ return buttonsGridData;
+ }
+
+ private Composite createButtonsPane(final Composite parent) {
+ return createButtonsPaneWhenCustomizationIsSelected(parent);
+ }
+
+ private Composite createButtonsPaneWhenCustomizationIsSelected(final Composite parent) {
+ this.buttonsPaneComposite = new Composite(parent, SWT.NONE);
+ final GridData buttonsPaneGridData = new GridData();
+ buttonsPaneGridData.grabExcessHorizontalSpace = false;
+ buttonsPaneGridData.grabExcessVerticalSpace = true;
+ buttonsPaneGridData.horizontalAlignment = SWT.FILL;
+ buttonsPaneGridData.verticalAlignment = SWT.FILL;
+ buttonsPaneComposite.setLayoutData(buttonsPaneGridData);
+
+ buttonsPaneComposite.setLayout(new GridLayout());
+
+ final Composite spacer1 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer1GridData = new GridData();
+ spacer1GridData.heightHint = CustomEditor.VERTICAL_SPACE_BEFORE_FIRST_BUTTON;
+ spacer1.setLayoutData(spacer1GridData);
+
+ final Composite spacer2 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer2GridData = new GridData();
+ spacer2GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
+ spacer2.setLayoutData(spacer2GridData);
+
+ final Label lblConditions = new Label(buttonsPaneComposite, SWT.NONE);
+ lblConditions.setText("add");
+
+ this.btnAddFacetSet = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddFacetSet.setText("FacetSet");
+ this.btnAddFacetSet.setLayoutData(buttonsGridData());
+ this.btnAddFacetSet.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddFacetSetClicked();
+ }
+ });
+
+ this.btnAddFacet = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddFacet.setText("Facet");
+ this.btnAddFacet.setLayoutData(buttonsGridData());
+ this.btnAddFacet.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddFacetClicked();
+ }
+ });
+
+ this.btnAddEClassCustom = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddEClassCustom.setText("EClassCustom");
+ this.btnAddEClassCustom.setLayoutData(buttonsGridData());
+ this.btnAddEClassCustom.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddECLassCustomClicked();
+ }
+ });
+
+ this.btnAddFacetCustom = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddFacetCustom.setText("FacetCustom");
+ this.btnAddFacetCustom.setLayoutData(buttonsGridData());
+ this.btnAddFacetCustom.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddFacetCustomClicked();
+ }
+ });
+
+ return buttonsPaneComposite;
+ }
+
+ protected void btnRemoveClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final TreeSelection selectedElement = (TreeSelection) getSelection();
+ final Object selectedObject = selectedElement.getFirstElement();
+ if (selectedObject instanceof EObject) {
+ final EObject eObject = (EObject) selectedObject;
+ final EObject eContainer = eObject.eContainer();
+
+ if (eContainer instanceof Customization) {
+
+ Command command = RemoveCommand.create(this.editingDomain,
+ eContainer,
+ EcorePackage.eINSTANCE.getEPackage_EClassifiers(),
+ eObject);
+ this.editingDomain.getCommandStack().execute(command);
+ // refresh();
+ } else if (eContainer instanceof Facet) {
+ if (selectedObject instanceof FacetOperation) {
+ Command command = RemoveCommand.create(this.editingDomain,
+ eContainer,
+ EFacetPackage.eINSTANCE.getFacet_FacetOperations(),
+ eObject);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+
+ } else if (selectedObject instanceof FacetAttribute || selectedObject instanceof FacetReference) {
+ Command command = RemoveCommand.create(this.editingDomain,
+ eContainer,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(),
+ eObject);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+ }
+ } else if (eContainer instanceof FacetOperation) {
+ Command command = RemoveCommand.create(this.editingDomain,
+ eContainer,
+ EcorePackage.eINSTANCE.getEOperation_EParameters(),
+ eObject);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+
+ }
+
+ }
+ }
+
+ protected void btnDownClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final TreeSelection selectedElement = (TreeSelection) getSelection();
+ final Object selectedObject = selectedElement.getFirstElement();
+ if (selectedObject instanceof EObject) {
+ final EObject eObject = (EObject) selectedObject;
+ final EObject eContainer = eObject.eContainer();
+
+ if (eContainer instanceof Customization) {
+ EList<EClassifier> list = ((Customization) eContainer).getEClassifiers();
+ final int index = list.indexOf(eObject);
+ if (index + 1 < list.size()) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EcorePackage.eINSTANCE.getEPackage_EClassifiers(),
+ list.get(index), index + 1);
+ this.editingDomain.getCommandStack().execute(command);
+ }
+ // refresh();
+ } else if (eContainer instanceof Facet) {
+ if (selectedObject instanceof FacetOperation) {
+ EList<FacetOperation> list = ((Facet) eContainer).getFacetOperations();
+ final int index = list.indexOf(eObject);
+ if (index + 1 < list.size()) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EFacetPackage.eINSTANCE.getFacet_FacetOperations(),
+ list.get(index), index + 1);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+ }
+ } else if (selectedObject instanceof FacetAttribute || selectedObject instanceof FacetReference) {
+ EList<EStructuralFeature> list = ((Facet) eContainer).getFacetElements();
+ final int index = list.indexOf(eObject);
+ if (index + 1 < list.size()) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(),
+ list.get(index), index + 1);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+ }
+ }
+ } else if (eContainer instanceof FacetOperation) {
+ EList<EParameter> list = ((FacetOperation) eContainer).getEParameters();
+ final int index = list.indexOf(eObject);
+ if (index + 1 < list.size()) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EcorePackage.eINSTANCE.getEOperation_EParameters(),
+ list.get(index), index + 1);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+ }
+ }
+
+ }
+ }
+
+ protected void btnUpClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final TreeSelection selectedElement = (TreeSelection) getSelection();
+ final Object selectedObject = selectedElement.getFirstElement();
+ if (selectedObject instanceof EObject) {
+ final EObject eObject = (EObject) selectedObject;
+ final EObject eContainer = eObject.eContainer();
+
+ if (eContainer instanceof Customization) {
+ EList<EClassifier> list = ((Customization) eContainer).getEClassifiers();
+ final int index = list.indexOf(eObject);
+ if (index - 1 >= 0) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EcorePackage.eINSTANCE.getEPackage_EClassifiers(),
+ list.get(index), index - 1);
+ this.editingDomain.getCommandStack().execute(command);
+ }
+ // refresh();
+ } else if (eContainer instanceof Facet) {
+ if (selectedObject instanceof FacetOperation) {
+ EList<FacetOperation> list = ((Facet) eContainer).getFacetOperations();
+ final int index = list.indexOf(eObject);
+ if (index - 1 >= 0) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EFacetPackage.eINSTANCE.getFacet_FacetOperations(),
+ list.get(index), index - 1);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+ }
+ } else if (selectedObject instanceof FacetAttribute || selectedObject instanceof FacetReference) {
+ EList<EStructuralFeature> list = ((Facet) eContainer).getFacetElements();
+ final int index = list.indexOf(eObject);
+ if (index - 1 >= 0) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EFacetPackage.eINSTANCE.getFacet_FacetElements(),
+ list.get(index), index - 1);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+ }
+ }
+ } else if (eContainer instanceof FacetOperation) {
+ EList<EParameter> list = ((FacetOperation) eContainer).getEParameters();
+ final int index = list.indexOf(eObject);
+ if (index - 1 >= 0) {
+ Command command = MoveCommand.create(this.editingDomain,
+ eContainer,
+ EcorePackage.eINSTANCE.getEOperation_EParameters(),
+ list.get(index), index - 1);
+ this.editingDomain.getCommandStack().execute(command);
+
+ setInputInCustomizationTreeviewer((Facet) eContainer);
+ this.customizationViewer.getViewer().refresh();
+ }
+ }
+
+ }
+
+ }
+
+ protected void btnAddFacetCustomClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
+ ICustomizationDialogFactory.DEFAULT.openCreateFacetCustomizationDialog(getSite().getShell().getDisplay(), editingDomain);
+ }
+
+ }
+
+ protected void btnAddECLassCustomClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
+ ICustomizationDialogFactory.DEFAULT.openCreateEClassCustomizationDialog(getSite().getShell().getDisplay(), editingDomain);
+ }
+
+ }
+
+ protected void btnAddFacetClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
+ IFacetDialogFactory.INSTANCE.openCreateFacetInFacetSetDialog();
+ }
+ }
+
+ protected void btnAddFacetSetClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (((TreeSelection) selectedElement).getFirstElement() instanceof Customization) {
+ IFacetDialogFactory.INSTANCE.openCreateFacetSetInFacetSetDialog();
+ }
+ }
+
+ private Composite createButtonsPaneWhenFacetIsSelected(final Composite parent) {
+ this.buttonsPaneComposite = new Composite(parent, SWT.NONE);
+ final GridData buttonsPaneGridData = new GridData();
+ buttonsPaneGridData.grabExcessHorizontalSpace = false;
+ buttonsPaneGridData.grabExcessVerticalSpace = true;
+ buttonsPaneGridData.horizontalAlignment = SWT.FILL;
+ buttonsPaneGridData.verticalAlignment = SWT.FILL;
+ buttonsPaneComposite.setLayoutData(buttonsPaneGridData);
+
+ buttonsPaneComposite.setLayout(new GridLayout());
+
+ final Composite spacer1 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer1GridData = new GridData();
+ spacer1GridData.heightHint = CustomEditor.VERTICAL_SPACE_BEFORE_FIRST_BUTTON;
+ spacer1.setLayoutData(spacer1GridData);
+
+ final Composite spacer2 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer2GridData = new GridData();
+ spacer2GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
+ spacer2.setLayoutData(spacer2GridData);
+
+ final Label lblConditions = new Label(buttonsPaneComposite, SWT.NONE);
+ lblConditions.setText("add");
+
+ this.btnAddFacetAttr = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddFacetAttr.setText("Facet Attribute");
+ this.btnAddFacetAttr.setLayoutData(buttonsGridData());
+ this.btnAddFacetAttr.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddFacetAttributeClicked();
+ }
+ });
+
+ this.btnAddFacetRef = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddFacetRef.setText("Facet Reference");
+ this.btnAddFacetRef.setLayoutData(buttonsGridData());
+ this.btnAddFacetRef.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddFacetReferenceClicked();
+ }
+ });
+
+ this.btnAddFacetOp = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddFacetOp.setText("Facet Operation");
+ this.btnAddFacetOp.setLayoutData(buttonsGridData());
+ this.btnAddFacetOp.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddFacetOperationClicked();
+ }
+ });
+
+ final Composite spacer3 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer3GridData = new GridData();
+ spacer3GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
+ spacer3.setLayoutData(spacer2GridData);
+
+ final Label lblEditions = new Label(buttonsPaneComposite, SWT.NONE);
+ lblEditions.setText("edit");
+
+ this.btnEdit = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnEdit.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_edit"));
+ this.btnEdit.setLayoutData(buttonsGridData());
+ this.btnEdit.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnEditClicked();
+ }
+ });
+
+ this.btnRemove = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnRemove.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_remove"));
+ this.btnRemove.setLayoutData(buttonsGridData());
+ this.btnRemove.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnRemoveClicked();
+ }
+ });
+
+ this.btnUp = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnUp.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_up"));
+ this.btnUp.setLayoutData(buttonsGridData());
+ this.btnUp.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnUpClicked();
+ }
+ });
+
+ this.btnDown = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnDown.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_down"));
+ this.btnDown.setLayoutData(buttonsGridData());
+ this.btnDown.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnDownClicked();
+ }
+ });
+
+ return buttonsPaneComposite;
+ }
+
+ protected void btnAddFacetOperationClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (((TreeSelection) selectedElement).getFirstElement() instanceof Facet) {
+ IFacetDialogFactory.INSTANCE.openAddOperationInFacetDialog();
+ }
+
+ }
+
+ protected void btnAddFacetReferenceClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (((TreeSelection) selectedElement).getFirstElement() instanceof Facet) {
+ IFacetDialogFactory.INSTANCE.openAddReferenceInFacetDialog();
+ }
+ }
+
+ protected void btnAddFacetAttributeClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (((TreeSelection) selectedElement).getFirstElement() instanceof Facet) {
+ IFacetDialogFactory.INSTANCE.openAddAttributeInFacetDialog();
+ }
+ }
+
+ private Composite createButtonsPaneWhenDerivedIsSelected(final Composite parent) {
+ this.buttonsPaneComposite = new Composite(parent, SWT.NONE);
+ final GridData buttonsPaneGridData = new GridData();
+ buttonsPaneGridData.grabExcessHorizontalSpace = false;
+ buttonsPaneGridData.grabExcessVerticalSpace = true;
+ buttonsPaneGridData.horizontalAlignment = SWT.FILL;
+ buttonsPaneGridData.verticalAlignment = SWT.FILL;
+ buttonsPaneComposite.setLayoutData(buttonsPaneGridData);
+
+ buttonsPaneComposite.setLayout(new GridLayout());
+
+ final Composite spacer1 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer1GridData = new GridData();
+ spacer1GridData.heightHint = CustomEditor.VERTICAL_SPACE_BEFORE_FIRST_BUTTON;
+ spacer1.setLayoutData(spacer1GridData);
+
+ final Composite spacer2 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer2GridData = new GridData();
+ spacer2GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
+ spacer2.setLayoutData(spacer2GridData);
+
+ final Label lblConditions = new Label(buttonsPaneComposite, SWT.NONE);
+ lblConditions.setText("add");
+
+ this.btnAddFacetParam = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnAddFacetParam.setText("Parameter");
+ this.btnAddFacetParam.setLayoutData(buttonsGridData());
+ this.btnAddFacetParam.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnAddParameterClicked();
+ }
+ });
+
+ if (!(((TreeSelection) getSelection()).getFirstElement() instanceof FacetOperation)) {
+ this.btnAddFacetParam.setEnabled(false);
+ } else {
+ this.btnAddFacetParam.setEnabled(true);
+ }
+
+ final Composite spacer3 = new Composite(buttonsPaneComposite, SWT.NONE);
+ final GridData spacer3GridData = new GridData();
+ spacer3GridData.heightHint = CustomEditor.VERTICAL_SPACE_BETWEEN_BUTTON_GROUPS;
+ spacer3.setLayoutData(spacer2GridData);
+
+ final Label lblEditions = new Label(buttonsPaneComposite, SWT.NONE);
+ lblEditions.setText("edit");
+
+ this.btnEdit = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnEdit.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_edit"));
+ this.btnEdit.setLayoutData(buttonsGridData());
+ this.btnEdit.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnEditClicked();
+ }
+ });
+
+ this.btnRemove = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnRemove.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_remove"));
+ this.btnRemove.setLayoutData(buttonsGridData());
+ this.btnRemove.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnRemoveClicked();
+ }
+ });
+
+ this.btnUp = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnUp.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_up"));
+ this.btnUp.setLayoutData(buttonsGridData());
+ this.btnUp.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnUpClicked();
+ }
+ });
+
+ this.btnDown = new Button(buttonsPaneComposite, SWT.PUSH);
+ this.btnDown.setText(CustomEditorPlugin.INSTANCE.getString("CustomizationEditor_down"));
+ this.btnDown.setLayoutData(buttonsGridData());
+ this.btnDown.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ btnDownClicked();
+ }
+ });
+
+ return buttonsPaneComposite;
+ }
+
+ protected void btnAddParameterClicked() {
+ if (this.readOnly) {
+ return;
+ }
+ final Object selectedElement = getSelection();
+ if (selectedElement instanceof TreeSelection) {
+ final Object selectedObject = ((TreeSelection) selectedElement).getFirstElement();
+ if (selectedObject instanceof FacetOperation) {
+ IFacetDialogFactory.INSTANCE.openAddParameterInOperationDialog();
+ }
+ }
+ }
+
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ public Viewer getViewer() {
+ return selectionViewer;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditorPlugin.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditorPlugin.java
index 084c947a4cb..a8645510364 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditorPlugin.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomEditorPlugin.java
@@ -1,109 +1,109 @@
-/**
- * Copyright (c) 2011 Mia-Software.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
- * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
- * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
- */
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import org.eclipse.emf.common.EMFPlugin;
-import org.eclipse.emf.common.ui.EclipseUIPlugin;
-import org.eclipse.emf.common.util.ResourceLocator;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.Efacet2EditPlugin;
-
-/**
- * This is the central singleton for the Custom editor plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public final class CustomEditorPlugin extends EMFPlugin {
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final CustomEditorPlugin INSTANCE = new CustomEditorPlugin();
-
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private static Implementation plugin;
-
- /**
- * Create the instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public CustomEditorPlugin() {
- super(new ResourceLocator[] {
- Efacet2EditPlugin.INSTANCE,
- });
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the singleton instance.
- * @generated
- */
- @Override
- public ResourceLocator getPluginResourceLocator() {
- return plugin;
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the singleton instance.
- * @generated
- */
- public static Implementation getPlugin() {
- return plugin;
- }
-
- /**
- * The actual implementation of the Eclipse <b>Plugin</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static class Implementation extends EclipseUIPlugin {
- /**
- * Creates an instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public Implementation() {
- super();
-
- // Remember the static instance.
- //
- plugin = this;
- }
- }
-
-}
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ */
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.ui.EclipseUIPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.Efacet2EditPlugin;
+
+/**
+ * This is the central singleton for the Custom editor plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public final class CustomEditorPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final CustomEditorPlugin INSTANCE = new CustomEditorPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public CustomEditorPlugin() {
+ super(new ResourceLocator[] {
+ Efacet2EditPlugin.INSTANCE,
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipseUIPlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomModelWizard.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomModelWizard.java
index 4db778400fd..f50550f4ddf 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomModelWizard.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomModelWizard.java
@@ -1,643 +1,643 @@
-/**
- * Copyright (c) 2011 Mia-Software.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
- * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
- * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
- */
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.CommonPlugin;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.CustomFactory;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.CustomPackage;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomEditPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-
-
-/**
- * This is a simple wizard for creating a new model file.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class CustomModelWizard extends Wizard implements INewWizard {
- /**
- * The supported extensions for created files.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List<String> FILE_EXTENSIONS =
- Collections.unmodifiableList(Arrays.asList(CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameExtensions").split("\\s*,\\s*")));
-
- /**
- * A formatted list of supported file extensions, suitable for display.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final String FORMATTED_FILE_EXTENSIONS =
- CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
-
- /**
- * This caches an instance of the model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected CustomPackage customPackage = CustomPackage.eINSTANCE;
-
- /**
- * This caches an instance of the model factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected CustomFactory customFactory = customPackage.getCustomFactory();
-
- /**
- * This is the file creation page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected CustomModelWizardNewFileCreationPage newFileCreationPage;
-
- /**
- * This is the initial object creation page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected CustomModelWizardInitialObjectCreationPage initialObjectCreationPage;
-
- /**
- * Remember the selection during initialization for populating the default container.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IStructuredSelection selection;
-
- /**
- * Remember the workbench during initialization.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IWorkbench workbench;
-
- /**
- * Caches the names of the types that can be created as the root object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected List<String> initialObjectNames;
-
- /**
- * This just records the information.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(CustomEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
- setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(CustomEditorPlugin.INSTANCE.getImage("full/wizban/NewCustom")));
- }
-
- /**
- * Returns the names of the types that can be created as the root object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<String> getInitialObjectNames() {
- if (initialObjectNames == null) {
- initialObjectNames = new ArrayList<String>();
- for (EClassifier eClassifier : customPackage.getEClassifiers()) {
- if (eClassifier instanceof EClass) {
- EClass eClass = (EClass) eClassifier;
- if (!eClass.isAbstract()) {
- initialObjectNames.add(eClass.getName());
- }
- }
- }
- Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
- }
- return initialObjectNames;
- }
-
- /**
- * Create a new model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected EObject createInitialModel() {
- EClass eClass = (EClass) customPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
- EObject rootObject = customFactory.create(eClass);
- return rootObject;
- }
-
- /**
- * Do the work after everything is specified.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean performFinish() {
- try {
- // Remember the file.
- //
- final IFile modelFile = getModelFile();
-
- // Do the work within an operation.
- //
- WorkspaceModifyOperation operation =
- new WorkspaceModifyOperation() {
- @Override
- protected void execute(IProgressMonitor progressMonitor) {
- try {
- // Create a resource set
- //
- ResourceSet resourceSet = new ResourceSetImpl();
-
- // Get the URI of the model file.
- //
- URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
-
- // Create a resource for this file.
- //
- Resource resource = resourceSet.createResource(fileURI);
-
- // Add the initial model object to the contents.
- //
- EObject rootObject = createInitialModel();
- if (rootObject != null) {
- resource.getContents().add(rootObject);
- }
-
- // Save the contents of the resource to the file system.
- //
- Map<Object, Object> options = new HashMap<Object, Object>();
- options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
- resource.save(options);
- }
- catch (Exception exception) {
- CustomEditorPlugin.INSTANCE.log(exception);
- }
- finally {
- progressMonitor.done();
- }
- }
- };
-
- getContainer().run(false, false, operation);
-
- // Select the new file resource in the current view.
- //
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = workbenchWindow.getActivePage();
- final IWorkbenchPart activePart = page.getActivePart();
- if (activePart instanceof ISetSelectionTarget) {
- final ISelection targetSelection = new StructuredSelection(modelFile);
- getShell().getDisplay().asyncExec
- (new Runnable() {
- public void run() {
- ((ISetSelectionTarget) activePart).selectReveal(targetSelection);
- }
- });
- }
-
- // Open an editor on the new file.
- //
- try {
- page.openEditor
- (new FileEditorInput(modelFile),
- workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
- } catch (PartInitException exception) {
- MessageDialog.openError(workbenchWindow.getShell(), CustomEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
- return false;
- }
-
- return true;
- } catch (Exception exception) {
- CustomEditorPlugin.INSTANCE.log(exception);
- return false;
- }
- }
-
- /**
- * This is the one page of the wizard.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public class CustomModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
- /**
- * Pass in the selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public CustomModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
- super(pageId, selection);
- }
-
- /**
- * The framework calls this to see if the file is correct.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected boolean validatePage() {
- if (super.validatePage()) {
- String extension = new Path(getFileName()).getFileExtension();
- if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
- String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
- setErrorMessage(CustomEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS }));
- return false;
- }
- return true;
- }
- return false;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public IFile getModelFile() {
- return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
- }
- }
-
- /**
- * This is the page where the type of object to create is selected.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public class CustomModelWizardInitialObjectCreationPage extends WizardPage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Combo initialObjectField;
-
- /**
- * @generated
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- */
- protected List<String> encodings;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Combo encodingField;
-
- /**
- * Pass in the selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public CustomModelWizardInitialObjectCreationPage(String pageId) {
- super(pageId);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- {
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.verticalSpacing = 12;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- }
-
- Label containerLabel = new Label(composite, SWT.LEFT);
- {
- containerLabel.setText(CustomEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- containerLabel.setLayoutData(data);
- }
-
- initialObjectField = new Combo(composite, SWT.BORDER);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- initialObjectField.setLayoutData(data);
- }
-
- for (String objectName : getInitialObjectNames()) {
- initialObjectField.add(getLabel(objectName));
- }
-
- if (initialObjectField.getItemCount() == 1) {
- initialObjectField.select(0);
- }
- initialObjectField.addModifyListener(validator);
-
- Label encodingLabel = new Label(composite, SWT.LEFT);
- {
- encodingLabel.setText(CustomEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- encodingLabel.setLayoutData(data);
- }
- encodingField = new Combo(composite, SWT.BORDER);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- encodingField.setLayoutData(data);
- }
-
- for (String encoding : getEncodings()) {
- encodingField.add(encoding);
- }
-
- encodingField.select(0);
- encodingField.addModifyListener(validator);
-
- setPageComplete(validatePage());
- setControl(composite);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected ModifyListener validator =
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- setPageComplete(validatePage());
- }
- };
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected boolean validatePage() {
- return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- if (initialObjectField.getItemCount() == 1) {
- initialObjectField.clearSelection();
- encodingField.setFocus();
- }
- else {
- encodingField.clearSelection();
- initialObjectField.setFocus();
- }
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getInitialObjectName() {
- String label = initialObjectField.getText();
-
- for (String name : getInitialObjectNames()) {
- if (getLabel(name).equals(label)) {
- return name;
- }
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getEncoding() {
- return encodingField.getText();
- }
-
- /**
- * Returns the label for the specified type name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected String getLabel(String typeName) {
- try {
- return CustomEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
- } catch (MissingResourceException mre) {
- CustomEditorPlugin.INSTANCE.log(mre);
- }
- return typeName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<String> getEncodings() {
- if (encodings == null) {
- encodings = new ArrayList<String>();
- for (StringTokenizer stringTokenizer = new StringTokenizer(CustomEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) {
- encodings.add(stringTokenizer.nextToken());
- }
- }
- return encodings;
- }
- }
-
- /**
- * The framework calls this to create the contents of the wizard.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void addPages() {
- // Create a page, set the title, and the initial model file name.
- //
- newFileCreationPage = new CustomModelWizardNewFileCreationPage("Whatever", selection);
- newFileCreationPage.setTitle(CustomEditorPlugin.INSTANCE.getString("_UI_CustomModelWizard_label"));
- newFileCreationPage.setDescription(CustomEditorPlugin.INSTANCE.getString("_UI_CustomModelWizard_description"));
- newFileCreationPage.setFileName(CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
- addPage(newFileCreationPage);
-
- // Try and get the resource selection to determine a current directory for the file dialog.
- //
- if (selection != null && !selection.isEmpty()) {
- // Get the resource...
- //
- Object selectedElement = selection.iterator().next();
- if (selectedElement instanceof IResource) {
- // Get the resource parent, if its a file.
- //
- IResource selectedResource = (IResource) selectedElement;
- if (selectedResource.getType() == IResource.FILE) {
- selectedResource = selectedResource.getParent();
- }
-
- // This gives us a directory...
- //
- if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
- // Set this for the container.
- //
- newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
-
- // Make up a unique new name here.
- //
- String defaultModelBaseFilename = CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameDefaultBase");
- String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
- String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
- for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) {
- modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
- }
- newFileCreationPage.setFileName(modelFilename);
- }
- }
- }
- initialObjectCreationPage = new CustomModelWizardInitialObjectCreationPage("Whatever2");
- initialObjectCreationPage.setTitle(CustomEditorPlugin.INSTANCE.getString("_UI_CustomModelWizard_label"));
- initialObjectCreationPage.setDescription(CustomEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
- addPage(initialObjectCreationPage);
- }
-
- /**
- * Get the file from the page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public IFile getModelFile() {
- return newFileCreationPage.getModelFile();
- }
-
-}
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model
+ * Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework
+ * Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning
+ */
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.CommonPlugin;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.CustomFactory;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.CustomPackage;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomEditPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class CustomModelWizard extends Wizard implements INewWizard {
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected CustomPackage customPackage = CustomPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected CustomFactory customFactory = customPackage.getCustomFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected CustomModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected CustomModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(CustomEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(CustomEditorPlugin.INSTANCE.getImage("full/wizban/NewCustom")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : customPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass) eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass) customPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = customFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ CustomEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget) activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ } catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), CustomEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ } catch (Exception exception) {
+ CustomEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public class CustomModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public CustomModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(CustomEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public class CustomModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public CustomModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(CustomEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(CustomEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return CustomEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ } catch (MissingResourceException mre) {
+ CustomEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(CustomEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new CustomModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(CustomEditorPlugin.INSTANCE.getString("_UI_CustomModelWizard_label"));
+ newFileCreationPage.setDescription(CustomEditorPlugin.INSTANCE.getString("_UI_CustomModelWizard_description"));
+ newFileCreationPage.setFileName(CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource) selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = CustomEditorPlugin.INSTANCE.getString("_UI_CustomEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new CustomModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(CustomEditorPlugin.INSTANCE.getString("_UI_CustomModelWizard_label"));
+ initialObjectCreationPage.setDescription(CustomEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomViewer.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomViewer.java
index 5dcbc5ce430..84de3812293 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomViewer.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/CustomViewer.java
@@ -1,435 +1,435 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EParameter;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase;
-import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementSwitchQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetElement;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.EObjectLiteralQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.FalseLiteralQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.FloatLiteralQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.IntegerLiteralQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.IsOneOfQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.NavigationQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.NullLiteralQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.OperationCallQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.StringLiteralQuery;
-import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.TrueLiteralQuery;
-import org.eclipse.papyrus.emf.facet.query.java.metamodel.v0_2_0.javaquery.JavaQuery;
-import org.eclipse.papyrus.emf.facet.query.ocl.metamodel.oclquery.OclQuery;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Displays the current customizations for a given {@link CustomView}, which is
- * the input of the viewer
- */
-public class CustomViewer {
-
- private static final int VALUE_COLUMN_WIDTH = 200;
- private static final int TYPE_COLUMN_WIDTH = 200;
- private static final int FEATURE_COLUMN_WIDTH = 200;
- private final TreeViewer treeViewer;
-
- // Customization
- private static final String TOP_LEFT_OVERLAY_ICON_PATH = "topLeftOverlay";
- private static final String TOP_MIDDLE_OVERLAY_ICON_PATH = "topMiddleOverlay";
- private static final String TOP_RIGHT_OVERLAY_ICON_PATH = "topRightOverlay";
- private static final String MIDDLE_LEFT_OVERLAY_ICON_PATH = "middleLeftOverlay";
- private static final String MIDDLE_RIGHT_OVERLAY_ICON_PATH = "middleRightOverlay";
- private static final String BOTTOM_LEFT_OVERLAY_ICON_PATH = "bottomLeftOverlay";
- private static final String BOTTOM_MIDDLE_OVERLAY_ICON_PATH = "bottomMiddleOverlay";
- private static final String BOTTOM_RIGHT_OVERLAY_ICON_PATH = "bottomRightOverlay";
- private static final String CUSTOMIZATION_LABEL = "label";
- private static final String CUSTOMIZATION_IMAGE = "image";
- private static final String CUSTOMIZATION_FOREGROUND = "foreground";
- private static final String CUSTOMIZATION_BACKGROUND = "background";
- private static final String FONT_NAME = "fontName";
- private static final String FONT_SIZE = "fontSize";
- private static final String FONT_BOLD = "isBold";
- private static final String FONT_ITALIC = "isItalic";
- private static final String FONT_UNDERLINE = "isUnderlined";
- private static final String FONT_STRUKETHROUGH = "isStruckthrough";
-
- public CustomViewer(final Composite parent) {
- this.treeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER
- | SWT.SINGLE | SWT.FULL_SELECTION);
- this.treeViewer.getTree().setHeaderVisible(true);
-
- final TreeViewerColumn featureColumn = new TreeViewerColumn(this.treeViewer, SWT.LEFT);
- featureColumn.getColumn().setText("feature column");
- featureColumn.getColumn().setWidth(CustomViewer.FEATURE_COLUMN_WIDTH);
- final TreeViewerColumn typeColumn = new TreeViewerColumn(this.treeViewer, SWT.LEFT);
- typeColumn.getColumn().setText("feature type");
- typeColumn.getColumn().setWidth(CustomViewer.TYPE_COLUMN_WIDTH);
- final TreeViewerColumn valueColumn = new TreeViewerColumn(this.treeViewer, SWT.LEFT);
- valueColumn.getColumn().setText("feature value");
- valueColumn.getColumn().setWidth(CustomViewer.VALUE_COLUMN_WIDTH);
-
- this.treeViewer.setContentProvider(new CustomViewerContentProvider());
-
- // for sorting purposes
- this.treeViewer.setLabelProvider(new FeatureLabelProvider());
- this.treeViewer.setComparator(new ViewerComparator() {
- @Override
- public int compare(final Viewer viewer, final Object e1, final Object e2) {
- // do not sort value cases
- if (e1 instanceof FacetOperation) {
- return 0;
- }
- return super.compare(viewer, e1, e2);
- }
- });
-
- featureColumn.setLabelProvider(new FeatureLabelProvider());
- typeColumn.setLabelProvider(new TypeLabelProvider());
- valueColumn.setLabelProvider(new ValueLabelProvider());
-
- this.treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(final SelectionChangedEvent event) {
- // for selection text color
- CustomViewer.this.treeViewer.refresh();
- }
- });
- }
-
- public void setInput(final Object input) {
- this.treeViewer.setInput(input);
- }
-
- protected class CustomViewerContentProvider implements ITreeContentProvider {
- public Object[] getElements(final Object inputElement) {
- final List facetOperations = new ArrayList<FacetOperation>();
- if (inputElement instanceof FacetOperation) {
- final FacetOperation facetOperation = (FacetOperation) inputElement;
- facetOperations.add(facetOperation);
- }
- if (inputElement instanceof FacetElement) {
- final FacetElement facetElement = (FacetElement) inputElement;
- facetOperations.add(facetElement);
- }
- if (inputElement instanceof List) {
- for (Object object : (List) inputElement) {
- if (object instanceof DerivedTypedElement) {
- facetOperations.add(object);
- }
- }
- }
- return facetOperations.toArray();
- }
-
- public Object[] getChildren(final Object parentElement) {
-
- if (parentElement instanceof FacetOperation) {
- final FacetOperation facetOperation = (FacetOperation) parentElement;
- final EList<EParameter> parameters = new BasicEList<EParameter>();
- parameters.addAll(facetOperation.getEParameters());
- return parameters.toArray();
- }
-
- return new Object[0];
- }
-
- public Object getParent(final Object element) {
- if (element instanceof EParameter) {
- final EParameter eParameter = (EParameter) element;
- return eParameter.getEOperation();
- }
- return null;
- }
-
- public boolean hasChildren(final Object element) {
- if (element instanceof FacetOperation) {
- final FacetOperation facetOperation = (FacetOperation) element;
- return !facetOperation.getEParameters().isEmpty();
- }
- return false;
- }
-
- public void dispose() {
- // nothing
- }
-
- public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
- // nothing
- }
- }
-
- protected class FeatureLabelProvider extends ColumnLabelProvider {
-
- @Override
- public String getText(final Object element) {
- if (element instanceof DerivedTypedElement) {
- final DerivedTypedElement facetElement = (DerivedTypedElement) element;
- return facetElement.getName();
- } else if (element instanceof ParameterValue) {
- final ParameterValue parameterValue = (ParameterValue) element;
- return parameterValue.getParameter().getName();
- } else if (element instanceof EParameter) {
- final EParameter parameterValue = (EParameter) element;
- return parameterValue.getName();
- }
- return element.toString();
- }
-
- @Override
- public Font getFont(final Object element) {
- return null;
- }
-
- }
-
- protected class ValueLabelProvider extends ColumnLabelProvider {
-
- /** Images in use */
- private final HashMap<String, Image> images = new HashMap<String, Image>();
-
- public ValueLabelProvider() {
- super();
- }
-
- @Override
- public String getText(final Object element) {
-
- if (element instanceof DerivedTypedElement) {
- DerivedTypedElement derivedTypedElement = (DerivedTypedElement) element;
- Query query = derivedTypedElement.getQuery();
- if (query != null) {
- if (query instanceof StringLiteralQuery) {
- StringLiteralQuery stringQuery = (StringLiteralQuery) query;
- return stringQuery.getValue();
- } else if (query instanceof TrueLiteralQuery) {
- return "true";
- } else if (query instanceof FalseLiteralQuery) {
- return "false";
- } else if (query instanceof NullLiteralQuery) {
- return "null";
- } else if (query instanceof OperationCallQuery) {
- OperationCallQuery operationCallQuery = (OperationCallQuery) query;
- return operationCallQuery.toString();
- } else if (query instanceof JavaQuery) {
- JavaQuery javaQuery = (JavaQuery) query;
- String qualifiedName = javaQuery.getImplementationClassName();
- String[] path = qualifiedName.split("\\.");
- return path[path.length - 1];
- } else if (query instanceof OclQuery) {
- OclQuery oclQuery = (OclQuery) query;
- return oclQuery.getOclExpression();
- } else if (query instanceof NavigationQuery) {
- NavigationQuery navigationQuery = (NavigationQuery) query;
- return navigationQuery.getPath().toString();
- } else if (query instanceof IsOneOfQuery) {
- IsOneOfQuery isOneOfQuery = (IsOneOfQuery) query;
- return isOneOfQuery.getExpectedEObjects().toString();
- } else if (query instanceof IntegerLiteralQuery) {
- IntegerLiteralQuery integerQuery = (IntegerLiteralQuery) query;
- return String.valueOf(integerQuery.getValue());
- } else if (query instanceof FloatLiteralQuery) {
- FloatLiteralQuery floatQuery = (FloatLiteralQuery) query;
- return String.valueOf(floatQuery.getValue());
- } else if (query instanceof EObjectLiteralQuery) {
- EObjectLiteralQuery eObjectQuery = (EObjectLiteralQuery) query;
- return eObjectQuery.getElement().eClass().getName();
- } else if (query instanceof ETypedElementSwitchQuery) {
- ETypedElementSwitchQuery switchQuery = (ETypedElementSwitchQuery) query;
- EList<ETypedElementCase> list = switchQuery.getCases();
- List listResult = new ArrayList<String>();
- for (ETypedElementCase object : list) {
- if (object.getCase() != null) {
- listResult.add(object.getCase().getName());
- }
- }
- return listResult.toString();
- }
- }
- } else if (element instanceof EParameter) {
- EParameter parameterValue = (EParameter) element;
- return "";
- // return parameterValue.getName();
- }
- return "N/A";
- }
-
- @Override
- public Image getImage(final Object element) {
- return null;
- }
-
- @Override
- public void dispose() {
- for (final Image image : this.images.values()) {
- image.dispose();
- }
- super.dispose();
- }
-
- @Override
- public void update(final ViewerCell cell) {
- // for a color static value => display color
- final Object element = cell.getElement();
-
- // gray if not customized
- boolean gray = false;
- if (element instanceof FacetOperation) {
- final FacetOperation customViewFeature = (FacetOperation) element;
- // if (customViewFeature.getDefaultValue() == null) {
- // gray = true;
- // }
- }
-
- // red if unresolved query
- boolean unresolved = false;
- if (element instanceof DerivedTypedElement) {
- final DerivedTypedElement derivedTypedElement = (DerivedTypedElement) element;
- final Query query = derivedTypedElement.getQuery();
- if (query == null || !EMFUtil.tryResolve(query)) {
- unresolved = true;
- }
- }
-
- if (unresolved) {
- final String text = getText(element);
- cell.setText(text);
- cell.setImage(ImageProvider.getInstance().getErrorIcon());
- super.update(cell);
- } else {
- cell.setImage(getImage(element));
- super.update(cell);
- }
- }
- }
-
- protected class TypeLabelProvider extends ColumnLabelProvider {
-
- @Override
- public String getText(final Object element) {
- if (element instanceof DerivedTypedElement) {
- final DerivedTypedElement facetElement = (DerivedTypedElement) element;
- if (facetElement instanceof FacetAttribute || facetElement instanceof FacetReference) {
- return facetElement.getEType().getName();
- } else {
- DerivedTypedElement override = facetElement.getOverride();
- if (override != null) {
- return override.getName();
- } else {
- return ("N/A");
- }
- }
- } else if (element instanceof EParameter) {
- final EParameter eParameter = (EParameter) element;
- return eParameter.getEType().getName();
- }
-
- return element.toString();
- }
-
- @Override
- public Image getImage(Object element) {
- if (element instanceof DerivedTypedElement) {
- final DerivedTypedElement facetElement = (DerivedTypedElement) element;
- if (facetElement instanceof FacetAttribute || facetElement instanceof FacetReference) {
- return ImageProvider.getInstance().getAttributeIcon();
- } else {
- DerivedTypedElement override = facetElement.getOverride();
- if (override != null) {
- String overrideName = override.getName();
- if (CustomViewer.TOP_LEFT_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getTopLeftOverlayIcon();
- } else if (CustomViewer.TOP_MIDDLE_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getTopMiddleOverlayIcon();
- } else if (CustomViewer.TOP_RIGHT_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getTopRightOverlayIcon();
- } else if (CustomViewer.MIDDLE_LEFT_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getMiddleLeftOverlayIcon();
- } else if (CustomViewer.MIDDLE_RIGHT_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getMiddleRightOverlayIcon();
- } else if (CustomViewer.BOTTOM_LEFT_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getBottomLeftOverlayIcon();
- } else if (CustomViewer.BOTTOM_MIDDLE_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getBottomMiddleOverlayIcon();
- } else if (CustomViewer.BOTTOM_RIGHT_OVERLAY_ICON_PATH.equals(overrideName)) {
- return ImageProvider.getInstance().getBottomRightOverlayIcon();
- } else if (CustomViewer.CUSTOMIZATION_LABEL.equals(overrideName)) {
- return ImageProvider.getInstance().getCustomizationLabelIcon();
- } else if (CustomViewer.CUSTOMIZATION_IMAGE.equals(overrideName)) {
- return ImageProvider.getInstance().getCustomizationImageIcon();
- } else if (CustomViewer.CUSTOMIZATION_FOREGROUND.equals(overrideName)) {
- return ImageProvider.getInstance().getCustomizationColorIcon();
- } else if (CustomViewer.CUSTOMIZATION_BACKGROUND.equals(overrideName)) {
- return ImageProvider.getInstance().getCustomizationColorIcon();
- } else if (CustomViewer.FONT_NAME.equals(overrideName)) {
- return ImageProvider.getInstance().getFontNameIcon();
- } else if (CustomViewer.FONT_SIZE.equals(overrideName)) {
- return ImageProvider.getInstance().getFontSizeIcon();
- } else if (CustomViewer.FONT_BOLD.equals(overrideName)) {
- return ImageProvider.getInstance().getIsBoldIcon();
- } else if (CustomViewer.FONT_ITALIC.equals(overrideName)) {
- return ImageProvider.getInstance().getIsItalicIcon();
- } else if (CustomViewer.FONT_UNDERLINE.equals(overrideName)) {
- return ImageProvider.getInstance().getIsUnderlinedIcon();
- } else if (CustomViewer.FONT_STRUKETHROUGH.equals(overrideName)) {
- return ImageProvider.getInstance().getIsStrukethroughIcon();
- }
- }
- }
- }
- return super.getImage(element);
- }
- }
-
- public void refresh() {
- if (!this.treeViewer.getTree().isDisposed()) {
- try {
- this.treeViewer.getTree().setRedraw(false);
- this.treeViewer.refresh();
- } finally {
- this.treeViewer.getTree().setRedraw(true);
- }
- }
- }
-
- public void addSelectionChangedListener(final ISelectionChangedListener selectionChangedListener) {
- this.treeViewer.addSelectionChangedListener(selectionChangedListener);
- }
-
- public ISelection getSelection() {
- return this.treeViewer.getSelection();
- }
-
- public TreeViewer getViewer() {
- return this.treeViewer;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.TreeViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementSwitchQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.DerivedTypedElement;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetAttribute;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetElement;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetOperation;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetReference;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.ParameterValue;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.EObjectLiteralQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.FalseLiteralQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.FloatLiteralQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.IntegerLiteralQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.IsOneOfQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.NavigationQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.NullLiteralQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.OperationCallQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.StringLiteralQuery;
+import org.eclipse.papyrus.emf.facet.efacet.metamodel.v0_2_0.efacet.query.TrueLiteralQuery;
+import org.eclipse.papyrus.emf.facet.query.java.metamodel.v0_2_0.javaquery.JavaQuery;
+import org.eclipse.papyrus.emf.facet.query.ocl.metamodel.oclquery.OclQuery;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Displays the current customizations for a given {@link CustomView}, which is
+ * the input of the viewer
+ */
+public class CustomViewer {
+
+ private static final int VALUE_COLUMN_WIDTH = 200;
+ private static final int TYPE_COLUMN_WIDTH = 200;
+ private static final int FEATURE_COLUMN_WIDTH = 200;
+ private final TreeViewer treeViewer;
+
+ // Customization
+ private static final String TOP_LEFT_OVERLAY_ICON_PATH = "topLeftOverlay";
+ private static final String TOP_MIDDLE_OVERLAY_ICON_PATH = "topMiddleOverlay";
+ private static final String TOP_RIGHT_OVERLAY_ICON_PATH = "topRightOverlay";
+ private static final String MIDDLE_LEFT_OVERLAY_ICON_PATH = "middleLeftOverlay";
+ private static final String MIDDLE_RIGHT_OVERLAY_ICON_PATH = "middleRightOverlay";
+ private static final String BOTTOM_LEFT_OVERLAY_ICON_PATH = "bottomLeftOverlay";
+ private static final String BOTTOM_MIDDLE_OVERLAY_ICON_PATH = "bottomMiddleOverlay";
+ private static final String BOTTOM_RIGHT_OVERLAY_ICON_PATH = "bottomRightOverlay";
+ private static final String CUSTOMIZATION_LABEL = "label";
+ private static final String CUSTOMIZATION_IMAGE = "image";
+ private static final String CUSTOMIZATION_FOREGROUND = "foreground";
+ private static final String CUSTOMIZATION_BACKGROUND = "background";
+ private static final String FONT_NAME = "fontName";
+ private static final String FONT_SIZE = "fontSize";
+ private static final String FONT_BOLD = "isBold";
+ private static final String FONT_ITALIC = "isItalic";
+ private static final String FONT_UNDERLINE = "isUnderlined";
+ private static final String FONT_STRUKETHROUGH = "isStruckthrough";
+
+ public CustomViewer(final Composite parent) {
+ this.treeViewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER
+ | SWT.SINGLE | SWT.FULL_SELECTION);
+ this.treeViewer.getTree().setHeaderVisible(true);
+
+ final TreeViewerColumn featureColumn = new TreeViewerColumn(this.treeViewer, SWT.LEFT);
+ featureColumn.getColumn().setText("feature column");
+ featureColumn.getColumn().setWidth(CustomViewer.FEATURE_COLUMN_WIDTH);
+ final TreeViewerColumn typeColumn = new TreeViewerColumn(this.treeViewer, SWT.LEFT);
+ typeColumn.getColumn().setText("feature type");
+ typeColumn.getColumn().setWidth(CustomViewer.TYPE_COLUMN_WIDTH);
+ final TreeViewerColumn valueColumn = new TreeViewerColumn(this.treeViewer, SWT.LEFT);
+ valueColumn.getColumn().setText("feature value");
+ valueColumn.getColumn().setWidth(CustomViewer.VALUE_COLUMN_WIDTH);
+
+ this.treeViewer.setContentProvider(new CustomViewerContentProvider());
+
+ // for sorting purposes
+ this.treeViewer.setLabelProvider(new FeatureLabelProvider());
+ this.treeViewer.setComparator(new ViewerComparator() {
+ @Override
+ public int compare(final Viewer viewer, final Object e1, final Object e2) {
+ // do not sort value cases
+ if (e1 instanceof FacetOperation) {
+ return 0;
+ }
+ return super.compare(viewer, e1, e2);
+ }
+ });
+
+ featureColumn.setLabelProvider(new FeatureLabelProvider());
+ typeColumn.setLabelProvider(new TypeLabelProvider());
+ valueColumn.setLabelProvider(new ValueLabelProvider());
+
+ this.treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(final SelectionChangedEvent event) {
+ // for selection text color
+ CustomViewer.this.treeViewer.refresh();
+ }
+ });
+ }
+
+ public void setInput(final Object input) {
+ this.treeViewer.setInput(input);
+ }
+
+ protected class CustomViewerContentProvider implements ITreeContentProvider {
+ public Object[] getElements(final Object inputElement) {
+ final List facetOperations = new ArrayList<FacetOperation>();
+ if (inputElement instanceof FacetOperation) {
+ final FacetOperation facetOperation = (FacetOperation) inputElement;
+ facetOperations.add(facetOperation);
+ }
+ if (inputElement instanceof FacetElement) {
+ final FacetElement facetElement = (FacetElement) inputElement;
+ facetOperations.add(facetElement);
+ }
+ if (inputElement instanceof List) {
+ for (Object object : (List) inputElement) {
+ if (object instanceof DerivedTypedElement) {
+ facetOperations.add(object);
+ }
+ }
+ }
+ return facetOperations.toArray();
+ }
+
+ public Object[] getChildren(final Object parentElement) {
+
+ if (parentElement instanceof FacetOperation) {
+ final FacetOperation facetOperation = (FacetOperation) parentElement;
+ final EList<EParameter> parameters = new BasicEList<EParameter>();
+ parameters.addAll(facetOperation.getEParameters());
+ return parameters.toArray();
+ }
+
+ return new Object[0];
+ }
+
+ public Object getParent(final Object element) {
+ if (element instanceof EParameter) {
+ final EParameter eParameter = (EParameter) element;
+ return eParameter.getEOperation();
+ }
+ return null;
+ }
+
+ public boolean hasChildren(final Object element) {
+ if (element instanceof FacetOperation) {
+ final FacetOperation facetOperation = (FacetOperation) element;
+ return !facetOperation.getEParameters().isEmpty();
+ }
+ return false;
+ }
+
+ public void dispose() {
+ // nothing
+ }
+
+ public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
+ // nothing
+ }
+ }
+
+ protected class FeatureLabelProvider extends ColumnLabelProvider {
+
+ @Override
+ public String getText(final Object element) {
+ if (element instanceof DerivedTypedElement) {
+ final DerivedTypedElement facetElement = (DerivedTypedElement) element;
+ return facetElement.getName();
+ } else if (element instanceof ParameterValue) {
+ final ParameterValue parameterValue = (ParameterValue) element;
+ return parameterValue.getParameter().getName();
+ } else if (element instanceof EParameter) {
+ final EParameter parameterValue = (EParameter) element;
+ return parameterValue.getName();
+ }
+ return element.toString();
+ }
+
+ @Override
+ public Font getFont(final Object element) {
+ return null;
+ }
+
+ }
+
+ protected class ValueLabelProvider extends ColumnLabelProvider {
+
+ /** Images in use */
+ private final HashMap<String, Image> images = new HashMap<String, Image>();
+
+ public ValueLabelProvider() {
+ super();
+ }
+
+ @Override
+ public String getText(final Object element) {
+
+ if (element instanceof DerivedTypedElement) {
+ DerivedTypedElement derivedTypedElement = (DerivedTypedElement) element;
+ Query query = derivedTypedElement.getQuery();
+ if (query != null) {
+ if (query instanceof StringLiteralQuery) {
+ StringLiteralQuery stringQuery = (StringLiteralQuery) query;
+ return stringQuery.getValue();
+ } else if (query instanceof TrueLiteralQuery) {
+ return "true";
+ } else if (query instanceof FalseLiteralQuery) {
+ return "false";
+ } else if (query instanceof NullLiteralQuery) {
+ return "null";
+ } else if (query instanceof OperationCallQuery) {
+ OperationCallQuery operationCallQuery = (OperationCallQuery) query;
+ return operationCallQuery.toString();
+ } else if (query instanceof JavaQuery) {
+ JavaQuery javaQuery = (JavaQuery) query;
+ String qualifiedName = javaQuery.getImplementationClassName();
+ String[] path = qualifiedName.split("\\.");
+ return path[path.length - 1];
+ } else if (query instanceof OclQuery) {
+ OclQuery oclQuery = (OclQuery) query;
+ return oclQuery.getOclExpression();
+ } else if (query instanceof NavigationQuery) {
+ NavigationQuery navigationQuery = (NavigationQuery) query;
+ return navigationQuery.getPath().toString();
+ } else if (query instanceof IsOneOfQuery) {
+ IsOneOfQuery isOneOfQuery = (IsOneOfQuery) query;
+ return isOneOfQuery.getExpectedEObjects().toString();
+ } else if (query instanceof IntegerLiteralQuery) {
+ IntegerLiteralQuery integerQuery = (IntegerLiteralQuery) query;
+ return String.valueOf(integerQuery.getValue());
+ } else if (query instanceof FloatLiteralQuery) {
+ FloatLiteralQuery floatQuery = (FloatLiteralQuery) query;
+ return String.valueOf(floatQuery.getValue());
+ } else if (query instanceof EObjectLiteralQuery) {
+ EObjectLiteralQuery eObjectQuery = (EObjectLiteralQuery) query;
+ return eObjectQuery.getElement().eClass().getName();
+ } else if (query instanceof ETypedElementSwitchQuery) {
+ ETypedElementSwitchQuery switchQuery = (ETypedElementSwitchQuery) query;
+ EList<ETypedElementCase> list = switchQuery.getCases();
+ List listResult = new ArrayList<String>();
+ for (ETypedElementCase object : list) {
+ if (object.getCase() != null) {
+ listResult.add(object.getCase().getName());
+ }
+ }
+ return listResult.toString();
+ }
+ }
+ } else if (element instanceof EParameter) {
+ EParameter parameterValue = (EParameter) element;
+ return "";
+ // return parameterValue.getName();
+ }
+ return "N/A";
+ }
+
+ @Override
+ public Image getImage(final Object element) {
+ return null;
+ }
+
+ @Override
+ public void dispose() {
+ for (final Image image : this.images.values()) {
+ image.dispose();
+ }
+ super.dispose();
+ }
+
+ @Override
+ public void update(final ViewerCell cell) {
+ // for a color static value => display color
+ final Object element = cell.getElement();
+
+ // gray if not customized
+ boolean gray = false;
+ if (element instanceof FacetOperation) {
+ final FacetOperation customViewFeature = (FacetOperation) element;
+ // if (customViewFeature.getDefaultValue() == null) {
+ // gray = true;
+ // }
+ }
+
+ // red if unresolved query
+ boolean unresolved = false;
+ if (element instanceof DerivedTypedElement) {
+ final DerivedTypedElement derivedTypedElement = (DerivedTypedElement) element;
+ final Query query = derivedTypedElement.getQuery();
+ if (query == null || !EMFUtil.tryResolve(query)) {
+ unresolved = true;
+ }
+ }
+
+ if (unresolved) {
+ final String text = getText(element);
+ cell.setText(text);
+ cell.setImage(ImageProvider.getInstance().getErrorIcon());
+ super.update(cell);
+ } else {
+ cell.setImage(getImage(element));
+ super.update(cell);
+ }
+ }
+ }
+
+ protected class TypeLabelProvider extends ColumnLabelProvider {
+
+ @Override
+ public String getText(final Object element) {
+ if (element instanceof DerivedTypedElement) {
+ final DerivedTypedElement facetElement = (DerivedTypedElement) element;
+ if (facetElement instanceof FacetAttribute || facetElement instanceof FacetReference) {
+ return facetElement.getEType().getName();
+ } else {
+ DerivedTypedElement override = facetElement.getOverride();
+ if (override != null) {
+ return override.getName();
+ } else {
+ return ("N/A");
+ }
+ }
+ } else if (element instanceof EParameter) {
+ final EParameter eParameter = (EParameter) element;
+ return eParameter.getEType().getName();
+ }
+
+ return element.toString();
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof DerivedTypedElement) {
+ final DerivedTypedElement facetElement = (DerivedTypedElement) element;
+ if (facetElement instanceof FacetAttribute || facetElement instanceof FacetReference) {
+ return ImageProvider.getInstance().getAttributeIcon();
+ } else {
+ DerivedTypedElement override = facetElement.getOverride();
+ if (override != null) {
+ String overrideName = override.getName();
+ if (CustomViewer.TOP_LEFT_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getTopLeftOverlayIcon();
+ } else if (CustomViewer.TOP_MIDDLE_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getTopMiddleOverlayIcon();
+ } else if (CustomViewer.TOP_RIGHT_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getTopRightOverlayIcon();
+ } else if (CustomViewer.MIDDLE_LEFT_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getMiddleLeftOverlayIcon();
+ } else if (CustomViewer.MIDDLE_RIGHT_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getMiddleRightOverlayIcon();
+ } else if (CustomViewer.BOTTOM_LEFT_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getBottomLeftOverlayIcon();
+ } else if (CustomViewer.BOTTOM_MIDDLE_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getBottomMiddleOverlayIcon();
+ } else if (CustomViewer.BOTTOM_RIGHT_OVERLAY_ICON_PATH.equals(overrideName)) {
+ return ImageProvider.getInstance().getBottomRightOverlayIcon();
+ } else if (CustomViewer.CUSTOMIZATION_LABEL.equals(overrideName)) {
+ return ImageProvider.getInstance().getCustomizationLabelIcon();
+ } else if (CustomViewer.CUSTOMIZATION_IMAGE.equals(overrideName)) {
+ return ImageProvider.getInstance().getCustomizationImageIcon();
+ } else if (CustomViewer.CUSTOMIZATION_FOREGROUND.equals(overrideName)) {
+ return ImageProvider.getInstance().getCustomizationColorIcon();
+ } else if (CustomViewer.CUSTOMIZATION_BACKGROUND.equals(overrideName)) {
+ return ImageProvider.getInstance().getCustomizationColorIcon();
+ } else if (CustomViewer.FONT_NAME.equals(overrideName)) {
+ return ImageProvider.getInstance().getFontNameIcon();
+ } else if (CustomViewer.FONT_SIZE.equals(overrideName)) {
+ return ImageProvider.getInstance().getFontSizeIcon();
+ } else if (CustomViewer.FONT_BOLD.equals(overrideName)) {
+ return ImageProvider.getInstance().getIsBoldIcon();
+ } else if (CustomViewer.FONT_ITALIC.equals(overrideName)) {
+ return ImageProvider.getInstance().getIsItalicIcon();
+ } else if (CustomViewer.FONT_UNDERLINE.equals(overrideName)) {
+ return ImageProvider.getInstance().getIsUnderlinedIcon();
+ } else if (CustomViewer.FONT_STRUKETHROUGH.equals(overrideName)) {
+ return ImageProvider.getInstance().getIsStrukethroughIcon();
+ }
+ }
+ }
+ }
+ return super.getImage(element);
+ }
+ }
+
+ public void refresh() {
+ if (!this.treeViewer.getTree().isDisposed()) {
+ try {
+ this.treeViewer.getTree().setRedraw(false);
+ this.treeViewer.refresh();
+ } finally {
+ this.treeViewer.getTree().setRedraw(true);
+ }
+ }
+ }
+
+ public void addSelectionChangedListener(final ISelectionChangedListener selectionChangedListener) {
+ this.treeViewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ public ISelection getSelection() {
+ return this.treeViewer.getSelection();
+ }
+
+ public TreeViewer getViewer() {
+ return this.treeViewer;
+ }
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/EMFUtil.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/EMFUtil.java
index 67516332c13..a193886e46f 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/EMFUtil.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/EMFUtil.java
@@ -1,233 +1,233 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-/** Utility functions related to EMF */
-public class EMFUtil {
-
- /**
- * @return whether the given EObject is in the first resource of its
- * resource set
- */
- public static boolean isInFirstResource(final EObject eObject) {
- final Resource resource = eObject.eResource();
- if (resource == null) {
- return false;
- }
- final ResourceSet resourceSet = resource.getResourceSet();
- if (resourceSet == null) {
- return false;
- }
- final EList<Resource> resources = resourceSet.getResources();
- if (resources.size() > 0) {
- if (resourceSet.getResources().get(0) == resource) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Search for instances of the given EClass
- *
- * @param eClass
- * the EClass of the elements that are looked for
- * @param resource
- * the resource to search in
- * @return elements that are instances of the given EClass
- */
- public Collection<EObject> findInstancesOf(final EClass eClass, final Resource resource) {
- final ArrayList<EObject> instances = new ArrayList<EObject>();
- final TreeIterator<EObject> allContents = resource.getAllContents();
- while (allContents.hasNext()) {
- final EObject eObject = allContents.next();
- if (eObject.eClass() == eClass) {
- instances.add(eObject);
- }
- }
- return instances;
- }
-
- /**
- * Add all the classes in <code>resources</code> to the <code>classes</code> set
- */
- private static void addAll(final Set<EClass> classes, final List<Resource> resources) {
- for (final Resource resource : resources) {
- final TreeIterator<EObject> allContents = resource.getAllContents();
- while (allContents.hasNext()) {
- final EObject eObject = allContents.next();
- if (eObject instanceof EClass) {
- final EClass eClass = (EClass) eObject;
- classes.add(eClass);
- }
- }
- }
- }
-
- /**
- * Find the most specific metaclass that is common to all of the given
- * elements.
- *
- * @return the common metaclass or <code>null</code> if none was found
- */
- public static EClass findCommonClass(final List<EObject> elements) {
- // FIXME this algorithm can make a choice about a branch early and not
- // find
- // a solution, when a solution does exist
- EClass eClass = null;
- for (final EObject element : elements) {
- final EClass elementEClass = element.eClass();
- if (eClass == null) {
- eClass = elementEClass;
- } else {
- if (eClass.isSuperTypeOf(elementEClass)) {
- continue;
- } else if (elementEClass.isSuperTypeOf(eClass)) {
- eClass = elementEClass;
- } else {
- // elements are on two different branches
- // try to find a common metaclass
- eClass = findSuperType(eClass, elementEClass);
- if (eClass == null) {
- return null;
- }
- }
- }
- }
- return eClass;
- }
-
- /**
- * Find the first superclass of <code>eClass</code> that is a superclass of <code>element</code>
- */
- private static EClass findSuperType(final EClass eClass, final EClass element) {
- // do a breadth-first search (with a bottom-up tree)
- final LinkedList<EClass> breadthFirstList = new LinkedList<EClass>();
- breadthFirstList.addFirst(eClass);
-
- while (!breadthFirstList.isEmpty()) {
- final EClass candidateClass = breadthFirstList.poll();
-
- if (candidateClass.isSuperTypeOf(element)) {
- return candidateClass;
- }
-
- // add all the direct super-types of this class
- for (final EClass supertype : candidateClass.getESuperTypes()) {
- breadthFirstList.addLast(supertype);
- }
- }
-
- return null;
- }
-
- /**
- * Try to resolve the given proxy.
- *
- * @return whether the proxy could be resolved
- */
- public static boolean tryResolve(final EObject eObject) {
- final EObject resolved = EcoreUtil.resolve(eObject, (EObject) null);
- return !resolved.eIsProxy();
- }
-
- /** @return the proxy URI for the given EObject or an empty String if none */
- public static String proxyURI(final EObject eObject) {
- final URI eProxyURI = ((InternalEObject) eObject).eProxyURI();
- if (eProxyURI == null) {
- return ""; //$NON-NLS-1$
- }
- return eProxyURI.toString();
- }
-
- public static <T extends ENamedElement> T findElementWithName(final String name,
- final EList<T> elements) {
- for (T element : elements) {
- if (name.equals(element.getName())) {
- return element;
- }
- }
- return null;
- }
-
- /**
- * @return the name of the package in the package registry with this nsURI,
- * or <code>null</code> if not found
- */
- public static String getMetamodelName(final String nsURI) {
- if (nsURI != null) {
- final EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsURI);
- if (ePackage != null) {
- final String name = ePackage.getName();
- if (name != null) {
- return name;
- }
- }
-
- final URI uri = URI.createURI(nsURI);
- final String lastSegment = uri.lastSegment();
- if (lastSegment != null) {
- return lastSegment;
- }
- }
- return null;
- }
-
- /** @return the list of {@link EClass}es found in the following resource */
- public static List<EClass> getMetaclasses(final Resource metamodel) {
- final List<EClass> metaclasses = new ArrayList<EClass>();
- final TreeIterator<EObject> allContents = metamodel.getAllContents();
- while (allContents.hasNext()) {
- final EObject eObject = allContents.next();
- if (eObject instanceof EClass) {
- final EClass eClass = (EClass) eObject;
- metaclasses.add(eClass);
- }
- }
- return metaclasses;
- }
-
- /**
- * Find the {@link EObject} with the given URI in the given {@link ResourceSet}
- *
- * @return the element or <code>null</code> if no element was found with
- * this URI in the given {@link ResourceSet}
- */
- public static EObject findElementByURI(final String uriFragment, final ResourceSet resourceSet) {
- EList<Resource> resources = resourceSet.getResources();
- for (Resource resource : resources) {
- EObject eObject = resource.getEObject(uriFragment);
- if (eObject != null) {
- return eObject;
- }
- }
- return null;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+/** Utility functions related to EMF */
+public class EMFUtil {
+
+ /**
+ * @return whether the given EObject is in the first resource of its
+ * resource set
+ */
+ public static boolean isInFirstResource(final EObject eObject) {
+ final Resource resource = eObject.eResource();
+ if (resource == null) {
+ return false;
+ }
+ final ResourceSet resourceSet = resource.getResourceSet();
+ if (resourceSet == null) {
+ return false;
+ }
+ final EList<Resource> resources = resourceSet.getResources();
+ if (resources.size() > 0) {
+ if (resourceSet.getResources().get(0) == resource) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Search for instances of the given EClass
+ *
+ * @param eClass
+ * the EClass of the elements that are looked for
+ * @param resource
+ * the resource to search in
+ * @return elements that are instances of the given EClass
+ */
+ public Collection<EObject> findInstancesOf(final EClass eClass, final Resource resource) {
+ final ArrayList<EObject> instances = new ArrayList<EObject>();
+ final TreeIterator<EObject> allContents = resource.getAllContents();
+ while (allContents.hasNext()) {
+ final EObject eObject = allContents.next();
+ if (eObject.eClass() == eClass) {
+ instances.add(eObject);
+ }
+ }
+ return instances;
+ }
+
+ /**
+ * Add all the classes in <code>resources</code> to the <code>classes</code> set
+ */
+ private static void addAll(final Set<EClass> classes, final List<Resource> resources) {
+ for (final Resource resource : resources) {
+ final TreeIterator<EObject> allContents = resource.getAllContents();
+ while (allContents.hasNext()) {
+ final EObject eObject = allContents.next();
+ if (eObject instanceof EClass) {
+ final EClass eClass = (EClass) eObject;
+ classes.add(eClass);
+ }
+ }
+ }
+ }
+
+ /**
+ * Find the most specific metaclass that is common to all of the given
+ * elements.
+ *
+ * @return the common metaclass or <code>null</code> if none was found
+ */
+ public static EClass findCommonClass(final List<EObject> elements) {
+ // FIXME this algorithm can make a choice about a branch early and not
+ // find
+ // a solution, when a solution does exist
+ EClass eClass = null;
+ for (final EObject element : elements) {
+ final EClass elementEClass = element.eClass();
+ if (eClass == null) {
+ eClass = elementEClass;
+ } else {
+ if (eClass.isSuperTypeOf(elementEClass)) {
+ continue;
+ } else if (elementEClass.isSuperTypeOf(eClass)) {
+ eClass = elementEClass;
+ } else {
+ // elements are on two different branches
+ // try to find a common metaclass
+ eClass = findSuperType(eClass, elementEClass);
+ if (eClass == null) {
+ return null;
+ }
+ }
+ }
+ }
+ return eClass;
+ }
+
+ /**
+ * Find the first superclass of <code>eClass</code> that is a superclass of <code>element</code>
+ */
+ private static EClass findSuperType(final EClass eClass, final EClass element) {
+ // do a breadth-first search (with a bottom-up tree)
+ final LinkedList<EClass> breadthFirstList = new LinkedList<EClass>();
+ breadthFirstList.addFirst(eClass);
+
+ while (!breadthFirstList.isEmpty()) {
+ final EClass candidateClass = breadthFirstList.poll();
+
+ if (candidateClass.isSuperTypeOf(element)) {
+ return candidateClass;
+ }
+
+ // add all the direct super-types of this class
+ for (final EClass supertype : candidateClass.getESuperTypes()) {
+ breadthFirstList.addLast(supertype);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Try to resolve the given proxy.
+ *
+ * @return whether the proxy could be resolved
+ */
+ public static boolean tryResolve(final EObject eObject) {
+ final EObject resolved = EcoreUtil.resolve(eObject, (EObject) null);
+ return !resolved.eIsProxy();
+ }
+
+ /** @return the proxy URI for the given EObject or an empty String if none */
+ public static String proxyURI(final EObject eObject) {
+ final URI eProxyURI = ((InternalEObject) eObject).eProxyURI();
+ if (eProxyURI == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return eProxyURI.toString();
+ }
+
+ public static <T extends ENamedElement> T findElementWithName(final String name,
+ final EList<T> elements) {
+ for (T element : elements) {
+ if (name.equals(element.getName())) {
+ return element;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return the name of the package in the package registry with this nsURI,
+ * or <code>null</code> if not found
+ */
+ public static String getMetamodelName(final String nsURI) {
+ if (nsURI != null) {
+ final EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(nsURI);
+ if (ePackage != null) {
+ final String name = ePackage.getName();
+ if (name != null) {
+ return name;
+ }
+ }
+
+ final URI uri = URI.createURI(nsURI);
+ final String lastSegment = uri.lastSegment();
+ if (lastSegment != null) {
+ return lastSegment;
+ }
+ }
+ return null;
+ }
+
+ /** @return the list of {@link EClass}es found in the following resource */
+ public static List<EClass> getMetaclasses(final Resource metamodel) {
+ final List<EClass> metaclasses = new ArrayList<EClass>();
+ final TreeIterator<EObject> allContents = metamodel.getAllContents();
+ while (allContents.hasNext()) {
+ final EObject eObject = allContents.next();
+ if (eObject instanceof EClass) {
+ final EClass eClass = (EClass) eObject;
+ metaclasses.add(eClass);
+ }
+ }
+ return metaclasses;
+ }
+
+ /**
+ * Find the {@link EObject} with the given URI in the given {@link ResourceSet}
+ *
+ * @return the element or <code>null</code> if no element was found with
+ * this URI in the given {@link ResourceSet}
+ */
+ public static EObject findElementByURI(final String uriFragment, final ResourceSet resourceSet) {
+ EList<Resource> resources = resourceSet.getResources();
+ for (Resource resource : resources) {
+ EObject eObject = resource.getEObject(uriFragment);
+ if (eObject != null) {
+ return eObject;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/FormStyleSashForm.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/FormStyleSashForm.java
index e00906cfa75..f7b2b6ccdf4 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/FormStyleSashForm.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/FormStyleSashForm.java
@@ -1,143 +1,143 @@
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.papyrus.emf.facet.util.core.Logger;
-import org.eclipse.papyrus.emf.facet.util.core.internal.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.IFormColors;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/** Adapted from {@link org.eclipse.ui.forms.MasterDetailsBlock} */
-public abstract class FormStyleSashForm extends SashForm {
- private final ArrayList<Sash> fSashes = new ArrayList<Sash>();
- private final FormToolkit formToolkit;
- private int minWidth = 0;
-
- private final Listener fListener = new Listener() {
- public void handleEvent(final Event e) {
- switch (e.type) {
- case SWT.MouseEnter:
- e.widget.setData("hover", Boolean.TRUE); //$NON-NLS-1$
- ((Control) e.widget).redraw();
- break;
- case SWT.MouseExit:
- e.widget.setData("hover", null); //$NON-NLS-1$
- ((Control) e.widget).redraw();
- break;
- case SWT.Paint:
- onSashPaint(e);
- break;
- case SWT.Resize:
- hookSashListeners();
- break;
- case SWT.Selection:
- if (e.x < FormStyleSashForm.this.minWidth) {
- e.x = FormStyleSashForm.this.minWidth;
- }
- break;
- default:
- Logger.logWarning("Unhandled event", Activator.getDefault()); //$NON-NLS-1$
- }
- }
- };
-
- public FormStyleSashForm(final Composite parent, final int style, final FormToolkit formToolkit) {
- super(parent, style);
- this.formToolkit = formToolkit;
- formToolkit.adapt(this, false, false);
- createContents();
- hookListeners();
- }
-
- public void setMinWidth(final int minWidth) {
- this.minWidth = minWidth;
- }
-
- protected abstract void createContents();
-
- private void hookListeners() {
- final Listener listener = this.fListener;
- for (final Control child : getChildren()) {
- if (!(child instanceof Sash)) {
- child.addListener(SWT.Resize, listener);
- }
- }
- }
-
- @Override
- public void layout(final boolean changed) {
- super.layout(changed);
- hookSashListeners();
- }
-
- @Override
- public void layout(final Control[] children) {
- super.layout(children);
- hookSashListeners();
- }
-
- void hookSashListeners() {
- purgeSashes();
- try {
- final Sash[] allSashes = getSashes();
- for (final Sash sash : allSashes) {
- if (this.fSashes.contains(sash)) {
- continue;
- }
- sash.addListener(SWT.Paint, this.fListener);
- sash.addListener(SWT.MouseEnter, this.fListener);
- sash.addListener(SWT.MouseExit, this.fListener);
- sash.addListener(SWT.Selection, this.fListener);
- this.fSashes.add(sash);
- }
- } catch (final Exception e) {
- Logger.logError(e, Activator.getDefault());
- }
- }
-
- private Sash[] getSashes() {
- try {
- final Field sashesField = SashForm.class.getDeclaredField("sashes"); //$NON-NLS-1$
- sashesField.setAccessible(true);
- final Sash[] allSashes = (Sash[]) sashesField.get(this);
- return allSashes;
- } catch (final Exception e) {
- Logger.logError(e, Activator.getDefault());
- return new Sash[0];
- }
- }
-
- private void purgeSashes() {
- for (final Iterator<Sash> iter = this.fSashes.iterator(); iter.hasNext();) {
- final Sash sash = iter.next();
- if (sash.isDisposed()) {
- iter.remove();
- }
- }
- }
-
- void onSashPaint(final Event e) {
- final Sash sash = (Sash) e.widget;
- final FormColors colors = this.formToolkit.getColors();
- final GC gc = e.gc;
- final Boolean hover = (Boolean) sash.getData("hover"); //$NON-NLS-1$
- if (hover != null) {
- gc.setBackground(colors.getColor(IFormColors.TB_BG));
- gc.setForeground(colors.getColor(IFormColors.TB_BORDER));
- final Point size = sash.getSize();
- gc.fillRectangle(0, 0, size.x, size.y);
- }
- }
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.papyrus.emf.facet.util.core.Logger;
+import org.eclipse.papyrus.emf.facet.util.core.internal.Activator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/** Adapted from {@link org.eclipse.ui.forms.MasterDetailsBlock} */
+public abstract class FormStyleSashForm extends SashForm {
+ private final ArrayList<Sash> fSashes = new ArrayList<Sash>();
+ private final FormToolkit formToolkit;
+ private int minWidth = 0;
+
+ private final Listener fListener = new Listener() {
+ public void handleEvent(final Event e) {
+ switch (e.type) {
+ case SWT.MouseEnter:
+ e.widget.setData("hover", Boolean.TRUE); //$NON-NLS-1$
+ ((Control) e.widget).redraw();
+ break;
+ case SWT.MouseExit:
+ e.widget.setData("hover", null); //$NON-NLS-1$
+ ((Control) e.widget).redraw();
+ break;
+ case SWT.Paint:
+ onSashPaint(e);
+ break;
+ case SWT.Resize:
+ hookSashListeners();
+ break;
+ case SWT.Selection:
+ if (e.x < FormStyleSashForm.this.minWidth) {
+ e.x = FormStyleSashForm.this.minWidth;
+ }
+ break;
+ default:
+ Logger.logWarning("Unhandled event", Activator.getDefault()); //$NON-NLS-1$
+ }
+ }
+ };
+
+ public FormStyleSashForm(final Composite parent, final int style, final FormToolkit formToolkit) {
+ super(parent, style);
+ this.formToolkit = formToolkit;
+ formToolkit.adapt(this, false, false);
+ createContents();
+ hookListeners();
+ }
+
+ public void setMinWidth(final int minWidth) {
+ this.minWidth = minWidth;
+ }
+
+ protected abstract void createContents();
+
+ private void hookListeners() {
+ final Listener listener = this.fListener;
+ for (final Control child : getChildren()) {
+ if (!(child instanceof Sash)) {
+ child.addListener(SWT.Resize, listener);
+ }
+ }
+ }
+
+ @Override
+ public void layout(final boolean changed) {
+ super.layout(changed);
+ hookSashListeners();
+ }
+
+ @Override
+ public void layout(final Control[] children) {
+ super.layout(children);
+ hookSashListeners();
+ }
+
+ void hookSashListeners() {
+ purgeSashes();
+ try {
+ final Sash[] allSashes = getSashes();
+ for (final Sash sash : allSashes) {
+ if (this.fSashes.contains(sash)) {
+ continue;
+ }
+ sash.addListener(SWT.Paint, this.fListener);
+ sash.addListener(SWT.MouseEnter, this.fListener);
+ sash.addListener(SWT.MouseExit, this.fListener);
+ sash.addListener(SWT.Selection, this.fListener);
+ this.fSashes.add(sash);
+ }
+ } catch (final Exception e) {
+ Logger.logError(e, Activator.getDefault());
+ }
+ }
+
+ private Sash[] getSashes() {
+ try {
+ final Field sashesField = SashForm.class.getDeclaredField("sashes"); //$NON-NLS-1$
+ sashesField.setAccessible(true);
+ final Sash[] allSashes = (Sash[]) sashesField.get(this);
+ return allSashes;
+ } catch (final Exception e) {
+ Logger.logError(e, Activator.getDefault());
+ return new Sash[0];
+ }
+ }
+
+ private void purgeSashes() {
+ for (final Iterator<Sash> iter = this.fSashes.iterator(); iter.hasNext();) {
+ final Sash sash = iter.next();
+ if (sash.isDisposed()) {
+ iter.remove();
+ }
+ }
+ }
+
+ void onSashPaint(final Event e) {
+ final Sash sash = (Sash) e.widget;
+ final FormColors colors = this.formToolkit.getColors();
+ final GC gc = e.gc;
+ final Boolean hover = (Boolean) sash.getData("hover"); //$NON-NLS-1$
+ if (hover != null) {
+ gc.setBackground(colors.getColor(IFormColors.TB_BG));
+ gc.setForeground(colors.getColor(IFormColors.TB_BORDER));
+ final Point size = sash.getSize();
+ gc.fillRectangle(0, 0, size.x, size.y);
+ }
+ }
} \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ImageProvider.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ImageProvider.java
index 50d766a0928..c40b38eb0cb 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ImageProvider.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/ImageProvider.java
@@ -1,770 +1,770 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- * Vincent Lorenzo (CEA-LIST) - bug 341238 - We need to be able to specify which column have to be hidden/visible using the customization mechanism
- *******************************************************************************/
-
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import java.net.URL;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.emf.facet.util.core.Logger;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-/** A singleton image provider, which caches image descriptors */
-public final class ImageProvider {
-
- private ImageProvider() {
- // This class must only be instantiated by getInstance().
- }
-
- private static ImageProvider instance;
-
- public static ImageProvider getInstance() {
- if (ImageProvider.instance == null) {
- ImageProvider.instance = new ImageProvider();
- }
- return ImageProvider.instance;
- }
-
- private Image linkIcon = null;
- private Image linkUniDirIcon = null;
- private Image linkFacetIcon = null;
- private Image aggregIcon = null;
- private Image aggregUniDirIcon = null;
- private Image invAggregIcon = null;
-
- private Image emptyLinksIcon = null;
- // private Image sortInstancesIcon = null;
- private Image sortLinksIcon = null;
- private Image sortLinksByTypeIcon = null;
- // private Image sortNumericallyIcon = null;
- private Image showDerivedLinksIcon = null;
- private Image showFullQualifiedNamesIcon = null;
- private Image showMultiplicityIcon = null;
- private Image showOppositeLinksIcon = null;
-
- private Image rangeIcon = null;
- private Image containerIcon = null;
- // private Image emptyMetaclassesIcon = null;
- private Image packageIcon = null;
- // private Image derivedInstancesIcon = null;
- // private Image derivationTreeIcon = null;
- private Image attributeIcon = null;
- private Image attributeFacetIcon = null;
- private Image emptyAttributeIcon = null;
- private Image orderingIcon = null;
- private Image linkTypeIcon = null;
-
- private Image facetIcon = null;
- private Image viewMenuIcon = null;
-
- private ImageDescriptor increaseFontSizeIcon = null;
- private ImageDescriptor decreaseFontSizeIcon = null;
- private ImageDescriptor restoreFontSizeIcon = null;
-
- private Image hideEmptyColumnsIcon = null;
- private Image commonColumnsIcon = null;
- private Image eClassIcon = null;
- private Image operationIcon = null;
- private Image predicateIcon = null;
- private Image emffacetIcon = null;
- private Image featureIcon = null;
- private Image errorIcon = null;
- private Image queryIcon = null;
- private Image uiCustomIcon = null;
- private Image grayedUiCustomIcon = null;
- private Image uriIcon = null;
-
- private Image shortcutIcon = null;
-
- private Image topLeftOverlay = null;
- private Image topMiddleOverlay = null;
- private Image topRightOverlay = null;
- private Image middleLeftOverlay = null;
- private Image middleRightOverlay = null;
- private Image bottomLeftOverlay = null;
- private Image bottomMiddleOverlay = null;
- private Image bottomRightOverlay = null;
- private Image customizationLabel = null;
- private Image customizationImage = null;
- private Image rgb = null;
- private Image fontName = null;
- private Image fontSize = null;
- private Image isBold = null;
- private Image isItalic = null;
- private Image isUnderlined = null;
- private Image isStruckthrough = null;
-
-
- private static final String LINK_ICON_PATH = "/icons/full/ctool16/link.gif"; //$NON-NLS-1$
- private static final String LINK_UNIDIR_ICON_PATH = "/icons/full/ctool16/link_unidir.gif"; //$NON-NLS-1$
- private static final String LINK_FACET_ICON_PATH = "/icons/full/ctool16/link_unidir_facet.gif"; //$NON-NLS-1$
- private static final String AGGREG_ICON_PATH = "/icons/full/ctool16/aggreg.gif"; //$NON-NLS-1$
- private static final String AGGREG_UNIDIR_ICON_PATH = "/icons/full/ctool16/aggreg_unidir.gif"; //$NON-NLS-1$
- private static final String INV_AGGREG_ICON_PATH = "/icons/full/ctool16/inv_aggreg.gif"; //$NON-NLS-1$
- private static final String EMPTY_LINKS_ICON_PATH = "/icons/full/ctool16/empty_links.gif"; //$NON-NLS-1$
- private static final String SORT_INSTANCES_ICON_PATH = "/icons/full/ctool16/sort.gif"; //$NON-NLS-1$
- private static final String SORT_LINKS_ICON_PATH = "/icons/full/ctool16/sort_links.gif"; //$NON-NLS-1$
- private static final String SORT_LINKS_BY_TYPE_ICON_PATH = "/icons/full/ctool16/sort_links_by_type.gif"; //$NON-NLS-1$
- private static final String SORT_NUMERICALLY_ICON_PATH = "/icons/full/ctool16/sort_num.gif"; //$NON-NLS-1$
- private static final String SHOW_DERIVED_LINKS_ICON_PATH = "/icons/full/ctool16/derived.gif"; //$NON-NLS-1$
- private static final String SHOW_FULL_QUALIFIED_NAMES_ICON_PATH = "/icons/full/ctool16/full_name.gif"; //$NON-NLS-1$
- private static final String RANGE_ICON_PATH = "/icons/full/ctool16/range.gif"; //$NON-NLS-1$
- private static final String SHOW_MULTIPLICITY_ICON_PATH = "/icons/full/ctool16/multiplicity.gif"; //$NON-NLS-1$
- private static final String SHOW_OPPOSITE_LINKS_ICON_PATH = "/icons/full/ctool16/opposite_links.gif"; //$NON-NLS-1$
- private static final String CONTAINER_ICON_PATH = "/icons/full/ctool16/container.gif"; //$NON-NLS-1$
- private static final String EMPTY_METACLASSES_ICON_PATH = "/icons/full/ctool16/zero.gif"; //$NON-NLS-1$
- private static final String PACKAGE_ICON_PATH = "/icons/full/ctool16/package.gif"; //$NON-NLS-1$
- private static final String DERIVED_INSTANCES_ICON_PATH = "/icons/full/ctool16/derived_instances.gif"; //$NON-NLS-1$
- private static final String DERIVATION_TREE_ICON_PATH = "/icons/full/ctool16/derivation_tree.gif"; //$NON-NLS-1$
- private static final String ATTRIBUTE_ICON_PATH = "/icons/full/ctool16/attributes.gif"; //$NON-NLS-1$
- private static final String ATTRIBUTE_FACET_ICON_PATH = "/icons/full/ctool16/attribute_facet.gif"; //$NON-NLS-1$
- private static final String EMPTY_ATTRIBUTE_ICON_PATH = "/icons/full/ctool16/empty_attributes.gif"; //$NON-NLS-1$
- private static final String INCREASE_FONT_SIZE_ICON_PATH = "/icons/full/ctool16/increase_font_size.gif"; //$NON-NLS-1$
- private static final String DECREASE_FONT_SIZE_ICON_PATH = "/icons/full/ctool16/decrease_font_size.gif"; //$NON-NLS-1$
- private static final String RESTORE_FONT_SIZE_ICON_PATH = "/icons/full/ctool16/restore_font_size.gif"; //$NON-NLS-1$
- private static final String HIDE_EMPTY_COLUMNS_ICON_PATH = "/icons/full/ctool16/non-zero.gif"; //$NON-NLS-1$
- private static final String COMMON_COLUMNS_ICON_PATH = "/icons/full/ctool16/common_columns.gif"; //$NON-NLS-1$
- private static final String ORDERING_ICON_PATH = "/icons/full/ctool16/ordering.gif"; //$NON-NLS-1$
- private static final String ECLASS_ICON_PATH = "/icons/full/ctool16/eClass.gif"; //$NON-NLS-1$
- private static final String OPERATION_ICON_PATH = "/icons/full/ctool16/operation.gif"; //$NON-NLS-1$
- private static final String PREDICATE_ICON_PATH = "/icons/full/ctool16/predicate.gif"; //$NON-NLS-1$
- private static final String EMFFACET_ICON_PATH = "icons/logoEmfFacetMini.gif"; //$NON-NLS-1$
- private static final String FEATURE_ICON_PATH = "icons/full/ctool16/feature.gif"; //$NON-NLS-1$
- private static final String ERROR_ICON_PATH = "icons/error.gif"; //$NON-NLS-1$
- private static final String FACET_ICON_PATH = "icons/Facet.gif"; //$NON-NLS-1$
- private static final String ADD_UI_CUSTOM_ICON_PATH = "icons/full/ctool16/addUiCustom.gif"; //$NON-NLS-1$
- private static final String VIEW_MENU_ICON_PATH = "icons/full/ctool16/view_menu.gif"; //$NON-NLS-1$
- private static final String LINK_TYPE_ICON_PATH = "icons/full/ctool16/link_type.gif"; //$NON-NLS-1$
- private static final String QUERY_ICON_PATH = "icons/query.png"; //$NON-NLS-1$
- private static final String ELEMENT_IDS_ICON_PATH = "/icons/full/ctool16/element_id.gif"; //$NON-NLS-1$
- private static final String URI_ICON_PATH = "/icons/full/ctool16/uri.gif"; //$NON-NLS-1$
- private static final String COLLAPSE_ALL_ICON_PATH = "/icons/full/ctool16/collapseall.gif"; //$NON-NLS-1$
- private static final String SHORTCUT_ICON_PATH = "/icons/shortcut.png"; //$NON-NLS-1$
-
- // Customization
- private static final String TOP_LEFT_OVERLAY_ICON_PATH = "/icons/full/ctool16/topLeftOverlay.png";
- private static final String TOP_MIDDLE_OVERLAY_ICON_PATH = "/icons/full/ctool16/topMiddleOverlay.png";
- private static final String TOP_RIGHT_OVERLAY_ICON_PATH = "/icons/full/ctool16/topRightOverlay.png";
- private static final String MIDDLE_LEFT_OVERLAY_ICON_PATH = "/icons/full/ctool16/middleLeftOverlay.png";
- private static final String MIDDLE_RIGHT_OVERLAY_ICON_PATH = "/icons/full/ctool16/middleRightOverlay.png";
- private static final String BOTTOM_LEFT_OVERLAY_ICON_PATH = "/icons/full/ctool16/bottomLeftOverlay.png";
- private static final String BOTTOM_MIDDLE_OVERLAY_ICON_PATH = "/icons/full/ctool16/bottomMiddleOverlay.png";
- private static final String BOTTOM_RIGHT_OVERLAY_ICON_PATH = "/icons/full/ctool16/bottomRightOverlay.png";
- private static final String LABEL_CUSTOMIZATION = "/icons/full/ctool16/customizationLabel.png";
- private static final String IMAGE_CUSTOMIZATION = "/icons/full/ctool16/imageCustomization.png";
- private static final String RGB_CUSTOMIZATION = "/icons/full/ctool16/rgb.png";
- private static final String FONT_NAME = "/icons/full/ctool16/fontName.png"; //$NON-NLS-1$
- private static final String FONT_SIZE = "/icons/full/ctool16/fontSize.png"; //$NON-NLS-1$
- private static final String IS_BOLD = "/icons/full/ctool16/fontBold.png"; //$NON-NLS-1$
- private static final String IS_ITALIC = "/icons/full/ctool16/fontItalic.bmp"; //$NON-NLS-1$
- private static final String IS_UNDERLINED = "/icons/full/ctool16/fontUnderline.bmp"; //$NON-NLS-1$
- private static final String IS_STRUCKTHROUGH = "/icons/full/ctool16/fontStrukethrough.bmp"; //$NON-NLS-1$
-
- /**
- * Create an image descriptor from a resource
- *
- * @param resourcePath
- * the path of the resource (in the bundle)
- * @return the image descriptor
- */
- private ImageDescriptor createImageDescriptor(final String resourcePath) {
- final URL url = Activator.getDefault().getBundle().getResource(resourcePath);
- if (url == null) {
- Logger.logError(NLS.bind("Resource not found: {0}", //$NON-NLS-1$
- resourcePath), Activator.getDefault());
- return ImageDescriptor.getMissingImageDescriptor();
- }
- return ImageDescriptor.createFromURL(url);
- }
-
- /** Return the icon representing a bidirectional link */
- public Image getLinkIcon() {
- if (this.linkIcon == null) {
- this.linkIcon = createImageDescriptor(ImageProvider.LINK_ICON_PATH).createImage();
- }
- return this.linkIcon;
- }
-
- /** Return the icon representing an unidirectional link */
- public Image getUnidirectionalLinkIcon() {
- if (this.linkUniDirIcon == null) {
- this.linkUniDirIcon = createImageDescriptor(ImageProvider.LINK_UNIDIR_ICON_PATH)
- .createImage();
- }
- return this.linkUniDirIcon;
- }
-
- /** Return the icon representing a facet reference */
- public Image getFacetLinkIcon() {
- if (this.linkFacetIcon == null) {
- this.linkFacetIcon = createImageDescriptor(ImageProvider.LINK_FACET_ICON_PATH)
- .createImage();
- }
- return this.linkFacetIcon;
- }
-
- /** Return the icon representing a composition link */
- public Image getAggregIcon() {
- if (this.aggregIcon == null) {
- this.aggregIcon = createImageDescriptor(ImageProvider.AGGREG_ICON_PATH).createImage();
- }
- return this.aggregIcon;
- }
-
- /** Return the icon representing an unidirectional composition link */
- public Image getUnidirectionalAggregIcon() {
- if (this.aggregUniDirIcon == null) {
- this.aggregUniDirIcon = createImageDescriptor(ImageProvider.AGGREG_UNIDIR_ICON_PATH)
- .createImage();
- }
- return this.aggregUniDirIcon;
- }
-
- /** Return the icon representing a reverse composition link */
- public Image getInvAggregIcon() {
- if (this.invAggregIcon == null) {
- this.invAggregIcon = createImageDescriptor(ImageProvider.INV_AGGREG_ICON_PATH)
- .createImage();
- }
- return this.invAggregIcon;
- }
-
- /** Return the icon representing empty links */
- public Image getEmptyLinksIcon() {
- if (this.emptyLinksIcon == null) {
- this.emptyLinksIcon = createImageDescriptor(ImageProvider.EMPTY_LINKS_ICON_PATH)
- .createImage();
- }
- return this.emptyLinksIcon;
- }
-
- /** Return the icon representing empty links */
- public ImageDescriptor getEmptyLinksImageDescriptor() {
- return createImageDescriptor(ImageProvider.EMPTY_LINKS_ICON_PATH);
- }
-
- /** Return the icon representing sorting of instances */
- public ImageDescriptor getSortInstancesIcon() {
- return createImageDescriptor(ImageProvider.SORT_INSTANCES_ICON_PATH);
- }
-
- /** Return the icon representing sorting of links */
- public Image getSortLinksIcon() {
- if (this.sortLinksIcon == null) {
- this.sortLinksIcon = createImageDescriptor(ImageProvider.SORT_LINKS_ICON_PATH)
- .createImage();
- }
- return this.sortLinksIcon;
- }
-
- /** Return the icon representing sorting of links */
- public ImageDescriptor getSortLinksImageDescriptor() {
- return createImageDescriptor(ImageProvider.SORT_LINKS_ICON_PATH);
- }
-
- /** Return the icon representing sorting of links by type */
- public Image getSortLinksByTypeIcon() {
- if (this.sortLinksByTypeIcon == null) {
- this.sortLinksByTypeIcon = createImageDescriptor(
- ImageProvider.SORT_LINKS_BY_TYPE_ICON_PATH).createImage();
- }
- return this.sortLinksByTypeIcon;
- }
-
- /** Return the icon representing sorting of links by type */
- public ImageDescriptor getSortLinksByTypeImageDescriptor() {
- return createImageDescriptor(ImageProvider.SORT_LINKS_BY_TYPE_ICON_PATH);
- }
-
- /** Return the icon representing sorting numerically */
- public ImageDescriptor getSortNumericallyIcon() {
- return createImageDescriptor(ImageProvider.SORT_NUMERICALLY_ICON_PATH);
- }
-
- /** Return the icon representing derived links */
- public Image getShowDerivedLinksIcon() {
- if (this.showDerivedLinksIcon == null) {
- this.showDerivedLinksIcon = createImageDescriptor(
- ImageProvider.SHOW_DERIVED_LINKS_ICON_PATH).createImage();
- }
- return this.showDerivedLinksIcon;
- }
-
- /** Return the icon representing derived links */
- public ImageDescriptor getShowDerivedLinksImageDescriptor() {
- return createImageDescriptor(ImageProvider.SHOW_DERIVED_LINKS_ICON_PATH);
- }
-
- /** Return the icon representing full qualified names */
- public Image getShowFullQualifiedNamesIcon() {
- if (this.showFullQualifiedNamesIcon == null) {
- this.showFullQualifiedNamesIcon = createImageDescriptor(
- ImageProvider.SHOW_FULL_QUALIFIED_NAMES_ICON_PATH).createImage();
- }
- return this.showFullQualifiedNamesIcon;
- }
-
- /** Return the icon representing full qualified names */
- public ImageDescriptor getShowFullQualifiedNamesImageDescriptor() {
- return createImageDescriptor(ImageProvider.SHOW_FULL_QUALIFIED_NAMES_ICON_PATH);
- }
-
- /** Return the icon representing a range */
- public Image getRangeIcon() {
- if (this.rangeIcon == null) {
- this.rangeIcon = createImageDescriptor(ImageProvider.RANGE_ICON_PATH).createImage();
- }
- return this.rangeIcon;
- }
-
- /** Return the multiplicity icon */
- public Image getShowMultiplicityIcon() {
- if (this.showMultiplicityIcon == null) {
- this.showMultiplicityIcon = createImageDescriptor(
- ImageProvider.SHOW_MULTIPLICITY_ICON_PATH).createImage();
- }
- return this.showMultiplicityIcon;
- }
-
- /** Return the multiplicity icon */
- public ImageDescriptor getShowMultiplicityImageDescriptor() {
- return createImageDescriptor(ImageProvider.SHOW_MULTIPLICITY_ICON_PATH);
- }
-
- /** Return the "opposite links" icon */
- public Image getShowOppositeLinksIcon() {
- if (this.showOppositeLinksIcon == null) {
- this.showOppositeLinksIcon = createImageDescriptor(
- ImageProvider.SHOW_OPPOSITE_LINKS_ICON_PATH).createImage();
- }
- return this.showOppositeLinksIcon;
- }
-
- /** Return the "opposite links" icon */
- public ImageDescriptor getShowOppositeLinksImageDescriptor() {
- return createImageDescriptor(ImageProvider.SHOW_OPPOSITE_LINKS_ICON_PATH);
- }
-
- /** Return the "container" icon */
- public Image getContainerIcon() {
- if (this.containerIcon == null) {
- this.containerIcon = createImageDescriptor(ImageProvider.CONTAINER_ICON_PATH)
- .createImage();
- }
- return this.containerIcon;
- }
-
- /** Return the "container" icon */
- public ImageDescriptor getContainerImageDescriptor() {
- return createImageDescriptor(ImageProvider.CONTAINER_ICON_PATH);
- }
-
- /** Return the "show empty metaclasses" icon */
- public ImageDescriptor getShowEmptyMetaclassesIcon() {
- return createImageDescriptor(ImageProvider.EMPTY_METACLASSES_ICON_PATH);
- }
-
- /** Return the "package" icon */
- public Image getPackageIcon() {
- if (this.packageIcon == null) {
- this.packageIcon = createImageDescriptor(ImageProvider.PACKAGE_ICON_PATH).createImage();
- }
- return this.packageIcon;
- }
-
- /** Return the "package" icon */
- public ImageDescriptor getPackageImageDescriptor() {
- return createImageDescriptor(ImageProvider.PACKAGE_ICON_PATH);
- }
-
- // /** Return the "derived instances" icon */
- // public Image getDerivedInstancesIcon() {
- // if (this.derivedInstancesIcon == null) {
- // this.derivedInstancesIcon = createImageDescriptor(
- // ImageProvider.DERIVED_INSTANCES_ICON_PATH).createImage();
- // }
- // return this.derivedInstancesIcon;
- // }
-
- /** Return the "derived instances" icon */
- public ImageDescriptor getDerivedInstancesImageDescriptor() {
- return createImageDescriptor(ImageProvider.DERIVED_INSTANCES_ICON_PATH);
- }
-
- /** Return the "derivation tree" icon */
- public ImageDescriptor getDerivationTreeIcon() {
- return createImageDescriptor(ImageProvider.DERIVATION_TREE_ICON_PATH);
- }
-
- /** Return the "attribute" icon */
- public Image getAttributeIcon() {
- if (this.attributeIcon == null) {
- this.attributeIcon = createImageDescriptor(ImageProvider.ATTRIBUTE_ICON_PATH)
- .createImage();
- }
- return this.attributeIcon;
- }
-
- /** Return the "attribute" icon */
- public ImageDescriptor getAttributeImageDescriptor() {
- return createImageDescriptor(ImageProvider.ATTRIBUTE_ICON_PATH);
- }
-
- /** Return the "facet attribute" icon */
- public Image getFacetAttributeIcon() {
- if (this.attributeFacetIcon == null) {
- this.attributeFacetIcon = createImageDescriptor(ImageProvider.ATTRIBUTE_FACET_ICON_PATH)
- .createImage();
- }
- return this.attributeFacetIcon;
- }
-
- /** Return the "empty attributes" icon */
- public Image getEmptyAttributeIcon() {
- if (this.emptyAttributeIcon == null) {
- this.emptyAttributeIcon = createImageDescriptor(ImageProvider.EMPTY_ATTRIBUTE_ICON_PATH)
- .createImage();
- }
- return this.emptyAttributeIcon;
- }
-
- /** Return the "empty attributes" icon */
- public ImageDescriptor getEmptyAttributeImageDescriptor() {
- return createImageDescriptor(ImageProvider.EMPTY_ATTRIBUTE_ICON_PATH);
- }
-
- /** Return the "increase font size" icon */
- public ImageDescriptor getIncreaseFontSizeIcon() {
- if (this.increaseFontSizeIcon == null) {
- this.increaseFontSizeIcon = createImageDescriptor(ImageProvider.INCREASE_FONT_SIZE_ICON_PATH);
- }
- return this.increaseFontSizeIcon;
- }
-
- /** Return the "decrease font size" icon */
- public ImageDescriptor getDecreaseFontSizeIcon() {
- if (this.decreaseFontSizeIcon == null) {
- this.decreaseFontSizeIcon = createImageDescriptor(ImageProvider.DECREASE_FONT_SIZE_ICON_PATH);
- }
- return this.decreaseFontSizeIcon;
- }
-
- /** Return the "restore font size" icon */
- public ImageDescriptor getRestoreFontSizeIcon() {
- if (this.restoreFontSizeIcon == null) {
- this.restoreFontSizeIcon = createImageDescriptor(ImageProvider.RESTORE_FONT_SIZE_ICON_PATH);
- }
- return this.restoreFontSizeIcon;
- }
-
- /** Return the "hide empty columns" icon */
- public Image getHideEmptyColumnsIcon() {
- if (this.hideEmptyColumnsIcon == null) {
- this.hideEmptyColumnsIcon = createImageDescriptor(
- ImageProvider.HIDE_EMPTY_COLUMNS_ICON_PATH).createImage();
- }
- return this.hideEmptyColumnsIcon;
- }
-
- /** Return the "common columns" icon */
- public Image getCommonColumnsIcon() {
- if (this.commonColumnsIcon == null) {
- this.commonColumnsIcon = createImageDescriptor(ImageProvider.COMMON_COLUMNS_ICON_PATH)
- .createImage();
- }
- return this.commonColumnsIcon;
- }
-
- /** Return the "ordering" icon */
- public Image getOrderingIcon() {
- if (this.orderingIcon == null) {
- this.orderingIcon = createImageDescriptor(ImageProvider.ORDERING_ICON_PATH)
- .createImage();
- }
- return this.orderingIcon;
- }
-
- /** Return the "ordering" icon */
- public ImageDescriptor getOrderingImageDescriptor() {
- return createImageDescriptor(ImageProvider.ORDERING_ICON_PATH);
- }
-
- /** Return the "eClass" icon */
- public Image getEClassIcon() {
- if (this.eClassIcon == null) {
- this.eClassIcon = createImageDescriptor(ImageProvider.ECLASS_ICON_PATH).createImage();
- }
- return this.eClassIcon;
- }
-
- /** Return the "operation" icon */
- public Image getOperationIcon() {
- if (this.operationIcon == null) {
- this.operationIcon = createImageDescriptor(ImageProvider.OPERATION_ICON_PATH)
- .createImage();
- }
- return this.operationIcon;
- }
-
- /** Return the "predicate" icon */
- public Image getPredicateIcon() {
- if (this.predicateIcon == null) {
- this.predicateIcon = createImageDescriptor(ImageProvider.PREDICATE_ICON_PATH)
- .createImage();
- }
- return this.predicateIcon;
- }
-
- /** Return the "EmfFacet" icon */
- public Image getEmfFacetIcon() {
- if (this.emffacetIcon == null) {
- this.emffacetIcon = createImageDescriptor(ImageProvider.EMFFACET_ICON_PATH).createImage();
- }
- return this.emffacetIcon;
- }
-
- /** Return an icon representing the concept of "feature" */
- public Image getFeatureIcon() {
- if (this.featureIcon == null) {
- this.featureIcon = createImageDescriptor(ImageProvider.FEATURE_ICON_PATH).createImage();
- }
- return this.featureIcon;
- }
-
- /** Return an icon descriptor representing the concept of "feature" */
- public ImageDescriptor getFeatureIconDescriptor() {
- return createImageDescriptor(ImageProvider.FEATURE_ICON_PATH);
- }
-
- /** Return an icon descriptor representing the concept of "facet" */
- public ImageDescriptor getFacetIconDescriptor() {
- return createImageDescriptor(ImageProvider.FACET_ICON_PATH);
- }
-
- /** Return an icon descriptor representing the concept of "facet" */
- public Image getFacetIcon() {
- if (this.facetIcon == null) {
- this.facetIcon = createImageDescriptor(ImageProvider.FACET_ICON_PATH).createImage();
- }
- return this.facetIcon;
- }
-
- /** Return an icon descriptor for "uiCustom" */
- public ImageDescriptor getAddUiCustomIconDescriptor() {
- return createImageDescriptor(ImageProvider.ADD_UI_CUSTOM_ICON_PATH);
- }
-
- /** Return an icon for "uiCustom" */
- public Image getUiCustomIcon() {
- if (this.uiCustomIcon == null) {
- this.uiCustomIcon = createImageDescriptor(ImageProvider.ADD_UI_CUSTOM_ICON_PATH)
- .createImage();
- }
- return this.uiCustomIcon;
- }
-
- /** Return the grayed image for "uiCustom */
- public Image getGrayedUiCustomIcon() {
- if (this.grayedUiCustomIcon == null) {
- this.grayedUiCustomIcon = new Image(Display.getCurrent(), getUiCustomIcon(), SWT.IMAGE_GRAY);
- }
- return this.grayedUiCustomIcon;
- }
-
- /** Return the "error" icon */
- public Image getErrorIcon() {
- if (this.errorIcon == null) {
- this.errorIcon = createImageDescriptor(ImageProvider.ERROR_ICON_PATH).createImage();
- }
- return this.errorIcon;
- }
-
- /** Return the toolbar menu icon */
- public Image getViewMenuIcon() {
- if (this.viewMenuIcon == null) {
- this.viewMenuIcon = createImageDescriptor(ImageProvider.VIEW_MENU_ICON_PATH)
- .createImage();
- }
- return this.viewMenuIcon;
- }
-
- /** Return the query menu icon */
- public Image getQueryIcon() {
- if (this.queryIcon == null) {
- this.queryIcon = createImageDescriptor(ImageProvider.QUERY_ICON_PATH).createImage();
- }
- return this.queryIcon;
- }
-
- /** Return the link type icon */
- public Image getLinkTypeIcon() {
- if (this.linkTypeIcon == null) {
- this.linkTypeIcon = createImageDescriptor(ImageProvider.LINK_TYPE_ICON_PATH)
- .createImage();
- }
- return this.linkTypeIcon;
- }
-
- /** Return the link type icon descriptor */
- public ImageDescriptor getLinkTypeIconDescriptor() {
- return createImageDescriptor(ImageProvider.LINK_TYPE_ICON_PATH);
- }
-
- /** Return the "element ID" icon descriptor */
- public ImageDescriptor getShowElementIDsDescriptor() {
- return createImageDescriptor(ImageProvider.ELEMENT_IDS_ICON_PATH);
- }
-
- public ImageDescriptor getShowURIDescriptor() {
- return createImageDescriptor(ImageProvider.URI_ICON_PATH);
- }
-
- public Image getURIIcon() {
- if (this.uriIcon == null) {
- this.uriIcon = createImageDescriptor(ImageProvider.URI_ICON_PATH).createImage();
- }
- return this.uriIcon;
- }
-
- public ImageDescriptor getCollapseAllDescriptor() {
- return createImageDescriptor(ImageProvider.COLLAPSE_ALL_ICON_PATH);
- }
-
- public Image getShortcutIcon() {
- if (this.shortcutIcon == null) {
- this.shortcutIcon = createImageDescriptor(ImageProvider.SHORTCUT_ICON_PATH).createImage();
- }
- return this.shortcutIcon;
- }
-
- public Image getTopLeftOverlayIcon() {
- if (this.topLeftOverlay == null) {
- this.topLeftOverlay = createImageDescriptor(ImageProvider.TOP_LEFT_OVERLAY_ICON_PATH).createImage();
- }
- return this.topLeftOverlay;
- }
-
- public Image getTopMiddleOverlayIcon() {
- if (this.topMiddleOverlay == null) {
- this.topMiddleOverlay = createImageDescriptor(ImageProvider.TOP_MIDDLE_OVERLAY_ICON_PATH).createImage();
- }
- return this.topMiddleOverlay;
- }
-
- public Image getTopRightOverlayIcon() {
- if (this.topRightOverlay == null) {
- this.topRightOverlay = createImageDescriptor(ImageProvider.TOP_RIGHT_OVERLAY_ICON_PATH).createImage();
- }
- return this.topRightOverlay;
- }
-
- public Image getMiddleLeftOverlayIcon() {
- if (this.middleLeftOverlay == null) {
- this.middleLeftOverlay = createImageDescriptor(ImageProvider.MIDDLE_LEFT_OVERLAY_ICON_PATH).createImage();
- }
- return this.middleLeftOverlay;
- }
-
- public Image getMiddleRightOverlayIcon() {
- if (this.middleRightOverlay == null) {
- this.middleRightOverlay = createImageDescriptor(ImageProvider.MIDDLE_RIGHT_OVERLAY_ICON_PATH).createImage();
- }
- return this.middleRightOverlay;
- }
-
- public Image getBottomLeftOverlayIcon() {
- if (this.bottomLeftOverlay == null) {
- this.bottomLeftOverlay = createImageDescriptor(ImageProvider.BOTTOM_LEFT_OVERLAY_ICON_PATH).createImage();
- }
- return this.bottomLeftOverlay;
- }
-
- public Image getBottomMiddleOverlayIcon() {
- if (this.bottomMiddleOverlay == null) {
- this.bottomMiddleOverlay = createImageDescriptor(ImageProvider.BOTTOM_MIDDLE_OVERLAY_ICON_PATH).createImage();
- }
- return this.bottomMiddleOverlay;
- }
-
- public Image getBottomRightOverlayIcon() {
- if (this.bottomRightOverlay == null) {
- this.bottomRightOverlay = createImageDescriptor(ImageProvider.BOTTOM_RIGHT_OVERLAY_ICON_PATH).createImage();
- }
- return this.bottomRightOverlay;
- }
-
- public Image getCustomizationLabelIcon() {
- if (this.customizationLabel == null) {
- this.customizationLabel = createImageDescriptor(ImageProvider.LABEL_CUSTOMIZATION).createImage();
- }
- return this.customizationLabel;
- }
-
- public Image getCustomizationImageIcon() {
- if (this.customizationImage == null) {
- this.customizationImage = createImageDescriptor(ImageProvider.IMAGE_CUSTOMIZATION).createImage();
- }
- return this.customizationImage;
- }
-
- public Image getCustomizationColorIcon() {
- if (this.rgb == null) {
- this.rgb = createImageDescriptor(ImageProvider.RGB_CUSTOMIZATION).createImage();
- }
- return this.rgb;
- }
-
- public Image getFontNameIcon() {
- if (this.fontName == null) {
- this.fontName = createImageDescriptor(ImageProvider.FONT_NAME).createImage();
- }
- return this.fontName;
- }
-
- public Image getFontSizeIcon() {
- if (this.fontSize == null) {
- this.fontSize = createImageDescriptor(ImageProvider.FONT_SIZE).createImage();
- }
- return this.fontSize;
- }
-
- public Image getIsBoldIcon() {
- if (this.isBold == null) {
- this.isBold = createImageDescriptor(ImageProvider.IS_BOLD).createImage();
- }
- return this.isBold;
- }
-
- public Image getIsItalicIcon() {
- if (this.isItalic == null) {
- this.isItalic = createImageDescriptor(ImageProvider.IS_ITALIC).createImage();
- }
- return this.isItalic;
- }
-
- public Image getIsUnderlinedIcon() {
- if (this.isUnderlined == null) {
- this.isUnderlined = createImageDescriptor(ImageProvider.IS_UNDERLINED).createImage();
- }
- return this.isUnderlined;
- }
-
- public Image getIsStrukethroughIcon() {
- if (this.isStruckthrough == null) {
- this.isStruckthrough = createImageDescriptor(ImageProvider.IS_STRUCKTHROUGH).createImage();
- }
- return this.isStruckthrough;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ * Vincent Lorenzo (CEA-LIST) - bug 341238 - We need to be able to specify which column have to be hidden/visible using the customization mechanism
+ *******************************************************************************/
+
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import java.net.URL;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.emf.facet.util.core.Logger;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+/** A singleton image provider, which caches image descriptors */
+public final class ImageProvider {
+
+ private ImageProvider() {
+ // This class must only be instantiated by getInstance().
+ }
+
+ private static ImageProvider instance;
+
+ public static ImageProvider getInstance() {
+ if (ImageProvider.instance == null) {
+ ImageProvider.instance = new ImageProvider();
+ }
+ return ImageProvider.instance;
+ }
+
+ private Image linkIcon = null;
+ private Image linkUniDirIcon = null;
+ private Image linkFacetIcon = null;
+ private Image aggregIcon = null;
+ private Image aggregUniDirIcon = null;
+ private Image invAggregIcon = null;
+
+ private Image emptyLinksIcon = null;
+ // private Image sortInstancesIcon = null;
+ private Image sortLinksIcon = null;
+ private Image sortLinksByTypeIcon = null;
+ // private Image sortNumericallyIcon = null;
+ private Image showDerivedLinksIcon = null;
+ private Image showFullQualifiedNamesIcon = null;
+ private Image showMultiplicityIcon = null;
+ private Image showOppositeLinksIcon = null;
+
+ private Image rangeIcon = null;
+ private Image containerIcon = null;
+ // private Image emptyMetaclassesIcon = null;
+ private Image packageIcon = null;
+ // private Image derivedInstancesIcon = null;
+ // private Image derivationTreeIcon = null;
+ private Image attributeIcon = null;
+ private Image attributeFacetIcon = null;
+ private Image emptyAttributeIcon = null;
+ private Image orderingIcon = null;
+ private Image linkTypeIcon = null;
+
+ private Image facetIcon = null;
+ private Image viewMenuIcon = null;
+
+ private ImageDescriptor increaseFontSizeIcon = null;
+ private ImageDescriptor decreaseFontSizeIcon = null;
+ private ImageDescriptor restoreFontSizeIcon = null;
+
+ private Image hideEmptyColumnsIcon = null;
+ private Image commonColumnsIcon = null;
+ private Image eClassIcon = null;
+ private Image operationIcon = null;
+ private Image predicateIcon = null;
+ private Image emffacetIcon = null;
+ private Image featureIcon = null;
+ private Image errorIcon = null;
+ private Image queryIcon = null;
+ private Image uiCustomIcon = null;
+ private Image grayedUiCustomIcon = null;
+ private Image uriIcon = null;
+
+ private Image shortcutIcon = null;
+
+ private Image topLeftOverlay = null;
+ private Image topMiddleOverlay = null;
+ private Image topRightOverlay = null;
+ private Image middleLeftOverlay = null;
+ private Image middleRightOverlay = null;
+ private Image bottomLeftOverlay = null;
+ private Image bottomMiddleOverlay = null;
+ private Image bottomRightOverlay = null;
+ private Image customizationLabel = null;
+ private Image customizationImage = null;
+ private Image rgb = null;
+ private Image fontName = null;
+ private Image fontSize = null;
+ private Image isBold = null;
+ private Image isItalic = null;
+ private Image isUnderlined = null;
+ private Image isStruckthrough = null;
+
+
+ private static final String LINK_ICON_PATH = "/icons/full/ctool16/link.gif"; //$NON-NLS-1$
+ private static final String LINK_UNIDIR_ICON_PATH = "/icons/full/ctool16/link_unidir.gif"; //$NON-NLS-1$
+ private static final String LINK_FACET_ICON_PATH = "/icons/full/ctool16/link_unidir_facet.gif"; //$NON-NLS-1$
+ private static final String AGGREG_ICON_PATH = "/icons/full/ctool16/aggreg.gif"; //$NON-NLS-1$
+ private static final String AGGREG_UNIDIR_ICON_PATH = "/icons/full/ctool16/aggreg_unidir.gif"; //$NON-NLS-1$
+ private static final String INV_AGGREG_ICON_PATH = "/icons/full/ctool16/inv_aggreg.gif"; //$NON-NLS-1$
+ private static final String EMPTY_LINKS_ICON_PATH = "/icons/full/ctool16/empty_links.gif"; //$NON-NLS-1$
+ private static final String SORT_INSTANCES_ICON_PATH = "/icons/full/ctool16/sort.gif"; //$NON-NLS-1$
+ private static final String SORT_LINKS_ICON_PATH = "/icons/full/ctool16/sort_links.gif"; //$NON-NLS-1$
+ private static final String SORT_LINKS_BY_TYPE_ICON_PATH = "/icons/full/ctool16/sort_links_by_type.gif"; //$NON-NLS-1$
+ private static final String SORT_NUMERICALLY_ICON_PATH = "/icons/full/ctool16/sort_num.gif"; //$NON-NLS-1$
+ private static final String SHOW_DERIVED_LINKS_ICON_PATH = "/icons/full/ctool16/derived.gif"; //$NON-NLS-1$
+ private static final String SHOW_FULL_QUALIFIED_NAMES_ICON_PATH = "/icons/full/ctool16/full_name.gif"; //$NON-NLS-1$
+ private static final String RANGE_ICON_PATH = "/icons/full/ctool16/range.gif"; //$NON-NLS-1$
+ private static final String SHOW_MULTIPLICITY_ICON_PATH = "/icons/full/ctool16/multiplicity.gif"; //$NON-NLS-1$
+ private static final String SHOW_OPPOSITE_LINKS_ICON_PATH = "/icons/full/ctool16/opposite_links.gif"; //$NON-NLS-1$
+ private static final String CONTAINER_ICON_PATH = "/icons/full/ctool16/container.gif"; //$NON-NLS-1$
+ private static final String EMPTY_METACLASSES_ICON_PATH = "/icons/full/ctool16/zero.gif"; //$NON-NLS-1$
+ private static final String PACKAGE_ICON_PATH = "/icons/full/ctool16/package.gif"; //$NON-NLS-1$
+ private static final String DERIVED_INSTANCES_ICON_PATH = "/icons/full/ctool16/derived_instances.gif"; //$NON-NLS-1$
+ private static final String DERIVATION_TREE_ICON_PATH = "/icons/full/ctool16/derivation_tree.gif"; //$NON-NLS-1$
+ private static final String ATTRIBUTE_ICON_PATH = "/icons/full/ctool16/attributes.gif"; //$NON-NLS-1$
+ private static final String ATTRIBUTE_FACET_ICON_PATH = "/icons/full/ctool16/attribute_facet.gif"; //$NON-NLS-1$
+ private static final String EMPTY_ATTRIBUTE_ICON_PATH = "/icons/full/ctool16/empty_attributes.gif"; //$NON-NLS-1$
+ private static final String INCREASE_FONT_SIZE_ICON_PATH = "/icons/full/ctool16/increase_font_size.gif"; //$NON-NLS-1$
+ private static final String DECREASE_FONT_SIZE_ICON_PATH = "/icons/full/ctool16/decrease_font_size.gif"; //$NON-NLS-1$
+ private static final String RESTORE_FONT_SIZE_ICON_PATH = "/icons/full/ctool16/restore_font_size.gif"; //$NON-NLS-1$
+ private static final String HIDE_EMPTY_COLUMNS_ICON_PATH = "/icons/full/ctool16/non-zero.gif"; //$NON-NLS-1$
+ private static final String COMMON_COLUMNS_ICON_PATH = "/icons/full/ctool16/common_columns.gif"; //$NON-NLS-1$
+ private static final String ORDERING_ICON_PATH = "/icons/full/ctool16/ordering.gif"; //$NON-NLS-1$
+ private static final String ECLASS_ICON_PATH = "/icons/full/ctool16/eClass.gif"; //$NON-NLS-1$
+ private static final String OPERATION_ICON_PATH = "/icons/full/ctool16/operation.gif"; //$NON-NLS-1$
+ private static final String PREDICATE_ICON_PATH = "/icons/full/ctool16/predicate.gif"; //$NON-NLS-1$
+ private static final String EMFFACET_ICON_PATH = "icons/logoEmfFacetMini.gif"; //$NON-NLS-1$
+ private static final String FEATURE_ICON_PATH = "icons/full/ctool16/feature.gif"; //$NON-NLS-1$
+ private static final String ERROR_ICON_PATH = "icons/error.gif"; //$NON-NLS-1$
+ private static final String FACET_ICON_PATH = "icons/Facet.gif"; //$NON-NLS-1$
+ private static final String ADD_UI_CUSTOM_ICON_PATH = "icons/full/ctool16/addUiCustom.gif"; //$NON-NLS-1$
+ private static final String VIEW_MENU_ICON_PATH = "icons/full/ctool16/view_menu.gif"; //$NON-NLS-1$
+ private static final String LINK_TYPE_ICON_PATH = "icons/full/ctool16/link_type.gif"; //$NON-NLS-1$
+ private static final String QUERY_ICON_PATH = "icons/query.png"; //$NON-NLS-1$
+ private static final String ELEMENT_IDS_ICON_PATH = "/icons/full/ctool16/element_id.gif"; //$NON-NLS-1$
+ private static final String URI_ICON_PATH = "/icons/full/ctool16/uri.gif"; //$NON-NLS-1$
+ private static final String COLLAPSE_ALL_ICON_PATH = "/icons/full/ctool16/collapseall.gif"; //$NON-NLS-1$
+ private static final String SHORTCUT_ICON_PATH = "/icons/shortcut.png"; //$NON-NLS-1$
+
+ // Customization
+ private static final String TOP_LEFT_OVERLAY_ICON_PATH = "/icons/full/ctool16/topLeftOverlay.png";
+ private static final String TOP_MIDDLE_OVERLAY_ICON_PATH = "/icons/full/ctool16/topMiddleOverlay.png";
+ private static final String TOP_RIGHT_OVERLAY_ICON_PATH = "/icons/full/ctool16/topRightOverlay.png";
+ private static final String MIDDLE_LEFT_OVERLAY_ICON_PATH = "/icons/full/ctool16/middleLeftOverlay.png";
+ private static final String MIDDLE_RIGHT_OVERLAY_ICON_PATH = "/icons/full/ctool16/middleRightOverlay.png";
+ private static final String BOTTOM_LEFT_OVERLAY_ICON_PATH = "/icons/full/ctool16/bottomLeftOverlay.png";
+ private static final String BOTTOM_MIDDLE_OVERLAY_ICON_PATH = "/icons/full/ctool16/bottomMiddleOverlay.png";
+ private static final String BOTTOM_RIGHT_OVERLAY_ICON_PATH = "/icons/full/ctool16/bottomRightOverlay.png";
+ private static final String LABEL_CUSTOMIZATION = "/icons/full/ctool16/customizationLabel.png";
+ private static final String IMAGE_CUSTOMIZATION = "/icons/full/ctool16/imageCustomization.png";
+ private static final String RGB_CUSTOMIZATION = "/icons/full/ctool16/rgb.png";
+ private static final String FONT_NAME = "/icons/full/ctool16/fontName.png"; //$NON-NLS-1$
+ private static final String FONT_SIZE = "/icons/full/ctool16/fontSize.png"; //$NON-NLS-1$
+ private static final String IS_BOLD = "/icons/full/ctool16/fontBold.png"; //$NON-NLS-1$
+ private static final String IS_ITALIC = "/icons/full/ctool16/fontItalic.bmp"; //$NON-NLS-1$
+ private static final String IS_UNDERLINED = "/icons/full/ctool16/fontUnderline.bmp"; //$NON-NLS-1$
+ private static final String IS_STRUCKTHROUGH = "/icons/full/ctool16/fontStrukethrough.bmp"; //$NON-NLS-1$
+
+ /**
+ * Create an image descriptor from a resource
+ *
+ * @param resourcePath
+ * the path of the resource (in the bundle)
+ * @return the image descriptor
+ */
+ private ImageDescriptor createImageDescriptor(final String resourcePath) {
+ final URL url = Activator.getDefault().getBundle().getResource(resourcePath);
+ if (url == null) {
+ Logger.logError(NLS.bind("Resource not found: {0}", //$NON-NLS-1$
+ resourcePath), Activator.getDefault());
+ return ImageDescriptor.getMissingImageDescriptor();
+ }
+ return ImageDescriptor.createFromURL(url);
+ }
+
+ /** Return the icon representing a bidirectional link */
+ public Image getLinkIcon() {
+ if (this.linkIcon == null) {
+ this.linkIcon = createImageDescriptor(ImageProvider.LINK_ICON_PATH).createImage();
+ }
+ return this.linkIcon;
+ }
+
+ /** Return the icon representing an unidirectional link */
+ public Image getUnidirectionalLinkIcon() {
+ if (this.linkUniDirIcon == null) {
+ this.linkUniDirIcon = createImageDescriptor(ImageProvider.LINK_UNIDIR_ICON_PATH)
+ .createImage();
+ }
+ return this.linkUniDirIcon;
+ }
+
+ /** Return the icon representing a facet reference */
+ public Image getFacetLinkIcon() {
+ if (this.linkFacetIcon == null) {
+ this.linkFacetIcon = createImageDescriptor(ImageProvider.LINK_FACET_ICON_PATH)
+ .createImage();
+ }
+ return this.linkFacetIcon;
+ }
+
+ /** Return the icon representing a composition link */
+ public Image getAggregIcon() {
+ if (this.aggregIcon == null) {
+ this.aggregIcon = createImageDescriptor(ImageProvider.AGGREG_ICON_PATH).createImage();
+ }
+ return this.aggregIcon;
+ }
+
+ /** Return the icon representing an unidirectional composition link */
+ public Image getUnidirectionalAggregIcon() {
+ if (this.aggregUniDirIcon == null) {
+ this.aggregUniDirIcon = createImageDescriptor(ImageProvider.AGGREG_UNIDIR_ICON_PATH)
+ .createImage();
+ }
+ return this.aggregUniDirIcon;
+ }
+
+ /** Return the icon representing a reverse composition link */
+ public Image getInvAggregIcon() {
+ if (this.invAggregIcon == null) {
+ this.invAggregIcon = createImageDescriptor(ImageProvider.INV_AGGREG_ICON_PATH)
+ .createImage();
+ }
+ return this.invAggregIcon;
+ }
+
+ /** Return the icon representing empty links */
+ public Image getEmptyLinksIcon() {
+ if (this.emptyLinksIcon == null) {
+ this.emptyLinksIcon = createImageDescriptor(ImageProvider.EMPTY_LINKS_ICON_PATH)
+ .createImage();
+ }
+ return this.emptyLinksIcon;
+ }
+
+ /** Return the icon representing empty links */
+ public ImageDescriptor getEmptyLinksImageDescriptor() {
+ return createImageDescriptor(ImageProvider.EMPTY_LINKS_ICON_PATH);
+ }
+
+ /** Return the icon representing sorting of instances */
+ public ImageDescriptor getSortInstancesIcon() {
+ return createImageDescriptor(ImageProvider.SORT_INSTANCES_ICON_PATH);
+ }
+
+ /** Return the icon representing sorting of links */
+ public Image getSortLinksIcon() {
+ if (this.sortLinksIcon == null) {
+ this.sortLinksIcon = createImageDescriptor(ImageProvider.SORT_LINKS_ICON_PATH)
+ .createImage();
+ }
+ return this.sortLinksIcon;
+ }
+
+ /** Return the icon representing sorting of links */
+ public ImageDescriptor getSortLinksImageDescriptor() {
+ return createImageDescriptor(ImageProvider.SORT_LINKS_ICON_PATH);
+ }
+
+ /** Return the icon representing sorting of links by type */
+ public Image getSortLinksByTypeIcon() {
+ if (this.sortLinksByTypeIcon == null) {
+ this.sortLinksByTypeIcon = createImageDescriptor(
+ ImageProvider.SORT_LINKS_BY_TYPE_ICON_PATH).createImage();
+ }
+ return this.sortLinksByTypeIcon;
+ }
+
+ /** Return the icon representing sorting of links by type */
+ public ImageDescriptor getSortLinksByTypeImageDescriptor() {
+ return createImageDescriptor(ImageProvider.SORT_LINKS_BY_TYPE_ICON_PATH);
+ }
+
+ /** Return the icon representing sorting numerically */
+ public ImageDescriptor getSortNumericallyIcon() {
+ return createImageDescriptor(ImageProvider.SORT_NUMERICALLY_ICON_PATH);
+ }
+
+ /** Return the icon representing derived links */
+ public Image getShowDerivedLinksIcon() {
+ if (this.showDerivedLinksIcon == null) {
+ this.showDerivedLinksIcon = createImageDescriptor(
+ ImageProvider.SHOW_DERIVED_LINKS_ICON_PATH).createImage();
+ }
+ return this.showDerivedLinksIcon;
+ }
+
+ /** Return the icon representing derived links */
+ public ImageDescriptor getShowDerivedLinksImageDescriptor() {
+ return createImageDescriptor(ImageProvider.SHOW_DERIVED_LINKS_ICON_PATH);
+ }
+
+ /** Return the icon representing full qualified names */
+ public Image getShowFullQualifiedNamesIcon() {
+ if (this.showFullQualifiedNamesIcon == null) {
+ this.showFullQualifiedNamesIcon = createImageDescriptor(
+ ImageProvider.SHOW_FULL_QUALIFIED_NAMES_ICON_PATH).createImage();
+ }
+ return this.showFullQualifiedNamesIcon;
+ }
+
+ /** Return the icon representing full qualified names */
+ public ImageDescriptor getShowFullQualifiedNamesImageDescriptor() {
+ return createImageDescriptor(ImageProvider.SHOW_FULL_QUALIFIED_NAMES_ICON_PATH);
+ }
+
+ /** Return the icon representing a range */
+ public Image getRangeIcon() {
+ if (this.rangeIcon == null) {
+ this.rangeIcon = createImageDescriptor(ImageProvider.RANGE_ICON_PATH).createImage();
+ }
+ return this.rangeIcon;
+ }
+
+ /** Return the multiplicity icon */
+ public Image getShowMultiplicityIcon() {
+ if (this.showMultiplicityIcon == null) {
+ this.showMultiplicityIcon = createImageDescriptor(
+ ImageProvider.SHOW_MULTIPLICITY_ICON_PATH).createImage();
+ }
+ return this.showMultiplicityIcon;
+ }
+
+ /** Return the multiplicity icon */
+ public ImageDescriptor getShowMultiplicityImageDescriptor() {
+ return createImageDescriptor(ImageProvider.SHOW_MULTIPLICITY_ICON_PATH);
+ }
+
+ /** Return the "opposite links" icon */
+ public Image getShowOppositeLinksIcon() {
+ if (this.showOppositeLinksIcon == null) {
+ this.showOppositeLinksIcon = createImageDescriptor(
+ ImageProvider.SHOW_OPPOSITE_LINKS_ICON_PATH).createImage();
+ }
+ return this.showOppositeLinksIcon;
+ }
+
+ /** Return the "opposite links" icon */
+ public ImageDescriptor getShowOppositeLinksImageDescriptor() {
+ return createImageDescriptor(ImageProvider.SHOW_OPPOSITE_LINKS_ICON_PATH);
+ }
+
+ /** Return the "container" icon */
+ public Image getContainerIcon() {
+ if (this.containerIcon == null) {
+ this.containerIcon = createImageDescriptor(ImageProvider.CONTAINER_ICON_PATH)
+ .createImage();
+ }
+ return this.containerIcon;
+ }
+
+ /** Return the "container" icon */
+ public ImageDescriptor getContainerImageDescriptor() {
+ return createImageDescriptor(ImageProvider.CONTAINER_ICON_PATH);
+ }
+
+ /** Return the "show empty metaclasses" icon */
+ public ImageDescriptor getShowEmptyMetaclassesIcon() {
+ return createImageDescriptor(ImageProvider.EMPTY_METACLASSES_ICON_PATH);
+ }
+
+ /** Return the "package" icon */
+ public Image getPackageIcon() {
+ if (this.packageIcon == null) {
+ this.packageIcon = createImageDescriptor(ImageProvider.PACKAGE_ICON_PATH).createImage();
+ }
+ return this.packageIcon;
+ }
+
+ /** Return the "package" icon */
+ public ImageDescriptor getPackageImageDescriptor() {
+ return createImageDescriptor(ImageProvider.PACKAGE_ICON_PATH);
+ }
+
+ // /** Return the "derived instances" icon */
+ // public Image getDerivedInstancesIcon() {
+ // if (this.derivedInstancesIcon == null) {
+ // this.derivedInstancesIcon = createImageDescriptor(
+ // ImageProvider.DERIVED_INSTANCES_ICON_PATH).createImage();
+ // }
+ // return this.derivedInstancesIcon;
+ // }
+
+ /** Return the "derived instances" icon */
+ public ImageDescriptor getDerivedInstancesImageDescriptor() {
+ return createImageDescriptor(ImageProvider.DERIVED_INSTANCES_ICON_PATH);
+ }
+
+ /** Return the "derivation tree" icon */
+ public ImageDescriptor getDerivationTreeIcon() {
+ return createImageDescriptor(ImageProvider.DERIVATION_TREE_ICON_PATH);
+ }
+
+ /** Return the "attribute" icon */
+ public Image getAttributeIcon() {
+ if (this.attributeIcon == null) {
+ this.attributeIcon = createImageDescriptor(ImageProvider.ATTRIBUTE_ICON_PATH)
+ .createImage();
+ }
+ return this.attributeIcon;
+ }
+
+ /** Return the "attribute" icon */
+ public ImageDescriptor getAttributeImageDescriptor() {
+ return createImageDescriptor(ImageProvider.ATTRIBUTE_ICON_PATH);
+ }
+
+ /** Return the "facet attribute" icon */
+ public Image getFacetAttributeIcon() {
+ if (this.attributeFacetIcon == null) {
+ this.attributeFacetIcon = createImageDescriptor(ImageProvider.ATTRIBUTE_FACET_ICON_PATH)
+ .createImage();
+ }
+ return this.attributeFacetIcon;
+ }
+
+ /** Return the "empty attributes" icon */
+ public Image getEmptyAttributeIcon() {
+ if (this.emptyAttributeIcon == null) {
+ this.emptyAttributeIcon = createImageDescriptor(ImageProvider.EMPTY_ATTRIBUTE_ICON_PATH)
+ .createImage();
+ }
+ return this.emptyAttributeIcon;
+ }
+
+ /** Return the "empty attributes" icon */
+ public ImageDescriptor getEmptyAttributeImageDescriptor() {
+ return createImageDescriptor(ImageProvider.EMPTY_ATTRIBUTE_ICON_PATH);
+ }
+
+ /** Return the "increase font size" icon */
+ public ImageDescriptor getIncreaseFontSizeIcon() {
+ if (this.increaseFontSizeIcon == null) {
+ this.increaseFontSizeIcon = createImageDescriptor(ImageProvider.INCREASE_FONT_SIZE_ICON_PATH);
+ }
+ return this.increaseFontSizeIcon;
+ }
+
+ /** Return the "decrease font size" icon */
+ public ImageDescriptor getDecreaseFontSizeIcon() {
+ if (this.decreaseFontSizeIcon == null) {
+ this.decreaseFontSizeIcon = createImageDescriptor(ImageProvider.DECREASE_FONT_SIZE_ICON_PATH);
+ }
+ return this.decreaseFontSizeIcon;
+ }
+
+ /** Return the "restore font size" icon */
+ public ImageDescriptor getRestoreFontSizeIcon() {
+ if (this.restoreFontSizeIcon == null) {
+ this.restoreFontSizeIcon = createImageDescriptor(ImageProvider.RESTORE_FONT_SIZE_ICON_PATH);
+ }
+ return this.restoreFontSizeIcon;
+ }
+
+ /** Return the "hide empty columns" icon */
+ public Image getHideEmptyColumnsIcon() {
+ if (this.hideEmptyColumnsIcon == null) {
+ this.hideEmptyColumnsIcon = createImageDescriptor(
+ ImageProvider.HIDE_EMPTY_COLUMNS_ICON_PATH).createImage();
+ }
+ return this.hideEmptyColumnsIcon;
+ }
+
+ /** Return the "common columns" icon */
+ public Image getCommonColumnsIcon() {
+ if (this.commonColumnsIcon == null) {
+ this.commonColumnsIcon = createImageDescriptor(ImageProvider.COMMON_COLUMNS_ICON_PATH)
+ .createImage();
+ }
+ return this.commonColumnsIcon;
+ }
+
+ /** Return the "ordering" icon */
+ public Image getOrderingIcon() {
+ if (this.orderingIcon == null) {
+ this.orderingIcon = createImageDescriptor(ImageProvider.ORDERING_ICON_PATH)
+ .createImage();
+ }
+ return this.orderingIcon;
+ }
+
+ /** Return the "ordering" icon */
+ public ImageDescriptor getOrderingImageDescriptor() {
+ return createImageDescriptor(ImageProvider.ORDERING_ICON_PATH);
+ }
+
+ /** Return the "eClass" icon */
+ public Image getEClassIcon() {
+ if (this.eClassIcon == null) {
+ this.eClassIcon = createImageDescriptor(ImageProvider.ECLASS_ICON_PATH).createImage();
+ }
+ return this.eClassIcon;
+ }
+
+ /** Return the "operation" icon */
+ public Image getOperationIcon() {
+ if (this.operationIcon == null) {
+ this.operationIcon = createImageDescriptor(ImageProvider.OPERATION_ICON_PATH)
+ .createImage();
+ }
+ return this.operationIcon;
+ }
+
+ /** Return the "predicate" icon */
+ public Image getPredicateIcon() {
+ if (this.predicateIcon == null) {
+ this.predicateIcon = createImageDescriptor(ImageProvider.PREDICATE_ICON_PATH)
+ .createImage();
+ }
+ return this.predicateIcon;
+ }
+
+ /** Return the "EmfFacet" icon */
+ public Image getEmfFacetIcon() {
+ if (this.emffacetIcon == null) {
+ this.emffacetIcon = createImageDescriptor(ImageProvider.EMFFACET_ICON_PATH).createImage();
+ }
+ return this.emffacetIcon;
+ }
+
+ /** Return an icon representing the concept of "feature" */
+ public Image getFeatureIcon() {
+ if (this.featureIcon == null) {
+ this.featureIcon = createImageDescriptor(ImageProvider.FEATURE_ICON_PATH).createImage();
+ }
+ return this.featureIcon;
+ }
+
+ /** Return an icon descriptor representing the concept of "feature" */
+ public ImageDescriptor getFeatureIconDescriptor() {
+ return createImageDescriptor(ImageProvider.FEATURE_ICON_PATH);
+ }
+
+ /** Return an icon descriptor representing the concept of "facet" */
+ public ImageDescriptor getFacetIconDescriptor() {
+ return createImageDescriptor(ImageProvider.FACET_ICON_PATH);
+ }
+
+ /** Return an icon descriptor representing the concept of "facet" */
+ public Image getFacetIcon() {
+ if (this.facetIcon == null) {
+ this.facetIcon = createImageDescriptor(ImageProvider.FACET_ICON_PATH).createImage();
+ }
+ return this.facetIcon;
+ }
+
+ /** Return an icon descriptor for "uiCustom" */
+ public ImageDescriptor getAddUiCustomIconDescriptor() {
+ return createImageDescriptor(ImageProvider.ADD_UI_CUSTOM_ICON_PATH);
+ }
+
+ /** Return an icon for "uiCustom" */
+ public Image getUiCustomIcon() {
+ if (this.uiCustomIcon == null) {
+ this.uiCustomIcon = createImageDescriptor(ImageProvider.ADD_UI_CUSTOM_ICON_PATH)
+ .createImage();
+ }
+ return this.uiCustomIcon;
+ }
+
+ /** Return the grayed image for "uiCustom */
+ public Image getGrayedUiCustomIcon() {
+ if (this.grayedUiCustomIcon == null) {
+ this.grayedUiCustomIcon = new Image(Display.getCurrent(), getUiCustomIcon(), SWT.IMAGE_GRAY);
+ }
+ return this.grayedUiCustomIcon;
+ }
+
+ /** Return the "error" icon */
+ public Image getErrorIcon() {
+ if (this.errorIcon == null) {
+ this.errorIcon = createImageDescriptor(ImageProvider.ERROR_ICON_PATH).createImage();
+ }
+ return this.errorIcon;
+ }
+
+ /** Return the toolbar menu icon */
+ public Image getViewMenuIcon() {
+ if (this.viewMenuIcon == null) {
+ this.viewMenuIcon = createImageDescriptor(ImageProvider.VIEW_MENU_ICON_PATH)
+ .createImage();
+ }
+ return this.viewMenuIcon;
+ }
+
+ /** Return the query menu icon */
+ public Image getQueryIcon() {
+ if (this.queryIcon == null) {
+ this.queryIcon = createImageDescriptor(ImageProvider.QUERY_ICON_PATH).createImage();
+ }
+ return this.queryIcon;
+ }
+
+ /** Return the link type icon */
+ public Image getLinkTypeIcon() {
+ if (this.linkTypeIcon == null) {
+ this.linkTypeIcon = createImageDescriptor(ImageProvider.LINK_TYPE_ICON_PATH)
+ .createImage();
+ }
+ return this.linkTypeIcon;
+ }
+
+ /** Return the link type icon descriptor */
+ public ImageDescriptor getLinkTypeIconDescriptor() {
+ return createImageDescriptor(ImageProvider.LINK_TYPE_ICON_PATH);
+ }
+
+ /** Return the "element ID" icon descriptor */
+ public ImageDescriptor getShowElementIDsDescriptor() {
+ return createImageDescriptor(ImageProvider.ELEMENT_IDS_ICON_PATH);
+ }
+
+ public ImageDescriptor getShowURIDescriptor() {
+ return createImageDescriptor(ImageProvider.URI_ICON_PATH);
+ }
+
+ public Image getURIIcon() {
+ if (this.uriIcon == null) {
+ this.uriIcon = createImageDescriptor(ImageProvider.URI_ICON_PATH).createImage();
+ }
+ return this.uriIcon;
+ }
+
+ public ImageDescriptor getCollapseAllDescriptor() {
+ return createImageDescriptor(ImageProvider.COLLAPSE_ALL_ICON_PATH);
+ }
+
+ public Image getShortcutIcon() {
+ if (this.shortcutIcon == null) {
+ this.shortcutIcon = createImageDescriptor(ImageProvider.SHORTCUT_ICON_PATH).createImage();
+ }
+ return this.shortcutIcon;
+ }
+
+ public Image getTopLeftOverlayIcon() {
+ if (this.topLeftOverlay == null) {
+ this.topLeftOverlay = createImageDescriptor(ImageProvider.TOP_LEFT_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.topLeftOverlay;
+ }
+
+ public Image getTopMiddleOverlayIcon() {
+ if (this.topMiddleOverlay == null) {
+ this.topMiddleOverlay = createImageDescriptor(ImageProvider.TOP_MIDDLE_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.topMiddleOverlay;
+ }
+
+ public Image getTopRightOverlayIcon() {
+ if (this.topRightOverlay == null) {
+ this.topRightOverlay = createImageDescriptor(ImageProvider.TOP_RIGHT_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.topRightOverlay;
+ }
+
+ public Image getMiddleLeftOverlayIcon() {
+ if (this.middleLeftOverlay == null) {
+ this.middleLeftOverlay = createImageDescriptor(ImageProvider.MIDDLE_LEFT_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.middleLeftOverlay;
+ }
+
+ public Image getMiddleRightOverlayIcon() {
+ if (this.middleRightOverlay == null) {
+ this.middleRightOverlay = createImageDescriptor(ImageProvider.MIDDLE_RIGHT_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.middleRightOverlay;
+ }
+
+ public Image getBottomLeftOverlayIcon() {
+ if (this.bottomLeftOverlay == null) {
+ this.bottomLeftOverlay = createImageDescriptor(ImageProvider.BOTTOM_LEFT_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.bottomLeftOverlay;
+ }
+
+ public Image getBottomMiddleOverlayIcon() {
+ if (this.bottomMiddleOverlay == null) {
+ this.bottomMiddleOverlay = createImageDescriptor(ImageProvider.BOTTOM_MIDDLE_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.bottomMiddleOverlay;
+ }
+
+ public Image getBottomRightOverlayIcon() {
+ if (this.bottomRightOverlay == null) {
+ this.bottomRightOverlay = createImageDescriptor(ImageProvider.BOTTOM_RIGHT_OVERLAY_ICON_PATH).createImage();
+ }
+ return this.bottomRightOverlay;
+ }
+
+ public Image getCustomizationLabelIcon() {
+ if (this.customizationLabel == null) {
+ this.customizationLabel = createImageDescriptor(ImageProvider.LABEL_CUSTOMIZATION).createImage();
+ }
+ return this.customizationLabel;
+ }
+
+ public Image getCustomizationImageIcon() {
+ if (this.customizationImage == null) {
+ this.customizationImage = createImageDescriptor(ImageProvider.IMAGE_CUSTOMIZATION).createImage();
+ }
+ return this.customizationImage;
+ }
+
+ public Image getCustomizationColorIcon() {
+ if (this.rgb == null) {
+ this.rgb = createImageDescriptor(ImageProvider.RGB_CUSTOMIZATION).createImage();
+ }
+ return this.rgb;
+ }
+
+ public Image getFontNameIcon() {
+ if (this.fontName == null) {
+ this.fontName = createImageDescriptor(ImageProvider.FONT_NAME).createImage();
+ }
+ return this.fontName;
+ }
+
+ public Image getFontSizeIcon() {
+ if (this.fontSize == null) {
+ this.fontSize = createImageDescriptor(ImageProvider.FONT_SIZE).createImage();
+ }
+ return this.fontSize;
+ }
+
+ public Image getIsBoldIcon() {
+ if (this.isBold == null) {
+ this.isBold = createImageDescriptor(ImageProvider.IS_BOLD).createImage();
+ }
+ return this.isBold;
+ }
+
+ public Image getIsItalicIcon() {
+ if (this.isItalic == null) {
+ this.isItalic = createImageDescriptor(ImageProvider.IS_ITALIC).createImage();
+ }
+ return this.isItalic;
+ }
+
+ public Image getIsUnderlinedIcon() {
+ if (this.isUnderlined == null) {
+ this.isUnderlined = createImageDescriptor(ImageProvider.IS_UNDERLINED).createImage();
+ }
+ return this.isUnderlined;
+ }
+
+ public Image getIsStrukethroughIcon() {
+ if (this.isStruckthrough == null) {
+ this.isStruckthrough = createImageDescriptor(ImageProvider.IS_STRUCKTHROUGH).createImage();
+ }
+ return this.isStruckthrough;
+ }
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Messages.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Messages.java
index baa1d3401ff..de53a2fd0d2 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Messages.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/Messages.java
@@ -1,122 +1,122 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
-
-import org.eclipse.osgi.util.NLS;
-
-public final class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.emf.facet.custom.metamodel.editor.messages"; //$NON-NLS-1$
-
- public static String CustomizationEditor_add;
- public static String CustomizationEditor_appliesToSubInstances;
- public static String CustomizationEditor_bold;
- public static String CustomizationEditor_btnOpenElementSelectionDialogText;
- public static String CustomizationEditor_btnOpenFontDialogText;
- public static String CustomizationEditor_btnProperties;
- public static String CustomizationEditor_btnTooltipViewErrors;
- public static String CustomizationEditor_cannotFindMetamodel;
-
- public static String CustomizationEditor_changeProperties;
- public static String CustomizationEditor_collapseLink;
-
- public static String CustomizationEditor_conditions;
-
- public static String CustomizationEditor_conflictingUnsavedChanges;
- public static String CustomizationEditor_customizationsWillBeDeleted;
-
- public static String CustomizationEditor_customViewFor;
- public static String CustomizationEditor_down;
- public static String CustomizationEditor_edit;
- public static String CustomizationEditor_editFeatureValue;
- public static String CustomizationEditor_error;
- public static String CustomizationEditor_errorLoadingResource;
-
- public static String CustomizationEditor_fileConflict;
- public static String CustomizationEditor_hideMetaclassName;
- public static String CustomizationEditor_iconSelection;
- public static String CustomizationEditor_invalidSelection;
- public static String CustomizationEditor_italic;
- public static String CustomizationEditor_missingQuery;
- public static String CustomizationEditor_missingQuerySet;
- public static String CustomizationEditor_nonExistingQuery;
- public static String CustomizationEditor_nonExistingQuerySet;
- public static String CustomizationEditor_notFileSelected;
- public static String CustomizationEditor_promptCleanCustomizations;
- public static String CustomizationEditor_readonly;
- public static String CustomizationEditor_remove;
-
- public static String CustomizationEditor_removeIrrelevantCustomizations;
-
- public static String CustomizationEditor_resetDefaults;
- public static String CustomizationEditor_sectionName_customizations;
- public static String CustomizationEditor_sectionName_types;
- public static String CustomizationEditor_selectAnIcon;
- public static String CustomizationEditor_strikethrough;
- public static String CustomizationEditor_text;
- public static String CustomizationEditor_Title_cleanCustomization;
- public static String CustomizationEditor_underlined;
- public static String CustomizationEditor_unknown;
- public static String CustomizationEditor_up;
- public static String CustomizationEditor_visible;
- public static String CustomizationEditor_metaclassVisible;
- public static String CustomizationEditor_youChangedMetamodel;
- public static String CustomizationPropertiesDialog_customizationProperties;
- public static String CustomizationPropertiesDialog_metamodel;
- public static String CustomizationPropertiesDialog_metamodelMustBeSelected;
- public static String CustomizationPropertiesDialog_noMetamodelSelected;
- public static String CustomizationPropertiesDialog_querySets;
- public static String CustomizationViewer_backgroundColor;
-
- public static String CustomizationViewer_collapseLink;
- public static String CustomizationViewer_defaultValue;
- public static String CustomizationViewer_feature;
- public static String CustomizationViewer_hideMetaclassName;
- public static String CustomizationViewer_typeIcon;
- public static String CustomizationViewer_isBold;
- public static String CustomizationViewer_isItalic;
- public static String CustomizationViewer_isStruckthrough;
- public static String CustomizationViewer_isUnderlined;
- public static String CustomizationViewer_isVisible;
- public static String CustomizationViewer_label;
- public static String CustomizationViewer_instanceIcon;
- public static String CustomizationViewer_overlayIcon;
- public static String CustomizationViewer_textColor;
- public static String CustomizationViewer_textFontName;
- public static String CustomizationViewer_value;
- public static String CustomizationViewer_metaclassVisible;
- public static String ErrorsDialog_diagnosticMessage;
- public static String ErrorsDialog_errors;
- public static String MetaclassViewToolBar_showDerivedLinks;
- public static String MetaclassViewToolBar_showFullQualifiedNames;
- public static String MetaclassViewToolBar_showMultiplicity;
- public static String MetaclassViewToolBar_sortLinks;
- public static String MetaclassViewToolBar_sortLinksByType;
- public static String EditFeatureValueDialog_conditionQueryMustBeSelected;
- public static String EditFeatureValueDialog_defaultValue;
- public static String EditFeatureValueDialog_editFeatureValue;
- public static String EditFeatureValueDialog_featureValue;
- public static String EditFeatureValueDialog_noConditionQuerySelected;
- public static String EditFeatureValueDialog_noQuerySelected;
- public static String EditFeatureValueDialog_queryForCondition;
- public static String EditFeatureValueDialog_queryMustBeSelected;
- public static String EditFeatureValueDialog_queryValue;
- public static String EditFeatureValueDialog_staticValue;
- public static String EditFeatureValueDialog_type;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- // not instantiable
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.presentation;
+
+import org.eclipse.osgi.util.NLS;
+
+public final class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.emf.facet.custom.metamodel.editor.messages"; //$NON-NLS-1$
+
+ public static String CustomizationEditor_add;
+ public static String CustomizationEditor_appliesToSubInstances;
+ public static String CustomizationEditor_bold;
+ public static String CustomizationEditor_btnOpenElementSelectionDialogText;
+ public static String CustomizationEditor_btnOpenFontDialogText;
+ public static String CustomizationEditor_btnProperties;
+ public static String CustomizationEditor_btnTooltipViewErrors;
+ public static String CustomizationEditor_cannotFindMetamodel;
+
+ public static String CustomizationEditor_changeProperties;
+ public static String CustomizationEditor_collapseLink;
+
+ public static String CustomizationEditor_conditions;
+
+ public static String CustomizationEditor_conflictingUnsavedChanges;
+ public static String CustomizationEditor_customizationsWillBeDeleted;
+
+ public static String CustomizationEditor_customViewFor;
+ public static String CustomizationEditor_down;
+ public static String CustomizationEditor_edit;
+ public static String CustomizationEditor_editFeatureValue;
+ public static String CustomizationEditor_error;
+ public static String CustomizationEditor_errorLoadingResource;
+
+ public static String CustomizationEditor_fileConflict;
+ public static String CustomizationEditor_hideMetaclassName;
+ public static String CustomizationEditor_iconSelection;
+ public static String CustomizationEditor_invalidSelection;
+ public static String CustomizationEditor_italic;
+ public static String CustomizationEditor_missingQuery;
+ public static String CustomizationEditor_missingQuerySet;
+ public static String CustomizationEditor_nonExistingQuery;
+ public static String CustomizationEditor_nonExistingQuerySet;
+ public static String CustomizationEditor_notFileSelected;
+ public static String CustomizationEditor_promptCleanCustomizations;
+ public static String CustomizationEditor_readonly;
+ public static String CustomizationEditor_remove;
+
+ public static String CustomizationEditor_removeIrrelevantCustomizations;
+
+ public static String CustomizationEditor_resetDefaults;
+ public static String CustomizationEditor_sectionName_customizations;
+ public static String CustomizationEditor_sectionName_types;
+ public static String CustomizationEditor_selectAnIcon;
+ public static String CustomizationEditor_strikethrough;
+ public static String CustomizationEditor_text;
+ public static String CustomizationEditor_Title_cleanCustomization;
+ public static String CustomizationEditor_underlined;
+ public static String CustomizationEditor_unknown;
+ public static String CustomizationEditor_up;
+ public static String CustomizationEditor_visible;
+ public static String CustomizationEditor_metaclassVisible;
+ public static String CustomizationEditor_youChangedMetamodel;
+ public static String CustomizationPropertiesDialog_customizationProperties;
+ public static String CustomizationPropertiesDialog_metamodel;
+ public static String CustomizationPropertiesDialog_metamodelMustBeSelected;
+ public static String CustomizationPropertiesDialog_noMetamodelSelected;
+ public static String CustomizationPropertiesDialog_querySets;
+ public static String CustomizationViewer_backgroundColor;
+
+ public static String CustomizationViewer_collapseLink;
+ public static String CustomizationViewer_defaultValue;
+ public static String CustomizationViewer_feature;
+ public static String CustomizationViewer_hideMetaclassName;
+ public static String CustomizationViewer_typeIcon;
+ public static String CustomizationViewer_isBold;
+ public static String CustomizationViewer_isItalic;
+ public static String CustomizationViewer_isStruckthrough;
+ public static String CustomizationViewer_isUnderlined;
+ public static String CustomizationViewer_isVisible;
+ public static String CustomizationViewer_label;
+ public static String CustomizationViewer_instanceIcon;
+ public static String CustomizationViewer_overlayIcon;
+ public static String CustomizationViewer_textColor;
+ public static String CustomizationViewer_textFontName;
+ public static String CustomizationViewer_value;
+ public static String CustomizationViewer_metaclassVisible;
+ public static String ErrorsDialog_diagnosticMessage;
+ public static String ErrorsDialog_errors;
+ public static String MetaclassViewToolBar_showDerivedLinks;
+ public static String MetaclassViewToolBar_showFullQualifiedNames;
+ public static String MetaclassViewToolBar_showMultiplicity;
+ public static String MetaclassViewToolBar_sortLinks;
+ public static String MetaclassViewToolBar_sortLinksByType;
+ public static String EditFeatureValueDialog_conditionQueryMustBeSelected;
+ public static String EditFeatureValueDialog_defaultValue;
+ public static String EditFeatureValueDialog_editFeatureValue;
+ public static String EditFeatureValueDialog_featureValue;
+ public static String EditFeatureValueDialog_noConditionQuerySelected;
+ public static String EditFeatureValueDialog_noQuerySelected;
+ public static String EditFeatureValueDialog_queryForCondition;
+ public static String EditFeatureValueDialog_queryMustBeSelected;
+ public static String EditFeatureValueDialog_queryValue;
+ public static String EditFeatureValueDialog_staticValue;
+ public static String EditFeatureValueDialog_type;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(Messages.BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ // not instantiable
+ }
+}
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/messages.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/messages.properties
index e213977eea5..556357fdfd1 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/messages.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.custom.metamodel.editor/src/org/eclipse/papyrus/emf/facet/custom/metamodel/v0_2_0/custom/presentation/messages.properties
@@ -1,97 +1,97 @@
-###############################################################################
-# Copyright (c) 2009, 2010 Mia-Software.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Nicolas Bros (Mia-Software) - initial API and implementation
-###############################################################################
-CustomizationEditor_add=&Add...
-CustomizationEditor_appliesToSubInstances=Applies to &Sub-Instances
-CustomizationEditor_bold=Bold
-CustomizationEditor_btnOpenElementSelectionDialogText=...
-CustomizationEditor_btnOpenFontDialogText=...
-CustomizationEditor_btnProperties=&Properties
-CustomizationEditor_btnTooltipViewErrors=View errors
-CustomizationEditor_cannotFindMetamodel=Couldn't find metamodel with URI "{0}"
-CustomizationEditor_changeProperties=Change Properties
-CustomizationEditor_collapseLink=Collapse link
-CustomizationEditor_conditions=Conditions :
-CustomizationEditor_conflictingUnsavedChanges=There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
-CustomizationEditor_customizationsWillBeDeleted=All the customizations for metaclass "{0}" will be deleted. Are you sure?
-CustomizationEditor_customViewFor=custom view for "{0}" ({1})
-CustomizationEditor_down=&Down
-CustomizationEditor_edit=&Edit...
-CustomizationEditor_editFeatureValue=Edit feature &value...
-CustomizationEditor_error=Error
-CustomizationEditor_errorLoadingResource=Error loading resource. See log for more information.
-CustomizationEditor_fileConflict=File Conflict
-CustomizationEditor_hideMetaclassName=Hide metaclass name
-CustomizationEditor_iconSelection=Icon selection
-CustomizationEditor_invalidSelection=Invalid selection
-CustomizationEditor_italic=Italic
-CustomizationEditor_missingQuery=Couldn't find Query named "{0}" in query set "{1}".
-CustomizationEditor_missingQuerySet=Couldn't find Query Set named "{0}".
-CustomizationEditor_nonExistingQuery=Non-existing Query
-CustomizationEditor_nonExistingQuerySet=Non-existing Query Set
-CustomizationEditor_notFileSelected=You haven't selected a file
-CustomizationEditor_promptCleanCustomizations=Do you want to remove customizations that don't correspond to the new metamodel?
-CustomizationEditor_readonly=READONLY
-CustomizationEditor_remove=&Remove
-CustomizationEditor_removeIrrelevantCustomizations=Remove Irrelevant Customizations
-CustomizationEditor_resetDefaults=Reset Defaults
-CustomizationEditor_sectionName_customizations=Customizations
-CustomizationEditor_sectionName_types=Types
-CustomizationEditor_selectAnIcon=Select an icon:
-CustomizationEditor_strikethrough=Strikethrough
-CustomizationEditor_text=Text
-CustomizationEditor_Title_cleanCustomization=Clean customization
-CustomizationEditor_underlined=Underlined
-CustomizationEditor_unknown=<unknown>
-CustomizationEditor_up=&Up
-CustomizationEditor_visible=Visible
-CustomizationEditor_metaclassVisible=Visible in Types Panel
-CustomizationEditor_youChangedMetamodel=You have changed the metamodel.\n
-CustomizationPropertiesDialog_customizationProperties=Customization Properties
-CustomizationPropertiesDialog_metamodel=Metamodel
-CustomizationPropertiesDialog_metamodelMustBeSelected=A metamodel must be selected
-CustomizationPropertiesDialog_noMetamodelSelected=No metamodel selected
-CustomizationPropertiesDialog_querySets=Query Sets
-CustomizationViewer_backgroundColor=Background Color
-CustomizationViewer_collapseLink=Collapse Link
-CustomizationViewer_defaultValue=<default value>
-CustomizationViewer_feature=Feature
-CustomizationViewer_hideMetaclassName=Hide Metaclass Name
-CustomizationViewer_typeIcon=Type Icon
-CustomizationViewer_isBold=Is Bold
-CustomizationViewer_isItalic=Is Italic
-CustomizationViewer_isStruckthrough=Is Struckthrough
-CustomizationViewer_isUnderlined=Is Underlined
-CustomizationViewer_isVisible=Is Visible
-CustomizationViewer_metaclassVisible=Visible in Types Panel
-CustomizationViewer_label=Label
-CustomizationViewer_instanceIcon=Instance Icon
-CustomizationViewer_overlayIcon=Overlay Icon
-CustomizationViewer_textColor=Text Color
-CustomizationViewer_textFontName=Text Font Name
-CustomizationViewer_value=Value
-ErrorsDialog_diagnosticMessage={0}\nin: {1}\nline: {2} column: {3}
-ErrorsDialog_errors=Errors
-MetaclassViewToolBar_showDerivedLinks=Show Derived Links
-MetaclassViewToolBar_showFullQualifiedNames=Show Full Qualified Names
-MetaclassViewToolBar_showMultiplicity=Show Multiplicity
-MetaclassViewToolBar_sortLinks=Sort Links
-MetaclassViewToolBar_sortLinksByType=Sort Links by Type
-EditFeatureValueDialog_conditionQueryMustBeSelected=A condition query must be selected
-EditFeatureValueDialog_defaultValue=Default value
-EditFeatureValueDialog_editFeatureValue=Edit Feature Value
-EditFeatureValueDialog_featureValue=Feature value
-EditFeatureValueDialog_noConditionQuerySelected=No condition query selected
-EditFeatureValueDialog_noQuerySelected=No query selected
-EditFeatureValueDialog_queryForCondition=Query for condition
-EditFeatureValueDialog_queryMustBeSelected=A query must be selected
-EditFeatureValueDialog_queryValue=Value computed by a query
-EditFeatureValueDialog_staticValue=Static value
-EditFeatureValueDialog_type=Type
+###############################################################################
+# Copyright (c) 2009, 2010 Mia-Software.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Nicolas Bros (Mia-Software) - initial API and implementation
+###############################################################################
+CustomizationEditor_add=&Add...
+CustomizationEditor_appliesToSubInstances=Applies to &Sub-Instances
+CustomizationEditor_bold=Bold
+CustomizationEditor_btnOpenElementSelectionDialogText=...
+CustomizationEditor_btnOpenFontDialogText=...
+CustomizationEditor_btnProperties=&Properties
+CustomizationEditor_btnTooltipViewErrors=View errors
+CustomizationEditor_cannotFindMetamodel=Couldn't find metamodel with URI "{0}"
+CustomizationEditor_changeProperties=Change Properties
+CustomizationEditor_collapseLink=Collapse link
+CustomizationEditor_conditions=Conditions :
+CustomizationEditor_conflictingUnsavedChanges=There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+CustomizationEditor_customizationsWillBeDeleted=All the customizations for metaclass "{0}" will be deleted. Are you sure?
+CustomizationEditor_customViewFor=custom view for "{0}" ({1})
+CustomizationEditor_down=&Down
+CustomizationEditor_edit=&Edit...
+CustomizationEditor_editFeatureValue=Edit feature &value...
+CustomizationEditor_error=Error
+CustomizationEditor_errorLoadingResource=Error loading resource. See log for more information.
+CustomizationEditor_fileConflict=File Conflict
+CustomizationEditor_hideMetaclassName=Hide metaclass name
+CustomizationEditor_iconSelection=Icon selection
+CustomizationEditor_invalidSelection=Invalid selection
+CustomizationEditor_italic=Italic
+CustomizationEditor_missingQuery=Couldn't find Query named "{0}" in query set "{1}".
+CustomizationEditor_missingQuerySet=Couldn't find Query Set named "{0}".
+CustomizationEditor_nonExistingQuery=Non-existing Query
+CustomizationEditor_nonExistingQuerySet=Non-existing Query Set
+CustomizationEditor_notFileSelected=You haven't selected a file
+CustomizationEditor_promptCleanCustomizations=Do you want to remove customizations that don't correspond to the new metamodel?
+CustomizationEditor_readonly=READONLY
+CustomizationEditor_remove=&Remove
+CustomizationEditor_removeIrrelevantCustomizations=Remove Irrelevant Customizations
+CustomizationEditor_resetDefaults=Reset Defaults
+CustomizationEditor_sectionName_customizations=Customizations
+CustomizationEditor_sectionName_types=Types
+CustomizationEditor_selectAnIcon=Select an icon:
+CustomizationEditor_strikethrough=Strikethrough
+CustomizationEditor_text=Text
+CustomizationEditor_Title_cleanCustomization=Clean customization
+CustomizationEditor_underlined=Underlined
+CustomizationEditor_unknown=<unknown>
+CustomizationEditor_up=&Up
+CustomizationEditor_visible=Visible
+CustomizationEditor_metaclassVisible=Visible in Types Panel
+CustomizationEditor_youChangedMetamodel=You have changed the metamodel.\n
+CustomizationPropertiesDialog_customizationProperties=Customization Properties
+CustomizationPropertiesDialog_metamodel=Metamodel
+CustomizationPropertiesDialog_metamodelMustBeSelected=A metamodel must be selected
+CustomizationPropertiesDialog_noMetamodelSelected=No metamodel selected
+CustomizationPropertiesDialog_querySets=Query Sets
+CustomizationViewer_backgroundColor=Background Color
+CustomizationViewer_collapseLink=Collapse Link
+CustomizationViewer_defaultValue=<default value>
+CustomizationViewer_feature=Feature
+CustomizationViewer_hideMetaclassName=Hide Metaclass Name
+CustomizationViewer_typeIcon=Type Icon
+CustomizationViewer_isBold=Is Bold
+CustomizationViewer_isItalic=Is Italic
+CustomizationViewer_isStruckthrough=Is Struckthrough
+CustomizationViewer_isUnderlined=Is Underlined
+CustomizationViewer_isVisible=Is Visible
+CustomizationViewer_metaclassVisible=Visible in Types Panel
+CustomizationViewer_label=Label
+CustomizationViewer_instanceIcon=Instance Icon
+CustomizationViewer_overlayIcon=Overlay Icon
+CustomizationViewer_textColor=Text Color
+CustomizationViewer_textFontName=Text Font Name
+CustomizationViewer_value=Value
+ErrorsDialog_diagnosticMessage={0}\nin: {1}\nline: {2} column: {3}
+ErrorsDialog_errors=Errors
+MetaclassViewToolBar_showDerivedLinks=Show Derived Links
+MetaclassViewToolBar_showFullQualifiedNames=Show Full Qualified Names
+MetaclassViewToolBar_showMultiplicity=Show Multiplicity
+MetaclassViewToolBar_sortLinks=Sort Links
+MetaclassViewToolBar_sortLinksByType=Sort Links by Type
+EditFeatureValueDialog_conditionQueryMustBeSelected=A condition query must be selected
+EditFeatureValueDialog_defaultValue=Default value
+EditFeatureValueDialog_editFeatureValue=Edit Feature Value
+EditFeatureValueDialog_featureValue=Feature value
+EditFeatureValueDialog_noConditionQuerySelected=No condition query selected
+EditFeatureValueDialog_noQuerySelected=No query selected
+EditFeatureValueDialog_queryForCondition=Query for condition
+EditFeatureValueDialog_queryMustBeSelected=A query must be selected
+EditFeatureValueDialog_queryValue=Value computed by a query
+EditFeatureValueDialog_staticValue=Static value
+EditFeatureValueDialog_type=Type
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.classpath b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.classpath
index da1049abda9..e721d0c4eaa 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.classpath
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.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/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.settings/org.eclipse.jdt.core.prefs b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.settings/org.eclipse.jdt.core.prefs
index 4759947300a..c585cc455ae 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/.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/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/OSGI-INF/l10n/bundle.properties b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/OSGI-INF/l10n/bundle.properties
index b37460590fc..c77dcad8034 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/OSGI-INF/l10n/bundle.properties
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/OSGI-INF/l10n/bundle.properties
@@ -1,13 +1,13 @@
-############################################################################
-# Copyright (c) 2011, 2012 Mia-Software.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Gregoire Dupe (Mia-Software) - Bug 337584 - Documentation set up
-############################################################################
-Bundle-Vendor = Eclipse Modeling Project
+############################################################################
+# Copyright (c) 2011, 2012 Mia-Software.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Gregoire Dupe (Mia-Software) - Bug 337584 - Documentation set up
+############################################################################
+Bundle-Vendor = Eclipse Modeling Project
Bundle-Name = Papyrus EMF Facet Documenation \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/about.html b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/about.html
index 70d93d92528..3f531626403 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/about.html
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/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>April 19, 2011</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!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>April 19, 2011</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/index.html b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/index.html
index 77721474c5f..24211924779 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/index.html
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/index.html
@@ -1,16 +1,16 @@
-<!--
- Copyright (c) 2011 Mia-Software.
-
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Gregoire Dupe (Mia-Software) - Bug 337584 - Documentation set up
--->
-
-<frameset cols="300,*">
- <frame src="toc.html" name="toc">
- <frame src="about:blank" name="content">
-</frame>
+<!--
+ Copyright (c) 2011 Mia-Software.
+
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Gregoire Dupe (Mia-Software) - Bug 337584 - Documentation set up
+-->
+
+<frameset cols="300,*">
+ <frame src="toc.html" name="toc">
+ <frame src="about:blank" name="content">
+</frame>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/API_Policy.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/API_Policy.mediawiki
index 4ddc52551a7..92dcd684131 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/API_Policy.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/API_Policy.mediawiki
@@ -1,77 +1,77 @@
-=API Policy=
-
-This policy defines rules which give some guarantees to adopters about the EMF Facet API stability.
-
-We consider EMF Facet API as the union of Java API, Eclipse Extension points, and also Models.
-
-Indeed, since the EMF Facet project addresses Model-Driven Reverse Engineering, it proposes various metamodels definitions and conforming models to support the end-user use cases.
-
-== Declared API ==
-
-Declared API is public API that EMF Facet has committed to supporting for several releases. It should be clean and contain adequate javadoc. Declared API may evolve in the first few milestones, but it must be frozen by the release API freeze date and will not change throughout the remainder of the release or the corresponding maintenance releases.
-
-In following releases, API may sometimes be deprecated due to the normal evolution of EMF Facet. Deprecations must contain information on a migration path for existing adopters. Deprecated API may not be removed for at least 1 major release (and preferably longer), and after notifying the community.
-
-== Provisional API ==
-
-Provisional API is a work in progress towards fully Declared API and can be used when committers want to gather community feedback before declaring API, or when there are known problems with a new API that cannot be addressed by API freeze date. Provisional API status is meant to be a temporary state and API should not remain provisional for an undue length of time.
-
-Provisional Java API should be marked at the class or member level with the following javadoc comment:
-<pre>/** Provisional API: This class/interface is part of an interim API
-* that is still under development and expected to
-* change before reaching stability.
-*/
-</pre>
-Provisional Model API should be marked at the ecore level with a metamodel identifier mentioning "incubation" (e.g. "http://www.eclipse.org/MoDisco/Java/0.2.incubation/java" as nsURI identifier of an ecore definition). Java model API, because it is generated from ecore model, shouldn't have to be marked as provisional accordingly to the ecore definition.
-
-Provisional Extension Point API should be marked as "incubation" in extension point naming.
-
-== Examples API ==
-
-The project delivers some examples plugins for various EMF Facet features. It includes some models conforming to EMF Facet infrastructure and technologies layers, and some Java API. Those components might be used as a starting point for the end-user reverse engineering process. But Examples API is not as stable as declared API and is expected to change.
-
-Any resource included in a plugin whose name indicates 'examples' should be considered of Internal API kind.
-
-The examples APIs are not stable. They can change without any notice (including in a service release).
-
-== Test API ==
-
-In addition the project delivers some tests plugins for various EMF Facet features. It also includes some models and Java classes, which are not as stable as declared API.
-
-Any resource included in a plugin whose name indicates 'test' should be also considered of Internal API kind.
-
-The test APIs are not stable. They can change without any notice (including in a service release).
-
-== Internal Use ==
-
-Internal code is everything else. EMF Facet reserves the right to change internal code at any time (including in a service release).
-
-The internal packages should contain 'internal' in the package name.
-The internal packages should not appear in "Exported Packages" in manifest file. ''Note : within EMF Facet components, x-friends|x-internal can be used in the manifest to give 'internal' access to any plugin from the same layer that requires it, in such a case it is accurate to write a API.readme.txt file at the top level of the project to justify why one of its internal package is exposed.''
-
-Internal extension points should be indicated by 'internal' in the extension point name.
-
-Internal model API (rare) should be indicated by 'internal' in the identifier.
-
-If adopters require the use of internal code and do not want to be continually broken, they should open bugzilla enhancement requests for API. These bugs will be triaged and will help drive the creation of new declared or provisional API.
-
-== Deprecated API declaration ==
-
-When an API need to be declared deprecated, the contributor has to:
-* Add the @Deprecated tag in the Java code.
-* Open a bug:
-** having a summary starting with [Deprecated],
-** specifying in which version the API will be removed.
-* Copy the bug URL in the Java code of the deprecated API.
-* Add in the Javadoc comment using the @deprecated tag:
-** an explanation of what to do when we are using the deprecated API,
-** the version number of the deprecation,
-** the bug URL.
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-</font>
+=API Policy=
+
+This policy defines rules which give some guarantees to adopters about the EMF Facet API stability.
+
+We consider EMF Facet API as the union of Java API, Eclipse Extension points, and also Models.
+
+Indeed, since the EMF Facet project addresses Model-Driven Reverse Engineering, it proposes various metamodels definitions and conforming models to support the end-user use cases.
+
+== Declared API ==
+
+Declared API is public API that EMF Facet has committed to supporting for several releases. It should be clean and contain adequate javadoc. Declared API may evolve in the first few milestones, but it must be frozen by the release API freeze date and will not change throughout the remainder of the release or the corresponding maintenance releases.
+
+In following releases, API may sometimes be deprecated due to the normal evolution of EMF Facet. Deprecations must contain information on a migration path for existing adopters. Deprecated API may not be removed for at least 1 major release (and preferably longer), and after notifying the community.
+
+== Provisional API ==
+
+Provisional API is a work in progress towards fully Declared API and can be used when committers want to gather community feedback before declaring API, or when there are known problems with a new API that cannot be addressed by API freeze date. Provisional API status is meant to be a temporary state and API should not remain provisional for an undue length of time.
+
+Provisional Java API should be marked at the class or member level with the following javadoc comment:
+<pre>/** Provisional API: This class/interface is part of an interim API
+* that is still under development and expected to
+* change before reaching stability.
+*/
+</pre>
+Provisional Model API should be marked at the ecore level with a metamodel identifier mentioning "incubation" (e.g. "http://www.eclipse.org/MoDisco/Java/0.2.incubation/java" as nsURI identifier of an ecore definition). Java model API, because it is generated from ecore model, shouldn't have to be marked as provisional accordingly to the ecore definition.
+
+Provisional Extension Point API should be marked as "incubation" in extension point naming.
+
+== Examples API ==
+
+The project delivers some examples plugins for various EMF Facet features. It includes some models conforming to EMF Facet infrastructure and technologies layers, and some Java API. Those components might be used as a starting point for the end-user reverse engineering process. But Examples API is not as stable as declared API and is expected to change.
+
+Any resource included in a plugin whose name indicates 'examples' should be considered of Internal API kind.
+
+The examples APIs are not stable. They can change without any notice (including in a service release).
+
+== Test API ==
+
+In addition the project delivers some tests plugins for various EMF Facet features. It also includes some models and Java classes, which are not as stable as declared API.
+
+Any resource included in a plugin whose name indicates 'test' should be also considered of Internal API kind.
+
+The test APIs are not stable. They can change without any notice (including in a service release).
+
+== Internal Use ==
+
+Internal code is everything else. EMF Facet reserves the right to change internal code at any time (including in a service release).
+
+The internal packages should contain 'internal' in the package name.
+The internal packages should not appear in "Exported Packages" in manifest file. ''Note : within EMF Facet components, x-friends|x-internal can be used in the manifest to give 'internal' access to any plugin from the same layer that requires it, in such a case it is accurate to write a API.readme.txt file at the top level of the project to justify why one of its internal package is exposed.''
+
+Internal extension points should be indicated by 'internal' in the extension point name.
+
+Internal model API (rare) should be indicated by 'internal' in the identifier.
+
+If adopters require the use of internal code and do not want to be continually broken, they should open bugzilla enhancement requests for API. These bugs will be triaged and will help drive the creation of new declared or provisional API.
+
+== Deprecated API declaration ==
+
+When an API need to be declared deprecated, the contributor has to:
+* Add the @Deprecated tag in the Java code.
+* Open a bug:
+** having a summary starting with [Deprecated],
+** specifying in which version the API will be removed.
+* Copy the bug URL in the Java code of the deprecated API.
+* Add in the Javadoc comment using the @deprecated tag:
+** an explanation of what to do when we are using the deprecated API,
+** the version number of the deprecation,
+** the bug URL.
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/capabilities.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/capabilities.mediawiki
index b8f9cddc1c2..1742da04742 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/capabilities.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/capabilities.mediawiki
@@ -1,44 +1,44 @@
-== Definition ==
-EMF Facet currently defines an '''Activity''' (aka '''Capability''' in the UI) that allows enabling or disabling all of EMF Facet UI contributions:
- <extension point="org.eclipse.ui.activities">
- <activity
- description="%activity.description"
- id="org.eclipse.papyrus.emf.facet.capabilities.activity"
- name="%activity.name">
- </activity>
- <category
- description="%category.description"
- id="org.eclipse.papyrus.emf.facet.capabilities.category"
- name="%category.name">
- </category>
- <categoryActivityBinding
- activityId="org.eclipse.papyrus.emf.facet.capabilities.activity"
- categoryId="org.eclipse.papyrus.emf.facet.capabilities.category">
- </categoryActivityBinding>
- <activityPatternBinding
- activityId="org.eclipse.papyrus.emf.facet.capabilities.activity"
- isEqualityPattern="false"
- pattern="org\.eclipse\.emf\.facet\..*/.*">
- </activityPatternBinding>
- <defaultEnablement id="org.eclipse.papyrus.emf.facet.capabilities.activity"/>
- </extension>
-
-(in plug-in https://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.facet/trunk/plugins/org.eclipse.papyrus.emf.facet.capabilities)
-
-Product maintainers can use this definition as a starting point for customizing their product.
-
-== Selective Capabilities ==
-Capabilities can be as selective as you want. For example, you can choose to disable certain EMF Facet views. For example, this disables the "new project" wizard:
- <activityPatternBinding
- activityId="com.example.myActivity"
- isEqualityPattern="true"
- pattern="org.eclipse.papyrus.emf.facet.infra.common.ui/org.eclipse.papyrus.emf.facet.NewProjectWizard">
- </activityPatternBinding>
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-</font>
+== Definition ==
+EMF Facet currently defines an '''Activity''' (aka '''Capability''' in the UI) that allows enabling or disabling all of EMF Facet UI contributions:
+ <extension point="org.eclipse.ui.activities">
+ <activity
+ description="%activity.description"
+ id="org.eclipse.papyrus.emf.facet.capabilities.activity"
+ name="%activity.name">
+ </activity>
+ <category
+ description="%category.description"
+ id="org.eclipse.papyrus.emf.facet.capabilities.category"
+ name="%category.name">
+ </category>
+ <categoryActivityBinding
+ activityId="org.eclipse.papyrus.emf.facet.capabilities.activity"
+ categoryId="org.eclipse.papyrus.emf.facet.capabilities.category">
+ </categoryActivityBinding>
+ <activityPatternBinding
+ activityId="org.eclipse.papyrus.emf.facet.capabilities.activity"
+ isEqualityPattern="false"
+ pattern="org\.eclipse\.emf\.facet\..*/.*">
+ </activityPatternBinding>
+ <defaultEnablement id="org.eclipse.papyrus.emf.facet.capabilities.activity"/>
+ </extension>
+
+(in plug-in https://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.facet/trunk/plugins/org.eclipse.papyrus.emf.facet.capabilities)
+
+Product maintainers can use this definition as a starting point for customizing their product.
+
+== Selective Capabilities ==
+Capabilities can be as selective as you want. For example, you can choose to disable certain EMF Facet views. For example, this disables the "new project" wizard:
+ <activityPatternBinding
+ activityId="com.example.myActivity"
+ isEqualityPattern="true"
+ pattern="org.eclipse.papyrus.emf.facet.infra.common.ui/org.eclipse.papyrus.emf.facet.NewProjectWizard">
+ </activityPatternBinding>
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/checking_BREE.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/checking_BREE.mediawiki
index 5c105dbc329..4c127709c5f 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/checking_BREE.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/checking_BREE.mediawiki
@@ -1,19 +1,19 @@
-One of the requirements for the simultaneous release is "All plug-ins must correctly list their Bundle Required Execution Environment (BREE)".
-
-To satisfy this requirement, we check conformance thusly:
-* Checkout all EMF Facet plug-ins in the workspace
-* In the '''Problems''' view, open the view menu and select '''Configure Contents...''', and create a new configuration with:
-** Scope = on any element
-** Severity = Error, Warning, Info
-** Text contains = "execution environment"
-** Types: check all
-* Rebuild the whole workspace, and check that the '''Problems''' view is empty
-* Search the workspace in plain text for "JavaSE" in files named "Manifest.MF" : the search should return no results
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-</font>
+One of the requirements for the simultaneous release is "All plug-ins must correctly list their Bundle Required Execution Environment (BREE)".
+
+To satisfy this requirement, we check conformance thusly:
+* Checkout all EMF Facet plug-ins in the workspace
+* In the '''Problems''' view, open the view menu and select '''Configure Contents...''', and create a new configuration with:
+** Scope = on any element
+** Severity = Error, Warning, Info
+** Text contains = "execution environment"
+** Types: check all
+* Rebuild the whole workspace, and check that the '''Problems''' view is empty
+* Search the workspace in plain text for "JavaSE" in files named "Manifest.MF" : the search should return no results
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/new_and_noteworthy.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/new_and_noteworthy.mediawiki
index 0e581f0707f..5312d1d2cab 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/new_and_noteworthy.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/new_and_noteworthy.mediawiki
@@ -1,45 +1,45 @@
-= New and Noteworthy =
-== 0.1 ==
-EMF Facet 0.1 is the first release from EMF Facet, with the initial contribution coming from the MoDisco project.
-
-=== Table Model Editor ===
-There is a new table editor for models.
-
-[[Image:../img/EMFFacet_NatTable_QueryColumn.png|frame|center|EMF Facet Table Editor]]
-
-It supports the following functionalities:
-* The table can be opened from any selection of model elements.
-* The user can add and remove model elements from the table.
-* The table can display the results of queries in additional columns.
-* The user can edit values of the model elements attributes.
-* The user can set unary features (through a cell editor or drag & drop).
-* The user can set n-ary features with a dialog.
-* The table can be used to delete model elements.
-* The table provide a full support of undo/redo.
-* An extension point allow to provide new cell editors for any EType.
-* The table is automatically refreshed the model is modified.
-* The user/integrator can declare types of tables, which can be constrained to a specific type of element.
-* The use can copy a selection as text to paste it into a spreadsheet, text editor, etc.
-* The cells and column headers can be customized through the generic EMF Facet customization mechanism inherited from MoDisco (with .uiCustom files): label, colors, icons, fonts, struckthrough, etc.
-* The tables can be saved to a file and re-opened later.
-* The tables can display Facet attributes and references in additional columns.
-* Columns can be hidden/shown selectively with a dialog.
-
-[[Image:../img/EMFFacet_NatTable_CustomizationExample.png|frame|center|Customization of the table model editor]]
-
-=== Generic EMF serialization mechanism ===
-EMF Facet now defines an extension point and registry to specify serializers for specific types, through a generic serializable EDataType (see ISerializationService).
-
-== 0.3 ==
-
-* FacetSet and Customization editor.
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-Contibutors:
- Grégoire Dupé - Bug 387470 - [EFacet][Custom] Editors
-</font>
+= New and Noteworthy =
+== 0.1 ==
+EMF Facet 0.1 is the first release from EMF Facet, with the initial contribution coming from the MoDisco project.
+
+=== Table Model Editor ===
+There is a new table editor for models.
+
+[[Image:../img/EMFFacet_NatTable_QueryColumn.png|frame|center|EMF Facet Table Editor]]
+
+It supports the following functionalities:
+* The table can be opened from any selection of model elements.
+* The user can add and remove model elements from the table.
+* The table can display the results of queries in additional columns.
+* The user can edit values of the model elements attributes.
+* The user can set unary features (through a cell editor or drag & drop).
+* The user can set n-ary features with a dialog.
+* The table can be used to delete model elements.
+* The table provide a full support of undo/redo.
+* An extension point allow to provide new cell editors for any EType.
+* The table is automatically refreshed the model is modified.
+* The user/integrator can declare types of tables, which can be constrained to a specific type of element.
+* The use can copy a selection as text to paste it into a spreadsheet, text editor, etc.
+* The cells and column headers can be customized through the generic EMF Facet customization mechanism inherited from MoDisco (with .uiCustom files): label, colors, icons, fonts, struckthrough, etc.
+* The tables can be saved to a file and re-opened later.
+* The tables can display Facet attributes and references in additional columns.
+* Columns can be hidden/shown selectively with a dialog.
+
+[[Image:../img/EMFFacet_NatTable_CustomizationExample.png|frame|center|Customization of the table model editor]]
+
+=== Generic EMF serialization mechanism ===
+EMF Facet now defines an extension point and registry to specify serializers for specific types, through a generic serializable EDataType (see ISerializationService).
+
+== 0.3 ==
+
+* FacetSet and Customization editor.
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+Contibutors:
+ Grégoire Dupé - Bug 387470 - [EFacet][Custom] Editors
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/ramp_down.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/ramp_down.mediawiki
index 55317d213f2..836cf4628f6 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/ramp_down.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/ramp_down.mediawiki
@@ -1,11 +1,11 @@
-Projects must have a written ramp down policy by M6, at the latest, and provide link. The plan should describe when the project plans to be feature complete, have API frozen, and similar. The EMF Facet Ramp Down conforms to the [http://wiki.eclipse.org/Modeling_Project_Ramp_Down_Policy|Modeling Project Ramp Down Policy]
-
-The EMF Facet Ramp Down is described in the [http://www.eclipse.org/projects/project-plan.php?projectid=modeling.emft.emf-facet#release_milestones|Project Plan].
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-</font>
+Projects must have a written ramp down policy by M6, at the latest, and provide link. The plan should describe when the project plans to be feature complete, have API frozen, and similar. The EMF Facet Ramp Down conforms to the [http://wiki.eclipse.org/Modeling_Project_Ramp_Down_Policy|Modeling Project Ramp Down Policy]
+
+The EMF Facet Ramp Down is described in the [http://www.eclipse.org/projects/project-plan.php?projectid=modeling.emft.emf-facet#release_milestones|Project Plan].
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/retention_policy.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/retention_policy.mediawiki
index 05673195711..46007ab77c5 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/retention_policy.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/retention_policy.mediawiki
@@ -1,32 +1,32 @@
-== Retention Policy for EMF Facet builds (Draft) ==
-
-=== Code in SVN ===
-
-Any code that was included in a Release, is left in SVN forever. The version of a module that is included in a release will typically have a convenience version tag on the module, such as "R3_1_2".
-
-=== Distributions in zip files ===
-
-Formal releases are kept forever, but only the most recent release is kept on the [http://www.eclipse.org/modeling/emft/facet/downloads/ main download page]. Other, older distributions can be found on the [http://archive.eclipse.org/facet/downloads/ archive site].
-
-While developing a new release, milestone builds are kept until the release, at which point they are deleted.
-
-Similarly, while developing a milestone, weekly integration builds are kept until the milestone is available, and then they are deleted.
-
-=== Features in update site repository ===
-
-The update site repository will be treated as a persistent repository of content. Once something is installable from a release repository URL, it will always be installable from that repository URL. Note that the efficiency of installing old releases may not be maintained. Also, the "categories" that display the features in Eclipse 'Install New Software' dialog will change over time, but the underlying features and bundles will be there, even if not displayed in a category.
-
-=== What if these policies don't work for you? ===
-
-Just ask. Open a bug and request what you need.
-For example, an adopter might be building against an I-build, and isn't ready to move up to a particular milestone build for a few more weeks, so they'd prefer some I-build to not be removed at the end of the milestone.
-
-In other words, we are glad to be accommodating, but don't want to accommodate every hypothetical combination, since it's more work for us, we don't test it, and requires higher disk and bandwidth on the Eclipse mirroring system. So, open a bug if something special is required.
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-</font>
+== Retention Policy for EMF Facet builds (Draft) ==
+
+=== Code in SVN ===
+
+Any code that was included in a Release, is left in SVN forever. The version of a module that is included in a release will typically have a convenience version tag on the module, such as "R3_1_2".
+
+=== Distributions in zip files ===
+
+Formal releases are kept forever, but only the most recent release is kept on the [http://www.eclipse.org/modeling/emft/facet/downloads/ main download page]. Other, older distributions can be found on the [http://archive.eclipse.org/facet/downloads/ archive site].
+
+While developing a new release, milestone builds are kept until the release, at which point they are deleted.
+
+Similarly, while developing a milestone, weekly integration builds are kept until the milestone is available, and then they are deleted.
+
+=== Features in update site repository ===
+
+The update site repository will be treated as a persistent repository of content. Once something is installable from a release repository URL, it will always be installable from that repository URL. Note that the efficiency of installing old releases may not be maintained. Also, the "categories" that display the features in Eclipse 'Install New Software' dialog will change over time, but the underlying features and bundles will be there, even if not displayed in a category.
+
+=== What if these policies don't work for you? ===
+
+Just ask. Open a bug and request what you need.
+For example, an adopter might be building against an I-build, and isn't ready to move up to a particular milestone build for a few more weeks, so they'd prefer some I-build to not be removed at the end of the milestone.
+
+In other words, we are glad to be accommodating, but don't want to accommodate every hypothetical combination, since it's more work for us, we don't test it, and requires higher disk and bandwidth on the Eclipse mirroring system. So, open a bug if something special is required.
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/running_tests.mediawiki b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/running_tests.mediawiki
index 67222deb6b1..10cd72f967f 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/running_tests.mediawiki
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/mediawiki/running_tests.mediawiki
@@ -1,13 +1,13 @@
-To run the EMF Facet tests, you must:
-* install EMF Facet, or checkout all EMF Facet plug-ins in your workspace (from https://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.facet/trunk/plugins/)
-* check-out everything from https://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.facet/trunk/tests/
-* run org.eclipse.papyrus.emf.facet.tests.AllTests as a '''JUnit Plug-in Test'''
-* run org.eclipse.papyrus.emf.facet.tests.AllUITests as a '''JUnit Plug-in Test''', with '''Run in UI thread''' unchecked in the launch configuration
-
-<font size="-2">
-Copyright (c) 2012 Mia-Software.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html.
-</font>
+To run the EMF Facet tests, you must:
+* install EMF Facet, or checkout all EMF Facet plug-ins in your workspace (from https://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.facet/trunk/plugins/)
+* check-out everything from https://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.facet/trunk/tests/
+* run org.eclipse.papyrus.emf.facet.tests.AllTests as a '''JUnit Plug-in Test'''
+* run org.eclipse.papyrus.emf.facet.tests.AllUITests as a '''JUnit Plug-in Test''', with '''Run in UI thread''' unchecked in the launch configuration
+
+<font size="-2">
+Copyright (c) 2012 Mia-Software.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html.
+</font>
diff --git a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/src/org/eclipse/papyrus/emf/facet/doc/tasks/GenerateApiJavadocTask.java b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/src/org/eclipse/papyrus/emf/facet/doc/tasks/GenerateApiJavadocTask.java
index 5c2993e992e..3eda0cec40a 100644
--- a/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/src/org/eclipse/papyrus/emf/facet/doc/tasks/GenerateApiJavadocTask.java
+++ b/plugins/facet/editor/org.eclipse.papyrus.emf.facet.doc/src/org/eclipse/papyrus/emf/facet/doc/tasks/GenerateApiJavadocTask.java
@@ -1,140 +1,140 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Mia-Software.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Nicolas Bros (Mia-Software) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.emf.facet.doc.tasks;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Javadoc;
-import org.apache.tools.ant.types.FileSet;
-
-public class GenerateApiJavadocTask extends Javadoc {
-
- private String sourceTreePath = null;
- private Pattern pattern = Pattern.compile(".*"); //$NON-NLS-1$
-
- public void setSourceTreePath(final String path) {
- this.sourceTreePath = path;
- }
-
- public void setPattern(final String pattern) {
- this.pattern = Pattern.compile(pattern);
- }
-
- @Override
- public void execute() throws BuildException {
- if (this.sourceTreePath == null) {
- throw new BuildException("sourceTreePath must be set"); //$NON-NLS-1$
- }
-
- getProject().log("sourceTreePath = " + this.sourceTreePath, Project.MSG_DEBUG); //$NON-NLS-1$
-
- final List<File> apiPackages = new ArrayList<File>();
-
- File root = new File(this.sourceTreePath);
- if (!root.isAbsolute()) {
- root = new File(getProject().getBaseDir(), this.sourceTreePath);
- }
- if (!root.exists()) {
- throw new BuildException("root path doesn't exist: " + root.getPath()); //$NON-NLS-1$
- }
- try {
- for (final String childPath : root.list()) {
- final boolean matches = this.pattern.matcher(childPath).matches();
- if (matches) {
- getProject().log("pattern matches: " + childPath, Project.MSG_DEBUG); //$NON-NLS-1$
- } else {
- getProject().log("pattern rejects: " + childPath, Project.MSG_DEBUG); //$NON-NLS-1$
- }
- if (matches) {
- final File file = new File(root, childPath);
- if (file.isDirectory()) {
- final File manifestFile = new File(file, "META-INF/MANIFEST.MF"); //$NON-NLS-1$
- if (manifestFile.exists()) {
- FileInputStream fileInputStream;
- fileInputStream = new FileInputStream(manifestFile);
- final Manifest manifest = new Manifest(fileInputStream);
-
- final Attributes mainAttributes = manifest.getMainAttributes();
- for (final Entry<Object, Object> entry : mainAttributes.entrySet()) {
- final String name = entry.getKey().toString();
- if ("Export-Package".equals(name)) { //$NON-NLS-1$
- final String value = (String) entry.getValue();
- final String[] packageEntries = value.split(","); //$NON-NLS-1$
- for (final String packageEntry : packageEntries) {
- final String[] parts = packageEntry.split(";"); //$NON-NLS-1$
- final String packageName = parts[0];
- boolean internal = false;
- for (int i = 1; i < parts.length; i++) {
- if (parts[i].contains("x-internal") || parts[i].contains("x-friends")) { //$NON-NLS-1$ //$NON-NLS-2$
- internal = true;
- }
- }
- if (!internal) {
- final File packageDir = new File(file.getPath(), "src/" + packageName.replace('.', '/')); //$NON-NLS-1$
- if (packageDir.exists()) {
- apiPackages.add(packageDir);
- }
- }
- }
- }
- }
- fileInputStream.close();
- }
- }
- }
- }
- } catch (final Exception e) {
- throw new BuildException("Error reading manifests", e); //$NON-NLS-1$
- }
-
- for (final File apiPackage : apiPackages) {
- final String[] children = apiPackage.list();
- boolean packageImpl = false;
- boolean factoryImpl = false;
- for (final String child : children) {
- if (child.endsWith("PackageImpl.java")) { //$NON-NLS-1$
- packageImpl = true;
- }
- if (child.endsWith("FactoryImpl.java")) { //$NON-NLS-1$
- factoryImpl = true;
- }
- }
- if (packageImpl && factoryImpl) {
- getProject().log("excluding metamodel implementation package: " + apiPackage.getPath(), Project.MSG_INFO); //$NON-NLS-1$
- continue;
- }
-
- if (apiPackage.exists()) {
- System.out.println(apiPackage);
-
- final FileSet fileSet = new FileSet();
- fileSet.setProject(getProject());
- fileSet.setDir(apiPackage);
- fileSet.setIncludes("*.java"); //$NON-NLS-1$
- System.out.println(fileSet);
- addFileset(fileSet);
- } else {
- getProject().log("package doesn't exist: " + apiPackage, Project.MSG_ERR); //$NON-NLS-1$
- }
- }
-
- super.execute();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Mia-Software.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas Bros (Mia-Software) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.emf.facet.doc.tasks;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Javadoc;
+import org.apache.tools.ant.types.FileSet;
+
+public class GenerateApiJavadocTask extends Javadoc {
+
+ private String sourceTreePath = null;
+ private Pattern pattern = Pattern.compile(".*"); //$NON-NLS-1$
+
+ public void setSourceTreePath(final String path) {
+ this.sourceTreePath = path;
+ }
+
+ public void setPattern(final String pattern) {
+ this.pattern = Pattern.compile(pattern);
+ }
+
+ @Override
+ public void execute() throws BuildException {
+ if (this.sourceTreePath == null) {
+ throw new BuildException("sourceTreePath must be set"); //$NON-NLS-1$
+ }
+
+ getProject().log("sourceTreePath = " + this.sourceTreePath, Project.MSG_DEBUG); //$NON-NLS-1$
+
+ final List<File> apiPackages = new ArrayList<File>();
+
+ File root = new File(this.sourceTreePath);
+ if (!root.isAbsolute()) {
+ root = new File(getProject().getBaseDir(), this.sourceTreePath);
+ }
+ if (!root.exists()) {
+ throw new BuildException("root path doesn't exist: " + root.getPath()); //$NON-NLS-1$
+ }
+ try {
+ for (final String childPath : root.list()) {
+ final boolean matches = this.pattern.matcher(childPath).matches();
+ if (matches) {
+ getProject().log("pattern matches: " + childPath, Project.MSG_DEBUG); //$NON-NLS-1$
+ } else {
+ getProject().log("pattern rejects: " + childPath, Project.MSG_DEBUG); //$NON-NLS-1$
+ }
+ if (matches) {
+ final File file = new File(root, childPath);
+ if (file.isDirectory()) {
+ final File manifestFile = new File(file, "META-INF/MANIFEST.MF"); //$NON-NLS-1$
+ if (manifestFile.exists()) {
+ FileInputStream fileInputStream;
+ fileInputStream = new FileInputStream(manifestFile);
+ final Manifest manifest = new Manifest(fileInputStream);
+
+ final Attributes mainAttributes = manifest.getMainAttributes();
+ for (final Entry<Object, Object> entry : mainAttributes.entrySet()) {
+ final String name = entry.getKey().toString();
+ if ("Export-Package".equals(name)) { //$NON-NLS-1$
+ final String value = (String) entry.getValue();
+ final String[] packageEntries = value.split(","); //$NON-NLS-1$
+ for (final String packageEntry : packageEntries) {
+ final String[] parts = packageEntry.split(";"); //$NON-NLS-1$
+ final String packageName = parts[0];
+ boolean internal = false;
+ for (int i = 1; i < parts.length; i++) {
+ if (parts[i].contains("x-internal") || parts[i].contains("x-friends")) { //$NON-NLS-1$ //$NON-NLS-2$
+ internal = true;
+ }
+ }
+ if (!internal) {
+ final File packageDir = new File(file.getPath(), "src/" + packageName.replace('.', '/')); //$NON-NLS-1$
+ if (packageDir.exists()) {
+ apiPackages.add(packageDir);
+ }
+ }
+ }
+ }
+ }
+ fileInputStream.close();
+ }
+ }
+ }
+ }
+ } catch (final Exception e) {
+ throw new BuildException("Error reading manifests", e); //$NON-NLS-1$
+ }
+
+ for (final File apiPackage : apiPackages) {
+ final String[] children = apiPackage.list();
+ boolean packageImpl = false;
+ boolean factoryImpl = false;
+ for (final String child : children) {
+ if (child.endsWith("PackageImpl.java")) { //$NON-NLS-1$
+ packageImpl = true;
+ }
+ if (child.endsWith("FactoryImpl.java")) { //$NON-NLS-1$
+ factoryImpl = true;
+ }
+ }
+ if (packageImpl && factoryImpl) {
+ getProject().log("excluding metamodel implementation package: " + apiPackage.getPath(), Project.MSG_INFO); //$NON-NLS-1$
+ continue;
+ }
+
+ if (apiPackage.exists()) {
+ System.out.println(apiPackage);
+
+ final FileSet fileSet = new FileSet();
+ fileSet.setProject(getProject());
+ fileSet.setDir(apiPackage);
+ fileSet.setIncludes("*.java"); //$NON-NLS-1$
+ System.out.println(fileSet);
+ addFileset(fileSet);
+ } else {
+ getProject().log("package doesn't exist: " + apiPackage, Project.MSG_ERR); //$NON-NLS-1$
+ }
+ }
+
+ super.execute();
+ }
+}

Back to the top