Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMélanie Bats2016-10-04 14:23:21 +0000
committerPierre-Charles David2016-10-04 15:11:51 +0000
commit25d6e26c5b151912ee9bee5f492d0e4da9f9f2d6 (patch)
tree7c916c65457465a7279634b120792c60ceeea44f
parent88aec71415f666c568024e46887b9c19d7e7c8bf (diff)
downloadorg.eclipse.sirius-25d6e26c5b151912ee9bee5f492d0e4da9f9f2d6.tar.gz
org.eclipse.sirius-25d6e26c5b151912ee9bee5f492d0e4da9f9f2d6.tar.xz
org.eclipse.sirius-25d6e26c5b151912ee9bee5f492d0e4da9f9f2d6.zip
[496058] Set a fixed label to the tab representing the main semantic element
The tab representing the main semantic element has a fixed label equal to "Main". Bug: 496058 Change-Id: I1f30fe9e3d11d5f669fd2cf36a0a7a5cda6b3490 Signed-off-by: Mélanie Bats <melanie.bats@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.ui.properties/model/properties.odesign2
-rw-r--r--plugins/org.eclipse.sirius.ui.properties/plugin.properties2
-rw-r--r--plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/Messages.java3
-rw-r--r--plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/SiriusToolServices.java23
4 files changed, 29 insertions, 1 deletions
diff --git a/plugins/org.eclipse.sirius.ui.properties/model/properties.odesign b/plugins/org.eclipse.sirius.ui.properties/model/properties.odesign
index 7bf8ffe26d..fb736678c6 100644
--- a/plugins/org.eclipse.sirius.ui.properties/model/properties.odesign
+++ b/plugins/org.eclipse.sirius.ui.properties/model/properties.odesign
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ASCII"?>
<properties:ViewExtensionDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:properties="http://www.eclipse.org/sirius/properties/1.0.0" xmlns:properties-ext-widgets-reference="http://www.eclipse.org/sirius/properties/1.0.0/ext/widgets/reference" xmlns:tool="http://www.eclipse.org/sirius/description/tool/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/tool/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description/tool" identifier="org.eclipse.sirius.ui.properties">
- <pages identifier="org.eclipse.sirius.ui.properties.defaultpage" labelExpression="aql:self.eefViewText()" semanticCandidateExpression="aql:input.getAllSemanticElements()" groups="//@groups.0"/>
+ <pages identifier="org.eclipse.sirius.ui.properties.defaultpage" labelExpression="aql:self.eefViewText(input)" semanticCandidateExpression="aql:input.getAllSemanticElements()" groups="//@groups.0"/>
<groups identifier="org.eclipse.sirius.ui.properties.defaultgroup" labelExpression="aql:self.eefViewCategory()" semanticCandidateExpression="aql:self.eefViewCategories()" preconditionExpression="">
<controls xsi:type="properties:DynamicMappingFor" iterator="eStructuralFeature" iterableExpression="aql:self.eefViewEStructuralFeatures()">
<ifs predicateExpression="aql:(eStructuralFeature.eType.instanceTypeName = 'java.lang.String' or eStructuralFeature.eType.instanceTypeName = 'int' or eStructuralFeature.eType.instanceTypeName = 'java.lang.Integer' or eStructuralFeature.eType.instanceTypeName = 'double' or eStructuralFeature.eType.instanceTypeName = 'java.lang.Double' or eStructuralFeature.eType.instanceTypeName = 'char' or eStructuralFeature.eType.instanceTypeName = 'java.lang.Character' or eStructuralFeature.eType.instanceTypeName = 'short' or eStructuralFeature.eType.instanceTypeName = 'java.lang.Short' or eStructuralFeature.eType.instanceTypeName = 'long' or eStructuralFeature.eType.instanceTypeName = 'java.lang.Long' or eStructuralFeature.eType.instanceTypeName = 'float' or eStructuralFeature.eType.instanceTypeName = 'java.lang.Float' or eStructuralFeature.eType.instanceTypeName = 'java.util.Date') and not(eStructuralFeature.many) and not self.eefViewMultiline(eStructuralFeature)">
diff --git a/plugins/org.eclipse.sirius.ui.properties/plugin.properties b/plugins/org.eclipse.sirius.ui.properties/plugin.properties
index 37c6ce50b4..4f77be500b 100644
--- a/plugins/org.eclipse.sirius.ui.properties/plugin.properties
+++ b/plugins/org.eclipse.sirius.ui.properties/plugin.properties
@@ -27,6 +27,8 @@ TransactionalEditingDomainContextAdapter_errorDuringCommand = Errors occured dur
siriusTabDescriptorFilter.Label=Sirius EEF Tab Descriptor Filter
siriusTabDescriptorFilter.Description=Filters the properties tabs according to a precondition
SiriusToolServices_DefaultCategoryName=Default
+SiriusToolServices_MainTabLabel=Main
+
# Preferences
preference.page.title.org.eclipse.sirius.ui.properties.general=Sirius Properties View
SiriusPropertiesPreferencePage_filterGroup= Legacy Tabs
diff --git a/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/Messages.java b/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/Messages.java
index bd48fe2c2d..f94053aa32 100644
--- a/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/Messages.java
+++ b/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/Messages.java
@@ -39,6 +39,9 @@ public final class Messages {
@TranslatableMessage
public static String SiriusToolServices_DefaultCategoryName;
+
+ @TranslatableMessage
+ public static String SiriusToolServices_MainTabLabel;
@TranslatableMessage
public static String TransactionalEditingDomainContextAdapter_errorDuringCommand;
diff --git a/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/SiriusToolServices.java b/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/SiriusToolServices.java
index 1fde83fc95..51ab0c8a1f 100644
--- a/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/SiriusToolServices.java
+++ b/plugins/org.eclipse.sirius.ui.properties/src/org/eclipse/sirius/ui/properties/internal/SiriusToolServices.java
@@ -81,6 +81,29 @@ public class SiriusToolServices {
}
/**
+ * Returns the text representing the given EObject.
+ *
+ * @param sid
+ * a {@link SiriusInputDescriptor} (typically the "input"
+ * variable of the properties view).
+ * @param object
+ * The object
+ * @return The text representing the given EObject or <code>null</code> if
+ * none could be found
+ */
+ public String eefViewText(Object object, SiriusInputDescriptor sid) {
+ String result = String.valueOf(object);
+ if (object instanceof EObject) {
+ if (mainSemanticElement(sid.getFullContext()).equals(object)) {
+ result = Messages.SiriusToolServices_MainTabLabel;
+ } else {
+ result = this.editServices.getLabelProviderText((EObject) object);
+ }
+ }
+ return result;
+ }
+
+ /**
* Returns the text representing the given EStructuralFeature.
*
* @param eObject

Back to the top