Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-03-10 16:09:40 +0000
committerptessier2014-03-10 16:09:40 +0000
commitc26bd0a11a6347fee06c78ec5b6cde63d93a27f1 (patch)
tree2e36426c5127a2a6948a47c59eb4877b31abb0ef /plugins
parent1118d9b70850d945c3b0d89919c4100db64b9424 (diff)
downloadorg.eclipse.papyrus-c26bd0a11a6347fee06c78ec5b6cde63d93a27f1.tar.gz
org.eclipse.papyrus-c26bd0a11a6347fee06c78ec5b6cde63d93a27f1.tar.xz
org.eclipse.papyrus-c26bd0a11a6347fee06c78ec5b6cde63d93a27f1.zip
Bug 386118 - [EMF Facet] Papyrus should progressively support EMF Facet
0.2 make eanble the button Simple UML
Diffstat (limited to 'plugins')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore.modelcelleditors2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/model/celleditors.ecore2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/org.eclipse.papyrus.emf.facet.widgets.celleditors.core.modelcelleditors2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/plugin.xml2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/schema/celleditors.exsd2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/ModelCellEditorPackage.java2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/impl/ModelCellEditorFactoryImpl.java2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java206
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom2
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SimpleSysML.custom6
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom6
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/StereotypeDisplay.custom4
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java113
-rw-r--r--plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java36
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/OpenedPage.custom2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/ReadOnlyElement.custom2
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java186
17 files changed, 296 insertions, 281 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore.modelcelleditors b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore.modelcelleditors
index 0c446e60d57..77e86c73303 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore.modelcelleditors
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore/org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore.modelcelleditors
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<modelCellEditor:ModelCellEditorDeclarations xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:modelCellEditor="http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor">
+<modelCellEditor:ModelCellEditorDeclarations xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:modelCellEditor="http://www.eclipse.org/papyrus/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor">
<modelCellEditors xsi:type="modelCellEditor:BasicCellEditor" cellId="float_cell" basicCellEditorImpl="org.eclipse.papyrus.emf.facet.widgets.celleditors.ecore.EFloatCellEditor">
<cellType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
</modelCellEditors>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/model/celleditors.ecore b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/model/celleditors.ecore
index 0915a93d30b..3df2dec1ac4 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/model/celleditors.ecore
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/model/celleditors.ecore
@@ -2,7 +2,7 @@
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="modelCellEditor"
- nsURI="http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"
+ nsURI="http://www.eclipse.org/papyrus/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"
nsPrefix="modelCellEditor">
<eClassifiers xsi:type="ecore:EClass" name="ModelCellEditorDeclarations">
<eStructuralFeatures xsi:type="ecore:EReference" name="modelCellEditors" upperBound="-1"
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/org.eclipse.papyrus.emf.facet.widgets.celleditors.core.modelcelleditors b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/org.eclipse.papyrus.emf.facet.widgets.celleditors.core.modelcelleditors
index 966d679567b..2d5bcde729f 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/org.eclipse.papyrus.emf.facet.widgets.celleditors.core.modelcelleditors
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/org.eclipse.papyrus.emf.facet.widgets.celleditors.core.modelcelleditors
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<modelCellEditor:ModelCellEditorDeclarations xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:modelCellEditor="http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor">
+<modelCellEditor:ModelCellEditorDeclarations xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:modelCellEditor="http://www.eclipse.org/papyrus/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor">
<modelCellEditors xsi:type="modelCellEditor:UnaryReferenceCellEditor" cellId="unaryref_cell" unaryReferenceCellEditorImpl="org.eclipse.papyrus.emf.facet.widgets.celleditors.internal.core.UnaryReferenceCellEditor">
<cellType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
</modelCellEditors>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/plugin.xml b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/plugin.xml
index db048880121..74a63179f7c 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/plugin.xml
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/plugin.xml
@@ -22,7 +22,7 @@ Contributors:
<extension point="org.eclipse.emf.ecore.generated_package">
<package
- uri="http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"
+ uri="http://www.eclipse.org/papyrus/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"
class="org.eclipse.papyrus.emf.facet.widgets.celleditors.modelCellEditor.ModelCellEditorPackage"
genModel="model/celleditors.genmodel"/>
</extension>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/schema/celleditors.exsd b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/schema/celleditors.exsd
index 1be5074fdc0..dcb1351c10b 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/schema/celleditors.exsd
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/schema/celleditors.exsd
@@ -53,7 +53,7 @@
<annotation>
<documentation>
The path of a model describing model cell editors.
-This model must be an instance of metamodel &quot;http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor&quot;.
+This model must be an instance of metamodel &quot;http://www.eclipse.org/papyrus/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor&quot;.
</documentation>
<appInfo>
<meta.attribute kind="resource"/>
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/ModelCellEditorPackage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/ModelCellEditorPackage.java
index fa4ebfdd25a..dffb04d3eb0 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/ModelCellEditorPackage.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/ModelCellEditorPackage.java
@@ -44,7 +44,7 @@ public interface ModelCellEditorPackage extends EPackage {
*
* @generated
*/
- String eNS_URI = "http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"; //$NON-NLS-1$
+ String eNS_URI = "http://www.eclipse.org/papyrus/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"; //$NON-NLS-1$
/**
* The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc -->
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/impl/ModelCellEditorFactoryImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/impl/ModelCellEditorFactoryImpl.java
index 7b8c716f587..fe88f3bcde9 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/impl/ModelCellEditorFactoryImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.widgets.celleditors/src/org/eclipse/papyrus/emf/facet/widgets/celleditors/modelCellEditor/impl/ModelCellEditorFactoryImpl.java
@@ -39,7 +39,7 @@ public class ModelCellEditorFactoryImpl extends EFactoryImpl implements ModelCel
public static ModelCellEditorFactory init() {
try {
ModelCellEditorFactory theModelCellEditorFactory = (ModelCellEditorFactory) EPackage.Registry.INSTANCE
- .getEFactory("http://www.eclipse.org/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"); //$NON-NLS-1$
+ .getEFactory("http://www.eclipse.org/papyrus/EMF_Facet/ModelCellEditor/0.1.0/modelCellEditor"); //$NON-NLS-1$
if (theModelCellEditorFactory != null) {
return theModelCellEditorFactory;
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
index 726b40881f0..a466c36cd10 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
@@ -114,23 +114,24 @@ public class Activator extends AbstractUIPlugin {
* Saves the current Customization Manager settings to the preferences
*/
public void saveCustomizationManagerState() {
-// IDialogSettings dialogSettings = getBrowserCustomizationDialogSettings();
-//
-// List<MetamodelView> appliedCustomizations = getCustomizationManager().getRegisteredCustomizations();
-//
-// for(MetamodelView customization : CustomizationsCatalog.getInstance().getRegistryCustomizations()) {
-//
-// boolean isApplied = appliedCustomizations.contains(customization);
-// String settingKey = getSettingKey(customization);
-//
-// dialogSettings.put(settingKey, isApplied);
-// }
+ IDialogSettings dialogSettings = getBrowserCustomizationDialogSettings();
+ List<Customization> appliedCustomizations = getCustomizationManager().getManagedCustomizations();
+
+ final List<Customization> registeredCustomizations = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(getCustomizationManager().getResourceSet()).getRegisteredCustomizations();
+
+ for(Customization customization : registeredCustomizations) {
+
+ boolean isApplied = appliedCustomizations.contains(customization);
+ String settingKey = getSettingKey(customization);
+
+ dialogSettings.put(settingKey, isApplied);
+ }
}
private String getSettingKey(Customization customization) {
// do not exist anymore
- //return customization.getLocation();
- return "";
+ return customization.eResource().getURI().toString();
+ //return "";
}
protected IDialogSettings getBrowserCustomizationDialogSettings() {
@@ -146,10 +147,6 @@ public class Activator extends AbstractUIPlugin {
private void init(final ICustomizationManager customizationManager) {
// the appearance can be customized here:
- //customizationManager.setShowDerivedLinks(true);
- //to hide the blue arrow overlay
- //customizationManager.setDecorateExternalResources(false);
-
IDialogSettings settings = getBrowserCustomizationDialogSettings();
try {
@@ -158,29 +155,26 @@ public class Activator extends AbstractUIPlugin {
// extension
ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(customizationManager.getResourceSet());
//no possibility to get default customization
- //List<MetamodelView> registryDefaultCustomizations = customCatalog.;
+
List<Customization> registryAllCustomizations = customCatalog.getRegisteredCustomizations();
+
+
+ for(Customization customization : registryAllCustomizations) {
+ String settingKey = getSettingKey(customization);
+
+ boolean isActive = false;
+ if(settings.get(settingKey) == null) { //Never customized
+ isActive = customization.isMustBeLoadedByDefault(); //Loaded by default
+ } else {
+ isActive = settings.getBoolean(settingKey);
+ }
+
+ if(isActive) {
+ customizationManager.getManagedCustomizations().add(customization);
+ }
+ }
+
- List<Customization> appliedCustomizations = new LinkedList<Customization>();
-//
-// for(Customization customization : registryAllCustomizations) {
-// String settingKey = getSettingKey(customization);
-//
-// boolean isActive = false;
-// if(settings.get(settingKey) == null) { //Never customized
-// isActive = registryDefaultCustomizations.contains(customization); //Loaded by default
-// } else {
-// isActive = settings.getBoolean(settingKey);
-// }
-//
-// if(isActive) {
-// customizationManager.registerCustomization(customization);
-// appliedCustomizations.add(customization);
-// }
-// }
-
-// customizationManager.loadCustomizations();
-// loadFacetsForCustomizations(appliedCustomizations, customizationManager);
} catch (Throwable e) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Error initializing customizations", e)); //$NON-NLS-1$
@@ -201,13 +195,13 @@ public class Activator extends AbstractUIPlugin {
DialogSettings settings = (DialogSettings)getDialogSettings();
settings.removeSection(CUSTOMIZATION_MANAGER_SECTION);
-// List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
-//
-// manager.clearCustomizations();
-// for(MetamodelView customization : registryDefaultCustomizations) {
-// manager.registerCustomization(customization);
-// }
-// manager.loadCustomizations();
+ // List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
+ //
+ // manager.clearCustomizations();
+ // for(MetamodelView customization : registryDefaultCustomizations) {
+ // manager.registerCustomization(customization);
+ // }
+ // manager.loadCustomizations();
}
/**
@@ -218,67 +212,67 @@ public class Activator extends AbstractUIPlugin {
* @param customizationManager
* the Customization Manager
*/
-// protected void loadFacetsForCustomizations(final List<MetamodelView> customizations, final CustomizationManager customizationManager) {
-// final Set<Facet> referencedFacets = new HashSet<Facet>();
-// final Collection<FacetSet> facetSets = FacetSetCatalog.getSingleton().getAllFacetSets();
-//
-// for(MetamodelView customization : customizations) {
-// String metamodelURI = customization.getMetamodelURI();
-// // find customized FacetSet
-// FacetSet customizedFacetSet = null;
-// if(metamodelURI != null) {
-// for(FacetSet facetSet : facetSets) {
-// if(metamodelURI.equals(facetSet.getNsURI())) {
-// customizedFacetSet = facetSet;
-// break;
-// }
-// }
-// }
-// if(customizedFacetSet == null) {
-// continue;
-// }
-//
-// // find customized Facets
-// EList<TypeView> types = customization.getTypes();
-// for(TypeView typeView : types) {
-// String metaclassName = typeView.getMetaclassName();
-// Facet facet = findFacetWithFullyQualifiedName(metaclassName, customizedFacetSet);
-// if(facet != null) {
-// referencedFacets.add(facet);
-// } else {
-// Activator.log.warn(String.format("Missing required facet \"%s\" in FacetSet \"%s\" for customization \"%s\"", metaclassName, customizedFacetSet.getName(), customization.getName()));
-// }
-// }
-//
-// for(Facet referencedFacet : referencedFacets) {
-// customizationManager.loadFacet(referencedFacet);
-// }
-// }
-//
-// //
-// // for modified facets
-// // customizationManager.getInstancesForMetaclasses().buildDerivationTree();
-// // customizationManager.getAppearanceConfiguration().touch();
-// // customizationManager.refreshDelayed(true);
-// }
-
-// /**
-// * fin a facet from
-// *
-// * @param metaclassName
-// * @param customizedFacetSet
-// * @return
-// */
-// private Facet findFacetWithFullyQualifiedName(final String metaclassName, final FacetSet customizedFacetSet) {
-// EList<Facet> facets = customizedFacetSet.getFacets();
-// for(Facet facet : facets) {
-// String facetName = getMetaclassQualifiedName(facet);
-// if(metaclassName.equals(facetName)) {
-// return facet;
-// }
-// }
-// return null;
-// }
+ // protected void loadFacetsForCustomizations(final List<MetamodelView> customizations, final CustomizationManager customizationManager) {
+ // final Set<Facet> referencedFacets = new HashSet<Facet>();
+ // final Collection<FacetSet> facetSets = FacetSetCatalog.getSingleton().getAllFacetSets();
+ //
+ // for(MetamodelView customization : customizations) {
+ // String metamodelURI = customization.getMetamodelURI();
+ // // find customized FacetSet
+ // FacetSet customizedFacetSet = null;
+ // if(metamodelURI != null) {
+ // for(FacetSet facetSet : facetSets) {
+ // if(metamodelURI.equals(facetSet.getNsURI())) {
+ // customizedFacetSet = facetSet;
+ // break;
+ // }
+ // }
+ // }
+ // if(customizedFacetSet == null) {
+ // continue;
+ // }
+ //
+ // // find customized Facets
+ // EList<TypeView> types = customization.getTypes();
+ // for(TypeView typeView : types) {
+ // String metaclassName = typeView.getMetaclassName();
+ // Facet facet = findFacetWithFullyQualifiedName(metaclassName, customizedFacetSet);
+ // if(facet != null) {
+ // referencedFacets.add(facet);
+ // } else {
+ // Activator.log.warn(String.format("Missing required facet \"%s\" in FacetSet \"%s\" for customization \"%s\"", metaclassName, customizedFacetSet.getName(), customization.getName()));
+ // }
+ // }
+ //
+ // for(Facet referencedFacet : referencedFacets) {
+ // customizationManager.loadFacet(referencedFacet);
+ // }
+ // }
+ //
+ // //
+ // // for modified facets
+ // // customizationManager.getInstancesForMetaclasses().buildDerivationTree();
+ // // customizationManager.getAppearanceConfiguration().touch();
+ // // customizationManager.refreshDelayed(true);
+ // }
+
+ // /**
+ // * fin a facet from
+ // *
+ // * @param metaclassName
+ // * @param customizedFacetSet
+ // * @return
+ // */
+ // private Facet findFacetWithFullyQualifiedName(final String metaclassName, final FacetSet customizedFacetSet) {
+ // EList<Facet> facets = customizedFacetSet.getFacets();
+ // for(Facet facet : facets) {
+ // String facetName = getMetaclassQualifiedName(facet);
+ // if(metaclassName.equals(facetName)) {
+ // return facet;
+ // }
+ // }
+ // return null;
+ // }
/** @return the qualified name of the given metaclass */
public static String getMetaclassQualifiedName(final EClassifier eClass) {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom
index 9298e47f8af..550c6c7bf5f 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.modelexplorer/resources/PapyrusDiagram.custom
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" xmlns:query="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet/query" name="PapyrusDiagram">
+<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" xmlns:query="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet/query" name="PapyrusDiagram" documentation="Display contained diagram and their icons">
<eClassifiers xsi:type="custom:EClassCustomization" name="Diagram" documentation="Representation of diagram in model explorer">
<extendedMetaclass href="http://www.eclipse.org/gmf/runtime/1.0.2/notation#//Diagram"/>
<facetOperations name="GetDiagramIcon" documentation="Return the path to the icon of the corresponding diagram">
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SimpleSysML.custom b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SimpleSysML.custom
index 06b4649b065..941b5c86251 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SimpleSysML.custom
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SimpleSysML.custom
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="SimpleSysML">
+<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="SimpleSysML" documentation="Display SysML elements">
<eClassifiers xsi:type="custom:EClassCustomization" name="SysMLElement">
- <extendedMetaclass href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
+ <extendedMetaclass href="http://www.eclipse.org/uml2/5.0.0/UML#//Element"/>
<facetOperations name="GetSysMLElementIcon">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/papyrus/emf/facet/custom/0.2.incubation/custom_primitive_types#//Image"/>
<eParameters name="eStructuralElement">
@@ -12,7 +12,7 @@
</facetOperations>
</eClassifiers>
<eClassifiers xsi:type="custom:EClassCustomization" name="NamedElement">
- <extendedMetaclass href="http://www.eclipse.org/uml2/4.0.0/UML#//NamedElement"/>
+ <extendedMetaclass href="http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement"/>
<facetOperations name="GetSysMLElementLabel">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="eObject">
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom
index 631932658a5..fd5e6ff90e8 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/SimpleUML.custom
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="SimpleUML">
- <eClassifiers xsi:type="custom:EClassCustomization" name="Package">
- <extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="SimpleUML" documentation="Display structure of UML base model" mustBeLoadedByDefault="true">
+ <eClassifiers xsi:type="custom:EClassCustomization" name="Element">
+ <extendedMetaclass href="http://www.eclipse.org/uml2/5.0.0/UML#//Element"/>
<facetOperations name="DisplayOnlyContainamentReferences">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eParameters name="eStructuralFeature">
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/StereotypeDisplay.custom b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/StereotypeDisplay.custom
index 456235e7043..4f2e351c2aa 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/StereotypeDisplay.custom
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/resource/StereotypeDisplay.custom
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="StereotypeDisplay">
+<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="StereotypeDisplay" documentation="Used to display Stereotype Application">
<eClassifiers xsi:type="custom:EClassCustomization" name="Element">
- <extendedMetaclass href="http://www.eclipse.org/uml2/4.0.0/UML#//NamedElement"/>
+ <extendedMetaclass href="http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement"/>
<facetOperations name="DisplayStereotype">
<eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eParameters name="eObject">
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java
index 8d5587c364e..265e4ca5643 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerHandler.java
@@ -13,11 +13,24 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.modelexplorer.handler;
+import java.util.LinkedList;
+import java.util.List;
+
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManager;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManagerFactory;
import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
import org.eclipse.papyrus.views.modelexplorer.Activator;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.navigator.CommonNavigator;
/**
* A Handler to toggle the Advanced/Simple UML ModelExplorer customization
@@ -42,56 +55,60 @@ public class ToggleAdvancedModelExplorerHandler extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
- //State state = event.getCommand().getState("org.eclipse.papyrus.uml.modelexplorer.customization.advanced.state");
+ ICustomizationManager customizationManager = Activator.getDefault().getCustomizationManager();
+ if(customizationManager != null) {
+ if(event.getTrigger() instanceof Event) {
+ if(((Event)event.getTrigger()).widget instanceof ToolItem) {
+ ToolItem item = (ToolItem)((Event)event.getTrigger()).widget;
+ ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(customizationManager.getResourceSet());
+ Customization simpleUMLCustomization = null;
+ //look for SIMPLE UML Customization
+ for(Customization customization : customCatalog.getRegisteredCustomizations()) {
+ if(SIMPLE_UML_CUSTOMIZATION.equals(customization.getName())){
+ simpleUMLCustomization= customization;
+ }
+ }
- ICustomizationManager customizationManager = Activator.getDefault().getCustomizationManager();
-// if(customizationManager != null) {
-// if(event.getTrigger() instanceof Event) {
-// if(((Event)event.getTrigger()).widget instanceof ToolItem) {
-// ToolItem item = (ToolItem)((Event)event.getTrigger()).widget;
-//
-// MetamodelView simpleUMLCustomization = CustomizationsCatalog.getInstance().getCustomization(SIMPLE_UML_CUSTOMIZATION);
-// if(simpleUMLCustomization != null) {
-// if(item.getSelection()) {
-//
-// //Advanced view
-// List<MetamodelView> registeredCustomizations = new LinkedList<MetamodelView>(customizationManager.getRegisteredCustomizations());
-// if(registeredCustomizations.remove(simpleUMLCustomization)) {
-// customizationManager.clearCustomizations();
-// for(MetamodelView customization : registeredCustomizations) {
-// customizationManager.registerCustomization(customization);
-// }
-// } else {
-// //No change
-// return null;
-// }
-//
-// } else {
-// //Simple view
-// if(customizationManager.getRegisteredCustomizations().contains(simpleUMLCustomization)) {
-// return null; //No change
-// }
-//
-// customizationManager.registerCustomization(simpleUMLCustomization);
-// }
-//
-// customizationManager.loadCustomizations();
-// //Save the current state of the customizations
-// org.eclipse.papyrus.infra.emf.Activator.getDefault().saveCustomizationManagerState();
-// }
-// }
-//
-// }
-// }
-//
-// IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
-// if(activePart instanceof ModelExplorerPageBookView) {
-// IViewPart page = ((ModelExplorerPageBookView)activePart).getActiveView();
-// if(page instanceof CommonNavigator) {
-// ((CommonNavigator)page).getCommonViewer().refresh();
-// }
-// }
+ if(simpleUMLCustomization != null) {
+ if(item.getSelection()) {
+
+ //Advanced view
+ List<Customization> registeredCustomizations = new LinkedList<Customization>(customizationManager.getManagedCustomizations());
+ if(registeredCustomizations.remove(simpleUMLCustomization)) {
+ customizationManager.getManagedCustomizations().clear();
+ for(Customization customization : registeredCustomizations) {
+ customizationManager.getManagedCustomizations().add(customization);
+ }
+ } else {
+ //No change
+ return null;
+ }
+
+ } else {
+ //Simple view
+ if(customizationManager.getManagedCustomizations().contains(simpleUMLCustomization)) {
+ return null; //No change
+ }
+
+ customizationManager.getManagedCustomizations().add(0,simpleUMLCustomization);
+ }
+
+ //Save the current state of the customizations
+ org.eclipse.papyrus.infra.emf.Activator.getDefault().saveCustomizationManagerState();
+ }
+ }
+
+ }
+ }
+
+ IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
+ if(activePart instanceof ModelExplorerPageBookView) {
+ IViewPart page = ((ModelExplorerPageBookView)activePart).getActiveView();
+ if(page instanceof CommonNavigator) {
+ ((CommonNavigator)page).getCommonViewer().refresh();
+ }
+ }
return null;
}
diff --git a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java
index 4522c28ce36..809c40cd80f 100644
--- a/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java
+++ b/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer/src/org/eclipse/papyrus/uml/modelexplorer/handler/ToggleAdvancedModelExplorerState.java
@@ -14,6 +14,11 @@
package org.eclipse.papyrus.uml.modelexplorer.handler;
import org.eclipse.core.commands.State;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManager;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationCatalogManagerFactory;
+import org.eclipse.papyrus.emf.facet.custom.core.ICustomizationManager;
+import org.eclipse.papyrus.emf.facet.custom.metamodel.v0_2_0.custom.Customization;
+import org.eclipse.papyrus.views.modelexplorer.Activator;
/**
* State for the AdvancedModelExplorer toggle action
@@ -29,17 +34,26 @@ public class ToggleAdvancedModelExplorerState extends State {
@Override
public Boolean getValue() {
-// MetamodelView simpleUMLCustomization = CustomizationsCatalog.getInstance().getCustomization(ToggleAdvancedModelExplorerHandler.SIMPLE_UML_CUSTOMIZATION);
-// if(simpleUMLCustomization == null) {
-// //The SimpleUML Customization doesn't exist. The advanced mode is activated
-// return true;
-// }
-//
-// ICustomizationManager customizationManager = Activator.getDefault().getCustomizationManager();
-// if(customizationManager == null) {
-// //Should not happen, this is a singleton
-// return false;
-// }
+ ICustomizationManager customizationManager = Activator.getDefault().getCustomizationManager();
+ ICustomizationCatalogManager customCatalog = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(customizationManager.getResourceSet());
+ Customization simpleUMLCustomization = null;
+
+ //look for SIMPLE UML Customization
+ for(Customization customization : customCatalog.getRegisteredCustomizations()) {
+ if(ToggleAdvancedModelExplorerHandler.SIMPLE_UML_CUSTOMIZATION.equals(customization.getName())){
+ simpleUMLCustomization= customization;
+ }
+ }
+
+ if(simpleUMLCustomization == null) {
+ //The SimpleUML Customization doesn't exist. The advanced mode is activated
+ return true;
+ }
+
+ if(customizationManager == null) {
+ //Should not happen, this is a singleton
+ return false;
+ }
return false;
//return !customizationManager.getRegisteredCustomizations().contains(simpleUMLCustomization);
}
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/OpenedPage.custom b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/OpenedPage.custom
index 685ba7d5bbf..4b529da8183 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/OpenedPage.custom
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/OpenedPage.custom
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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:customQuery="http://www.eclipse.org/papyrus/emf/facet/custom/0.3.incubation/query" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:efacet="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet" xmlns:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="OpenedPage">
+<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:customQuery="http://www.eclipse.org/papyrus/emf/facet/custom/0.3.incubation/query" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:efacet="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet" xmlns:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" name="OpenedPage" documentation="Add icon to display opened Page" mustBeLoadedByDefault="true">
<eClassifiers xsi:type="efacet:Facet" name="PapyrusPage" instanceClassName="" documentation="a page can be a table or a diagram for example" conformanceTypedElement="//PapyrusPage/isPage">
<extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
<facetOperations name="isPage">
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/ReadOnlyElement.custom b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/ReadOnlyElement.custom
index a6bf25fd71f..b29412acb2b 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/ReadOnlyElement.custom
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/resources/ReadOnlyElement.custom
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" xmlns:query="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet/query" name="ReadOnlyElement">
+<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:javaQuery="http://www.eclipse.org/papyrus/emf/facet/query/java/0.2.incubation/javaquery" xmlns:query="http://www.eclipse.org/papyrus/emf/facet/efacet/0.2.incubation/efacet/query" name="ReadOnlyElement" documentation="Add appearance of read only element" mustBeLoadedByDefault="true">
<eClassifiers xsi:type="efacet:Facet" name="ReadOnlyEObject" instanceClassName="" documentation="a page can be a table or a diagram for example" conformanceTypedElement="//ReadOnlyEObject/isReadOnly">
<extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
<facetOperations name="isReadOnly" documentation="test if the eObject is read only">
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
index d1819aa0689..639ad3136e2 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/LoadBrowserCustomization.java
@@ -97,49 +97,39 @@ public class LoadBrowserCustomization extends AbstractHandler {
final List<Customization> registeredCustomizations = ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(customizationManager.getResourceSet()).getRegisteredCustomizations();
PapyrusLoadBrowserCustomizationDialog loadCustomizationsDialog;
-
- Shell shell = HandlerUtil.getActiveShell(event);
- IDialogCallbackWithPreCommit<List<Customization>, Boolean, Dialog> dialogCallBack= new IDialogCallbackWithPreCommit<List<Customization>, Boolean, Dialog>() {
- public void committed(List<Customization> result, Boolean precommitResult) {
- // TODO Auto-generated method stub
-
- }
+ Shell shell = HandlerUtil.getActiveShell(event);
+ IDialogCallbackWithPreCommit<List<Customization>, Boolean, Dialog> dialogCallBack= new IDialogCallbackWithPreCommit<List<Customization>, Boolean, Dialog>() {
+
+ public void committed(List<Customization> result, Boolean precommitResult) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Dialog openPrecommitDialog(List<Customization> result, IDialogCallback<Boolean> precommitCallback) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+ ILoadCustomizationsDialog dialog=ILoadCustomizationsDialogFactory.DEFAULT.createLoadCustomizationDialog(shell, registeredCustomizations, customizationManager.getManagedCustomizations(), dialogCallBack);
- public Dialog openPrecommitDialog(List<Customization> result, IDialogCallback<Boolean> precommitCallback) {
- // TODO Auto-generated method stub
- return null;
- }
- };
- ILoadCustomizationsDialog dialog=ILoadCustomizationsDialogFactory.DEFAULT.createLoadCustomizationDialog(shell, registeredCustomizations, customizationManager.getManagedCustomizations(), dialogCallBack);
-//
-// try {
-// ServicesRegistry registry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event);
-// loadCustomizationsDialog = new PapyrusLoadBrowserCustomizationDialog(shell, registeredCustomizations, getMetamodels(registry));
-// } catch (ServiceException ex) {
-// Activator.log.error(ex);
-// loadCustomizationsDialog = new PapyrusLoadBrowserCustomizationDialog(shell, registeredCustomizations, Collections.<EPackage> emptyList());
-// }
-//
if(Window.OK == dialog.open()) {
customizationManager.getManagedCustomizations().clear();
customizationManager.getManagedCustomizations().addAll( dialog.getSelectedCustomizations());
-//
-// //Save the current state of the customizations
-// org.eclipse.papyrus.infra.emf.Activator.getDefault().saveCustomizationManagerState();
-// } catch (final Exception e) {
-// Activator.log.error(e);
-// }
-// }
-// // load customizations defined as default through the customization
-// // extension
+
+ //Save the current state of the customizations
+ org.eclipse.papyrus.infra.emf.Activator.getDefault().saveCustomizationManagerState();
+ }
+
+ // // load customizations defined as default through the customization
+ // // extension
if(getCommonNavigator() != null) {
getCommonNavigator().getCommonViewer().refresh();
}
}
- }
+
return null;
}
@@ -151,75 +141,75 @@ public class LoadBrowserCustomization extends AbstractHandler {
return ModelUtils.getModelSet();
}
-// /**
-// * load the facets
-// *
-// * @param customizations
-// * list of customization
-// * @param customizationManager
-// * the Customization Manager
-// */
-// protected void loadFacetsForCustomizations(final List<MetamodelView> customizations, final CustomizationManager customizationManager) {
-// final Set<Facet> referencedFacets = new HashSet<Facet>();
-// final Collection<FacetSet> facetSets = FacetSetCatalog.getSingleton().getAllFacetSets();
-//
-// for(MetamodelView customization : customizations) {
-// String metamodelURI = customization.getMetamodelURI();
-// // find customized FacetSet
-// FacetSet customizedFacetSet = null;
-// if(metamodelURI != null) {
-// for(FacetSet facetSet : facetSets) {
-// if(metamodelURI.equals(facetSet.getNsURI())) {
-// customizedFacetSet = facetSet;
-// break;
-// }
-// }
-// }
-// if(customizedFacetSet == null) {
-// continue;
-// }
-//
-// // find customized Facets
-// EList<TypeView> types = customization.getTypes();
-// for(TypeView typeView : types) {
-// String metaclassName = typeView.getMetaclassName();
-// Facet facet = findFacetWithFullyQualifiedName(metaclassName, customizedFacetSet);
-// if(facet != null) {
-// referencedFacets.add(facet);
-// } else {
-// Activator.log.warn(NLS.bind(Messages.BrowserActionBarContributor_missingRequiredFacet, new Object[]{ metaclassName, customizedFacetSet.getName(), customization.getName() }));
-// }
-// }
-//
-// for(Facet referencedFacet : referencedFacets) {
-// customizationManager.loadFacet(referencedFacet);
-// }
-// }
+ // /**
+ // * load the facets
+ // *
+ // * @param customizations
+ // * list of customization
+ // * @param customizationManager
+ // * the Customization Manager
+ // */
+ // protected void loadFacetsForCustomizations(final List<MetamodelView> customizations, final CustomizationManager customizationManager) {
+ // final Set<Facet> referencedFacets = new HashSet<Facet>();
+ // final Collection<FacetSet> facetSets = FacetSetCatalog.getSingleton().getAllFacetSets();
+ //
+ // for(MetamodelView customization : customizations) {
+ // String metamodelURI = customization.getMetamodelURI();
+ // // find customized FacetSet
+ // FacetSet customizedFacetSet = null;
+ // if(metamodelURI != null) {
+ // for(FacetSet facetSet : facetSets) {
+ // if(metamodelURI.equals(facetSet.getNsURI())) {
+ // customizedFacetSet = facetSet;
+ // break;
+ // }
+ // }
+ // }
+ // if(customizedFacetSet == null) {
+ // continue;
+ // }
+ //
+ // // find customized Facets
+ // EList<TypeView> types = customization.getTypes();
+ // for(TypeView typeView : types) {
+ // String metaclassName = typeView.getMetaclassName();
+ // Facet facet = findFacetWithFullyQualifiedName(metaclassName, customizedFacetSet);
+ // if(facet != null) {
+ // referencedFacets.add(facet);
+ // } else {
+ // Activator.log.warn(NLS.bind(Messages.BrowserActionBarContributor_missingRequiredFacet, new Object[]{ metaclassName, customizedFacetSet.getName(), customization.getName() }));
+ // }
+ // }
+ //
+ // for(Facet referencedFacet : referencedFacets) {
+ // customizationManager.loadFacet(referencedFacet);
+ // }
+ // }
- //
- // for modified facets
- // customizationManager.getInstancesForMetaclasses().buildDerivationTree();
- // customizationManager.getAppearanceConfiguration().touch();
- // customizationManager.refreshDelayed(true);
+ //
+ // for modified facets
+ // customizationManager.getInstancesForMetaclasses().buildDerivationTree();
+ // customizationManager.getAppearanceConfiguration().touch();
+ // customizationManager.refreshDelayed(true);
//}
-// /**
-// * fin a facet from
-// *
-// * @param metaclassName
-// * @param customizedFacetSet
-// * @return
-// */
-// private Facet findFacetWithFullyQualifiedName(final String metaclassName, final FacetSet customizedFacetSet) {
-// EList<Facet> facets = customizedFacetSet.getFacets();
-// for(Facet facet : facets) {
-// String facetName = getMetaclassQualifiedName(facet);
-// if(metaclassName.equals(facetName)) {
-// return facet;
-// }
-// }
-// return null;
-// }
+ // /**
+ // * fin a facet from
+ // *
+ // * @param metaclassName
+ // * @param customizedFacetSet
+ // * @return
+ // */
+ // private Facet findFacetWithFullyQualifiedName(final String metaclassName, final FacetSet customizedFacetSet) {
+ // EList<Facet> facets = customizedFacetSet.getFacets();
+ // for(Facet facet : facets) {
+ // String facetName = getMetaclassQualifiedName(facet);
+ // if(metaclassName.equals(facetName)) {
+ // return facet;
+ // }
+ // }
+ // return null;
+ // }
/** @return the qualified name of the given metaclass */
public static String getMetaclassQualifiedName(final EClassifier eClass) {

Back to the top