Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-11-24 16:26:11 -0500
committerGerrit Code Review @ Eclipse.org2015-11-26 14:57:19 -0500
commit50c6b2c7f4b90cdfd1272d9d049decdcfa8c33c5 (patch)
treeb7482ee723eca18081d06c408ebc2a031a91cdef /plugins/views/properties
parent50d72f8ec11d7157ce700a1e7744d6bbc8b35b99 (diff)
downloadorg.eclipse.papyrus-50c6b2c7f4b90cdfd1272d9d049decdcfa8c33c5.tar.gz
org.eclipse.papyrus-50c6b2c7f4b90cdfd1272d9d049decdcfa8c33c5.tar.xz
org.eclipse.papyrus-50c6b2c7f4b90cdfd1272d9d049decdcfa8c33c5.zip
Bug 482927: [Properties] Customization context models should have UI labels
https://bugs.eclipse.org/bugs/show_bug.cgi?id=482927 Add an optional 'label' attribute to the Context class and a derived 'userLabel' that is the 'label' if present, otherwise the 'name'. Use the new derived user label wherever appropriate in the UI: in progress monitors, informational dialogs, and especially the preference pages. In the "Property view" preference page, sort contexts by user label. Update existing context models to provide user-friendly labels.
Diffstat (limited to 'plugins/views/properties')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/plugin.properties2
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/src-gen/org/eclipse/papyrus/views/properties/contexts/provider/ContextItemProvider.java138
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore18
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.genmodel10
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/Context.java56
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/ContextsPackage.java67
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextImpl.java97
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsPackageImpl.java42
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java117
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java19
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/preferences/Preferences.java18
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationConflict.java5
12 files changed, 449 insertions, 140 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/plugin.properties b/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/plugin.properties
index 9ace5ca14ec..06040fc6ce1 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/plugin.properties
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/plugin.properties
@@ -187,3 +187,5 @@ _UI_Context_description_feature = Description
_UI_Context_version_feature = Version
_UI_Context_prototype_feature = Prototype
_UI_Type_Double_literal = Double
+_UI_Context_label_feature = Label
+_UI_Context_userLabel_feature = User Label
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/src-gen/org/eclipse/papyrus/views/properties/contexts/provider/ContextItemProvider.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/src-gen/org/eclipse/papyrus/views/properties/contexts/provider/ContextItemProvider.java
index 1ae95f57828..9530d3cdf5d 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/src-gen/org/eclipse/papyrus/views/properties/contexts/provider/ContextItemProvider.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model.edit/src-gen/org/eclipse/papyrus/views/properties/contexts/provider/ContextItemProvider.java
@@ -1,9 +1,15 @@
-/**
- * <copyright>
- * </copyright>
+/*****************************************************************************
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
- * $Id$
- */
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 482927
+ *****************************************************************************/
package org.eclipse.papyrus.views.properties.contexts.provider;
@@ -59,6 +65,7 @@ public class ContextItemProvider
addNamePropertyDescriptor(object);
addDependenciesPropertyDescriptor(object);
addPrototypePropertyDescriptor(object);
+ addLabelPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -71,19 +78,17 @@ public class ContextItemProvider
* @generated
*/
protected void addNamePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Context_name_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Context_name_feature", "_UI_Context_type"),
- ContextsPackage.Literals.CONTEXT__NAME,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Context_name_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Context_name_feature", "_UI_Context_type"),
+ ContextsPackage.Literals.CONTEXT__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
}
/**
@@ -94,19 +99,17 @@ public class ContextItemProvider
* @generated
*/
protected void addDependenciesPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Context_dependencies_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Context_dependencies_feature", "_UI_Context_type"),
- ContextsPackage.Literals.CONTEXT__DEPENDENCIES,
- true,
- false,
- true,
- null,
- null,
- null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Context_dependencies_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Context_dependencies_feature", "_UI_Context_type"),
+ ContextsPackage.Literals.CONTEXT__DEPENDENCIES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
}
/**
@@ -117,23 +120,43 @@ public class ContextItemProvider
* @generated
*/
protected void addPrototypePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Context_prototype_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Context_prototype_feature", "_UI_Context_type"),
- ContextsPackage.Literals.CONTEXT__PROTOTYPE,
- true,
- false,
- true,
- null,
- null,
- null));
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Context_prototype_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Context_prototype_feature", "_UI_Context_type"),
+ ContextsPackage.Literals.CONTEXT__PROTOTYPE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Label feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addLabelPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_Context_label_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_Context_label_feature", "_UI_Context_type"),
+ ContextsPackage.Literals.CONTEXT__LABEL,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
}
/**
- * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -186,10 +209,8 @@ public class ContextItemProvider
*/
@Override
public String getText(Object object) {
- String label = ((Context) object).getName();
- return label == null || label.length() == 0 ?
- getString("_UI_Context_type") :
- getString("_UI_Context_type") + " " + label;
+ String label = ((Context) object).getUserLabel();
+ return label == null || label.length() == 0 ? getString("_UI_Context_type") : getString("_UI_Context_type") + " " + label;
}
/**
@@ -206,6 +227,7 @@ public class ContextItemProvider
switch (notification.getFeatureID(Context.class)) {
case ContextsPackage.CONTEXT__NAME:
+ case ContextsPackage.CONTEXT__LABEL:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case ContextsPackage.CONTEXT__TABS:
@@ -229,20 +251,14 @@ public class ContextItemProvider
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
- newChildDescriptors.add
- (createChildParameter
- (ContextsPackage.Literals.CONTEXT__TABS,
- ContextsFactory.eINSTANCE.createTab()));
+ newChildDescriptors.add(createChildParameter(ContextsPackage.Literals.CONTEXT__TABS,
+ ContextsFactory.eINSTANCE.createTab()));
- newChildDescriptors.add
- (createChildParameter
- (ContextsPackage.Literals.CONTEXT__VIEWS,
- ContextsFactory.eINSTANCE.createView()));
+ newChildDescriptors.add(createChildParameter(ContextsPackage.Literals.CONTEXT__VIEWS,
+ ContextsFactory.eINSTANCE.createView()));
- newChildDescriptors.add
- (createChildParameter
- (ContextsPackage.Literals.CONTEXT__DATA_CONTEXTS,
- ContextsFactory.eINSTANCE.createDataContextRoot()));
+ newChildDescriptors.add(createChildParameter(ContextsPackage.Literals.CONTEXT__DATA_CONTEXTS,
+ ContextsFactory.eINSTANCE.createDataContextRoot()));
}
/**
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore
index 017ab06dada..ae83db31ffe 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.ecore
@@ -68,7 +68,11 @@
nsPrefix="contexts">
<eClassifiers xsi:type="ecore:EClass" name="Context" eSuperTypes="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EModelElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="An unique name for the context, which is used in various components to&#xA;identify it."/>
+ </eAnnotations>
+ </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="dependencies" ordered="false"
upperBound="-1" eType="#//contexts/Context"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="tabs" upperBound="-1"
@@ -82,6 +86,18 @@
<details key="documentation" value="References the context from which a context was copied. The context manager caches the prototype reference so that it can enable a prototype when the copied context is not available."/>
</eAnnotations>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="label" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="A potentially translatable (localizable) label for presentation of the context&#xA;in the user interface. If absent, the name should be used in its place."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="userLabel" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ changeable="false" volatile="true" transient="true" derived="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="A computed label for presentation to the user: the label, if available, otherwise&#xA;just the name of the context."/>
+ </eAnnotations>
+ </eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Tab">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="label" lowerBound="1"
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.genmodel b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.genmodel
index 594d76c7840..efda9294977 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.genmodel
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/Model/Properties.genmodel
@@ -4,10 +4,12 @@
editDirectory="/org.eclipse.papyrus.views.properties.model.edit/src-gen" editorDirectory="/org.eclipse.papyrus.views.properties.model.editor/src-gen"
modelPluginID="org.eclipse.papyrus.views.properties.model" modelName="Properties"
editorPluginClass="org.eclipse.papyrus.views.properties.environment.presentation.PropertiesEditorPlugin"
- testsDirectory="/org.eclipse.papyrus.views.properties.model.tests/src-gen" testSuiteClass="org.eclipse.papyrus.views.properties.environment.tests.PropertiesAllTests"
+ codeFormatting="true" commentFormatting="true" testsDirectory="/org.eclipse.papyrus.views.properties.model.tests/src-gen"
+ testSuiteClass="org.eclipse.papyrus.views.properties.environment.tests.PropertiesAllTests"
importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" copyrightFields="false"
editPluginID="org.eclipse.papyrus.views.properties.model.edit" editorPluginID="org.eclipse.papyrus.views.properties.model.editor"
- runtimeVersion="2.10" usedGenPackages="../../org.eclipse.papyrus.infra.constraints/Model/Constraints.genmodel#//constraints platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
+ runtimeVersion="2.10" usedGenPackages="../../org.eclipse.papyrus.infra.constraints/Model/Constraints.genmodel#//constraints platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore"
+ cleanup="true">
<foreignModel>Properties.ecore</foreignModel>
<genPackages prefix="Properties" basePackage="org.eclipse.papyrus" disposableProviderFactory="true"
ecorePackage="Properties.ecore#/" publicationLocation="">
@@ -61,7 +63,7 @@
</nestedGenPackages>
<nestedGenPackages prefix="Contexts" basePackage="org.eclipse.papyrus.views.properties"
resource="XMI" disposableProviderFactory="true" fileExtensions="ctx" ecorePackage="Properties.ecore#//contexts">
- <genClasses ecoreClass="Properties.ecore#//contexts/Context">
+ <genClasses ecoreClass="Properties.ecore#//contexts/Context" labelFeature="#//properties/contexts/Context/userLabel">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//contexts/Context/name"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference Properties.ecore#//contexts/Context/dependencies"/>
@@ -70,6 +72,8 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Properties.ecore#//contexts/Context/dataContexts"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference Properties.ecore#//contexts/Context/prototype"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//contexts/Context/label"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//contexts/Context/userLabel"/>
</genClasses>
<genClasses ecoreClass="Properties.ecore#//contexts/Tab">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute Properties.ecore#//contexts/Tab/label"/>
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/Context.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/Context.java
index 4b7a42e2023..ff8d4ac865c 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/Context.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/Context.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2013 CEA LIST.
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Christian W. Damus - add prototype reference to Context (CDO)
+ * Christian W. Damus - bug 482927
*****************************************************************************/
package org.eclipse.papyrus.views.properties.contexts;
@@ -22,6 +23,7 @@ import org.eclipse.emf.ecore.EModelElement;
*
* <p>
* The following features are supported:
+ * </p>
* <ul>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.Context#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.Context#getDependencies <em>Dependencies</em>}</li>
@@ -29,8 +31,9 @@ import org.eclipse.emf.ecore.EModelElement;
* <li>{@link org.eclipse.papyrus.views.properties.contexts.Context#getViews <em>Views</em>}</li>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.Context#getDataContexts <em>Data Contexts</em>}</li>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.Context#getPrototype <em>Prototype</em>}</li>
+ * <li>{@link org.eclipse.papyrus.views.properties.contexts.Context#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.papyrus.views.properties.contexts.Context#getUserLabel <em>User Label</em>}</li>
* </ul>
- * </p>
*
* @see org.eclipse.papyrus.views.properties.contexts.ContextsPackage#getContext()
* @model
@@ -44,6 +47,10 @@ public interface Context extends EModelElement {
* If the meaning of the '<em>Name</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * An unique name for the context, which is used in various components to
+ * identify it.
+ * <!-- end-model-doc -->
*
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
@@ -159,4 +166,49 @@ public interface Context extends EModelElement {
*/
void setPrototype(Context value);
+ /**
+ * Returns the value of the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * A potentially translatable (localizable) label for presentation of the context
+ * in the user interface. If absent, the name should be used in its place.
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Label</em>' attribute.
+ * @see #setLabel(String)
+ * @see org.eclipse.papyrus.views.properties.contexts.ContextsPackage#getContext_Label()
+ * @model
+ * @generated
+ */
+ String getLabel();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.views.properties.contexts.Context#getLabel <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Label</em>' attribute.
+ * @see #getLabel()
+ * @generated
+ */
+ void setLabel(String value);
+
+ /**
+ * Returns the value of the '<em><b>User Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * A computed label for presentation to the user: the label, if available, otherwise
+ * just the name of the context.
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>User Label</em>' attribute.
+ * @see org.eclipse.papyrus.views.properties.contexts.ContextsPackage#getContext_UserLabel()
+ * @model required="true" transient="true" changeable="false" volatile="true" derived="true"
+ * @generated
+ */
+ String getUserLabel();
+
} // Context
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/ContextsPackage.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/ContextsPackage.java
index e11c1c45b42..56610a6a8d8 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/ContextsPackage.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/ContextsPackage.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2013 CEA LIST.
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Christian W. Damus - add prototype reference to Context (CDO)
+ * Christian W. Damus - bug 482927
*****************************************************************************/
package org.eclipse.papyrus.views.properties.contexts;
@@ -155,6 +156,26 @@ public interface ContextsPackage extends EPackage {
int CONTEXT__PROTOTYPE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 5;
/**
+ * The feature id for the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTEXT__LABEL = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 6;
+
+ /**
+ * The feature id for the '<em><b>User Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int CONTEXT__USER_LABEL = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 7;
+
+ /**
* The number of structural features of the '<em>Context</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -162,7 +183,7 @@ public interface ContextsPackage extends EPackage {
* @generated
* @ordered
*/
- int CONTEXT_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 6;
+ int CONTEXT_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 8;
/**
* The meta object id for the '{@link org.eclipse.papyrus.views.properties.contexts.impl.TabImpl <em>Tab</em>}' class.
@@ -907,6 +928,30 @@ public interface ContextsPackage extends EPackage {
EReference getContext_Prototype();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.views.properties.contexts.Context#getLabel <em>Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Label</em>'.
+ * @see org.eclipse.papyrus.views.properties.contexts.Context#getLabel()
+ * @see #getContext()
+ * @generated
+ */
+ EAttribute getContext_Label();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.views.properties.contexts.Context#getUserLabel <em>User Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>User Label</em>'.
+ * @see org.eclipse.papyrus.views.properties.contexts.Context#getUserLabel()
+ * @see #getContext()
+ * @generated
+ */
+ EAttribute getContext_UserLabel();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.papyrus.views.properties.contexts.Tab <em>Tab</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1445,6 +1490,24 @@ public interface ContextsPackage extends EPackage {
EReference CONTEXT__PROTOTYPE = eINSTANCE.getContext_Prototype();
/**
+ * The meta object literal for the '<em><b>Label</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute CONTEXT__LABEL = eINSTANCE.getContext_Label();
+
+ /**
+ * The meta object literal for the '<em><b>User Label</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute CONTEXT__USER_LABEL = eINSTANCE.getContext_UserLabel();
+
+ /**
* The meta object literal for the '{@link org.eclipse.papyrus.views.properties.contexts.impl.TabImpl <em>Tab</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextImpl.java
index 6aa7e440b0a..01dcd080aac 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextImpl.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextImpl.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2013 CEA LIST.
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Christian W. Damus - add prototype reference to Context (CDO)
+ * Christian W. Damus - bug 482927
*****************************************************************************/
package org.eclipse.papyrus.views.properties.contexts.impl;
@@ -37,6 +38,7 @@ import org.eclipse.papyrus.views.properties.contexts.View;
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
+ * </p>
* <ul>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.impl.ContextImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.impl.ContextImpl#getDependencies <em>Dependencies</em>}</li>
@@ -44,8 +46,9 @@ import org.eclipse.papyrus.views.properties.contexts.View;
* <li>{@link org.eclipse.papyrus.views.properties.contexts.impl.ContextImpl#getViews <em>Views</em>}</li>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.impl.ContextImpl#getDataContexts <em>Data Contexts</em>}</li>
* <li>{@link org.eclipse.papyrus.views.properties.contexts.impl.ContextImpl#getPrototype <em>Prototype</em>}</li>
+ * <li>{@link org.eclipse.papyrus.views.properties.contexts.impl.ContextImpl#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.papyrus.views.properties.contexts.impl.ContextImpl#getUserLabel <em>User Label</em>}</li>
* </ul>
- * </p>
*
* @generated
*/
@@ -128,6 +131,39 @@ public class ContextImpl extends EModelElementImpl implements Context {
protected Context prototype;
/**
+ * The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected static final String LABEL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected String label = LABEL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUserLabel() <em>User Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getUserLabel()
+ * @generated
+ * @ordered
+ */
+ protected static final String USER_LABEL_EDEFAULT = null;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
@@ -281,6 +317,47 @@ public class ContextImpl extends EModelElementImpl implements Context {
*
* @generated
*/
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void setLabel(String newLabel) {
+ String oldLabel = label;
+ label = newLabel;
+ if (eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, ContextsPackage.CONTEXT__LABEL, oldLabel, label));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ @Override
+ public String getUserLabel() {
+ String result = getLabel();
+ if ((result == null) || result.isEmpty()) {
+ result = getName();
+ }
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
@@ -334,6 +411,10 @@ public class ContextImpl extends EModelElementImpl implements Context {
return getPrototype();
}
return basicGetPrototype();
+ case ContextsPackage.CONTEXT__LABEL:
+ return getLabel();
+ case ContextsPackage.CONTEXT__USER_LABEL:
+ return getUserLabel();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -370,6 +451,9 @@ public class ContextImpl extends EModelElementImpl implements Context {
case ContextsPackage.CONTEXT__PROTOTYPE:
setPrototype((Context) newValue);
return;
+ case ContextsPackage.CONTEXT__LABEL:
+ setLabel((String) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -401,6 +485,9 @@ public class ContextImpl extends EModelElementImpl implements Context {
case ContextsPackage.CONTEXT__PROTOTYPE:
setPrototype((Context) null);
return;
+ case ContextsPackage.CONTEXT__LABEL:
+ setLabel(LABEL_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -426,6 +513,10 @@ public class ContextImpl extends EModelElementImpl implements Context {
return dataContexts != null && !dataContexts.isEmpty();
case ContextsPackage.CONTEXT__PROTOTYPE:
return prototype != null;
+ case ContextsPackage.CONTEXT__LABEL:
+ return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
+ case ContextsPackage.CONTEXT__USER_LABEL:
+ return USER_LABEL_EDEFAULT == null ? getUserLabel() != null : !USER_LABEL_EDEFAULT.equals(getUserLabel());
}
return super.eIsSet(featureID);
}
@@ -445,6 +536,8 @@ public class ContextImpl extends EModelElementImpl implements Context {
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
+ result.append(", label: ");
+ result.append(label);
result.append(')');
return result.toString();
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsPackageImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsPackageImpl.java
index 9c6ef4f043c..82d38ce1ae6 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsPackageImpl.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/impl/ContextsPackageImpl.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011, 2013 CEA LIST.
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Christian W. Damus - add prototype reference to Context (CDO)
+ * Christian W. Damus - bug 482927
*****************************************************************************/
package org.eclipse.papyrus.views.properties.contexts.impl;
@@ -116,10 +117,15 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage
private EClass dataContextRootEClass = null;
/**
- * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* <p>
- * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see org.eclipse.papyrus.views.properties.contexts.ContextsPackage#eNS_URI
@@ -142,7 +148,9 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>
- * This method is used to initialize {@link ContextsPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. <!-- begin-user-doc --> <!-- end-user-doc -->
+ * This method is used to initialize {@link ContextsPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #eNS_URI
* @see #createPackageContents()
@@ -271,6 +279,28 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage
* @generated
*/
@Override
+ public EAttribute getContext_Label() {
+ return (EAttribute) contextEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public EAttribute getContext_UserLabel() {
+ return (EAttribute) contextEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
public EClass getTab() {
return tabEClass;
}
@@ -723,6 +753,8 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage
createEReference(contextEClass, CONTEXT__VIEWS);
createEReference(contextEClass, CONTEXT__DATA_CONTEXTS);
createEReference(contextEClass, CONTEXT__PROTOTYPE);
+ createEAttribute(contextEClass, CONTEXT__LABEL);
+ createEAttribute(contextEClass, CONTEXT__USER_LABEL);
tabEClass = createEClass(TAB);
createEAttribute(tabEClass, TAB__LABEL);
@@ -824,6 +856,8 @@ public class ContextsPackageImpl extends EPackageImpl implements ContextsPackage
initEReference(getContext_Views(), this.getView(), this.getView_Context(), "views", null, 0, -1, Context.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getContext_DataContexts(), this.getDataContextRoot(), null, "dataContexts", null, 0, -1, Context.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getContext_Prototype(), this.getContext(), null, "prototype", null, 0, 1, Context.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContext_Label(), ecorePackage.getEString(), "label", null, 0, 1, Context.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getContext_UserLabel(), ecorePackage.getEString(), "userLabel", null, 1, 1, Context.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEClass(tabEClass, Tab.class, "Tab", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getTab_Label(), ecorePackage.getEString(), "label", null, 1, 1, Tab.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java
index 921bce98412..6c3e34776ce 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsAdapterFactory.java
@@ -1,9 +1,15 @@
-/**
- * <copyright>
- * </copyright>
+/*****************************************************************************
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
- * $Id$
- */
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 482927
+ *****************************************************************************/
package org.eclipse.papyrus.views.properties.contexts.util;
import org.eclipse.emf.common.notify.Adapter;
@@ -82,68 +88,67 @@ public class ContextsAdapterFactory extends AdapterFactoryImpl {
*
* @generated
*/
- protected ContextsSwitch<Adapter> modelSwitch =
- new ContextsSwitch<Adapter>() {
- @Override
- public Adapter caseContext(Context object) {
- return createContextAdapter();
- }
+ protected ContextsSwitch<Adapter> modelSwitch = new ContextsSwitch<Adapter>() {
+ @Override
+ public Adapter caseContext(Context object) {
+ return createContextAdapter();
+ }
- @Override
- public Adapter caseTab(Tab object) {
- return createTabAdapter();
- }
+ @Override
+ public Adapter caseTab(Tab object) {
+ return createTabAdapter();
+ }
- @Override
- public Adapter caseView(View object) {
- return createViewAdapter();
- }
+ @Override
+ public Adapter caseView(View object) {
+ return createViewAdapter();
+ }
- @Override
- public Adapter caseSection(Section object) {
- return createSectionAdapter();
- }
+ @Override
+ public Adapter caseSection(Section object) {
+ return createSectionAdapter();
+ }
- @Override
- public Adapter caseDataContextElement(DataContextElement object) {
- return createDataContextElementAdapter();
- }
+ @Override
+ public Adapter caseDataContextElement(DataContextElement object) {
+ return createDataContextElementAdapter();
+ }
- @Override
- public Adapter caseProperty(Property object) {
- return createPropertyAdapter();
- }
+ @Override
+ public Adapter caseProperty(Property object) {
+ return createPropertyAdapter();
+ }
- @Override
- public Adapter caseUnknownProperty(UnknownProperty object) {
- return createUnknownPropertyAdapter();
- }
+ @Override
+ public Adapter caseUnknownProperty(UnknownProperty object) {
+ return createUnknownPropertyAdapter();
+ }
- @Override
- public Adapter caseDataContextPackage(DataContextPackage object) {
- return createDataContextPackageAdapter();
- }
+ @Override
+ public Adapter caseDataContextPackage(DataContextPackage object) {
+ return createDataContextPackageAdapter();
+ }
- @Override
- public Adapter caseDataContextRoot(DataContextRoot object) {
- return createDataContextRootAdapter();
- }
+ @Override
+ public Adapter caseDataContextRoot(DataContextRoot object) {
+ return createDataContextRootAdapter();
+ }
- @Override
- public Adapter caseEModelElement(EModelElement object) {
- return createEModelElementAdapter();
- }
+ @Override
+ public Adapter caseEModelElement(EModelElement object) {
+ return createEModelElementAdapter();
+ }
- @Override
- public Adapter caseDisplayUnit(DisplayUnit object) {
- return createDisplayUnitAdapter();
- }
+ @Override
+ public Adapter caseDisplayUnit(DisplayUnit object) {
+ return createDisplayUnitAdapter();
+ }
- @Override
- public Adapter defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
/**
* Creates an adapter for the <code>target</code>.
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java
index 7ad4ad3f1fc..cad3901030f 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties.model/src-gen/org/eclipse/papyrus/views/properties/contexts/util/ContextsSwitch.java
@@ -1,9 +1,15 @@
-/**
- * <copyright>
- * </copyright>
+/*****************************************************************************
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
- * $Id$
- */
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ * Christian W. Damus - bug 482927
+ *****************************************************************************/
package org.eclipse.papyrus.views.properties.contexts.util;
import org.eclipse.emf.ecore.EModelElement;
@@ -63,7 +69,8 @@ public class ContextsSwitch<T> extends Switch<T> {
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
- * @parameter ePackage the package in question.
+ * @param ePackage
+ * the package in question.
* @return whether this is a switch for the given package.
* @generated
*/
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/preferences/Preferences.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/preferences/Preferences.java
index df45283b98f..8ee8990fe2e 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/preferences/Preferences.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/preferences/Preferences.java
@@ -9,10 +9,13 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus - bug 482930
+ * Christian W. Damus - bug 482927
*****************************************************************************/
package org.eclipse.papyrus.views.properties.preferences;
import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -67,6 +70,7 @@ public class Preferences extends PreferencePage implements IWorkbenchPreferenceP
// Only customizable Property view contexts should appear here
List<Context> contexts = new java.util.ArrayList<Context>(configurationManager.getCustomizableContexts());
contexts.addAll(configurationManager.getMissingContexts());
+ Collections.sort(contexts, contextOrdering());
for (Context context : contexts) {
boolean applied = configurationManager.isApplied(context);
@@ -97,6 +101,18 @@ public class Preferences extends PreferencePage implements IWorkbenchPreferenceP
return null;
}
+ protected Comparator<? super Context> contextOrdering() {
+ return Comparator.comparingInt(this::getCategory).thenComparing(
+ Comparator.comparing(Context::getUserLabel));
+ }
+
+ protected int getCategory(Context context) {
+ ConfigurationManager mgr = ConfigurationManager.getInstance();
+ return mgr.isCustomizable(context)
+ ? mgr.isPlugin(context) ? 0 : 1
+ : 1000;
+ }
+
@Override
public boolean performOk() {
return contextState.saveContext() && super.performOk();
@@ -130,7 +146,7 @@ public class Preferences extends PreferencePage implements IWorkbenchPreferenceP
qualifier = Messages.Preferences_Custom;
}
- return String.format("%s (%s)", context.getName(), qualifier); //$NON-NLS-1$
+ return String.format("%s (%s)", context.getUserLabel(), qualifier); //$NON-NLS-1$
}
private final ContextState contextState = new ContextState();
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationConflict.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationConflict.java
index 0f16f17b0e2..2e692ec6ae1 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationConflict.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ConfigurationConflict.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
+ * Copyright (c) 2011, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 482927
*****************************************************************************/
package org.eclipse.papyrus.views.properties.runtime;
@@ -60,7 +61,7 @@ public class ConfigurationConflict {
public String toString() {
String result = sectionID + " : "; //$NON-NLS-1$
for (Context context : conflictingContexts) {
- result += context.getName() + ", "; //$NON-NLS-1$
+ result += context.getUserLabel() + ", "; //$NON-NLS-1$
}
return result.substring(0, result.length() - 2);
}

Back to the top