Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2015-06-29 13:03:43 +0000
committerPierre-Charles David2016-08-24 08:34:57 +0000
commitdb2ca98f284d3ccbada371ad9ae258d184d0ece7 (patch)
tree6d223d415e9dd235009473fbfdbab61155df6b59
parent97922eaf9b63deb65ea0a66e77f52d2fbbea2251 (diff)
downloadorg.eclipse.sirius-db2ca98f284d3ccbada371ad9ae258d184d0ece7.tar.gz
org.eclipse.sirius-db2ca98f284d3ccbada371ad9ae258d184d0ece7.tar.xz
org.eclipse.sirius-db2ca98f284d3ccbada371ad9ae258d184d0ece7.zip
[465952] Have fully qualified name for StyleCustomization.appliedOn
Have a single generic HierarchyLabelProvider to get fully qualified name for StyleDescription. Bug: 465952 Change-Id: I27937a94fc8214eb42b184278ca5bb14e95b8787 Signed-off-by: Steve Monnier <steve.monnier@obeo.fr> Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr> Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/plugin.properties1
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java65
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java3
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.html17
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile6
-rw-r--r--plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogPropertySection.java6
-rw-r--r--plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogWithListPropertySection.java7
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java89
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java53
-rw-r--r--plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java15
-rw-r--r--plugins/org.eclipse.sirius.ui/plugin.properties1
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java2
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/HierarchyLabelProvider.java117
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java108
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/viewpoint/provider/Messages.java3
15 files changed, 221 insertions, 272 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/plugin.properties b/plugins/org.eclipse.sirius.diagram.ui/plugin.properties
index 2d51e0c58d..c8073e16aa 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/plugin.properties
+++ b/plugins/org.eclipse.sirius.diagram.ui/plugin.properties
@@ -935,7 +935,6 @@ GMFNotationUtilities_edgeOnEdgeNotManaged = Edge on edge not managed
GridLayoutProvider_unknownMode = Unknown mode: {0}
HiddenElementsSelectionCommand_dialogMessage = Visible diagram elements are checked.
HiddenElementsSelectionCommand_dialogTitle = Diagram elements visibility
-HierarchyLabelProvider_elementWihtoutNameLabel = Element whithout name
IAbstractDiagramNodeEditPart_createViewCommandLabel = Create View
IAbstractDiagramNodeEditPart_resizeCommandLabel = Resize
IBorderItemLocatorWrapper_nullLocator = The locator is null
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java
index 6dbd9a3b73..f70726fbbd 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES and others.
+ * Copyright (c) 2009, 2016 THALES GLOBAL SERVICES and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,66 +14,28 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.sirius.business.api.query.IdentifiedElementQuery;
-import org.eclipse.sirius.diagram.ui.provider.Messages;
import org.eclipse.sirius.viewpoint.description.DescriptionPackage;
-import org.eclipse.sirius.viewpoint.description.IdentifiedElement;
-import org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription;
-import org.eclipse.swt.graphics.Image;
/**
* A label provider for mappings to display their hierarchy.
- *
+ *
* @author mchauvin
*/
-public class HierarchyLabelProvider extends LabelProvider {
-
- private static final String DELIMITER = " > "; //$NON-NLS-1$
-
- private ILabelProvider wrappedProvider;
+public class HierarchyLabelProvider extends org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider {
/**
* Create a new instance with wrapped label provider as base type.
- *
+ *
* @param wrappedLabelProvider
* the wrapped label provider
*/
public HierarchyLabelProvider(final ILabelProvider wrappedLabelProvider) {
- this.wrappedProvider = wrappedLabelProvider;
+ super(wrappedLabelProvider);
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
- */
@Override
- public Image getImage(final Object element) {
- return wrappedProvider != null ? wrappedProvider.getImage(element) : super.getImage(element);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(final Object element) {
- if (element instanceof EObject && isClassOfDescriptionPackageOrSubPackage(((EObject) element).eClass())) {
- EObject eObject = (EObject) element;
- String text = getLabel(eObject);
- EObject container = eObject.eContainer();
- while (container != null) {
- text = getLabel(container) + DELIMITER + text;
- container = container.eContainer();
- }
- return text;
- }
- return wrappedProvider != null ? wrappedProvider.getText(element) : super.getText(element);
- }
-
- private boolean isClassOfDescriptionPackageOrSubPackage(EClass eClass) {
+ protected boolean handles(EObject element) {
+ EClass eClass = element.eClass();
boolean isClassOfDescriptionPackageOrSubPackage = false;
EPackage ePackage = eClass.getEPackage();
while (!isClassOfDescriptionPackageOrSubPackage && ePackage != null) {
@@ -82,17 +44,4 @@ public class HierarchyLabelProvider extends LabelProvider {
}
return isClassOfDescriptionPackageOrSubPackage;
}
-
- private String getLabel(final EObject eObject) {
- String label = Messages.HierarchyLabelProvider_elementWihtoutNameLabel;
- if (eObject instanceof IdentifiedElement) {
- label = new IdentifiedElementQuery((IdentifiedElement) eObject).getLabel();
- } else if (eObject instanceof RepresentationExtensionDescription) {
- label = ((RepresentationExtensionDescription) eObject).getName();
- } else {
- label = wrappedProvider.getText(eObject);
- }
- return label;
- }
-
}
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java
index 37b4b63cd2..e7b48ee139 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java
@@ -588,9 +588,6 @@ public final class Messages {
public static String HiddenElementsSelectionCommand_dialogTitle;
@TranslatableMessage
- public static String HierarchyLabelProvider_elementWihtoutNameLabel;
-
- @TranslatableMessage
public static String IAbstractDiagramNodeEditPart_createViewCommandLabel;
@TranslatableMessage
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index 288415824b..fc1f453ce4 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -239,10 +239,18 @@
<code>org.eclipse.sirius.ui</code>
</h4>
<ul>
+ <li><span class="label label-info">Added</span> The class
+ <code>org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider</code> has been added to provide a generic label provider for VSM model element giving hierarchical label. This label provider replaces the one returned by deprecated method
+ <code>DialectUIServices.getHierarchyLabelProvider()</code>.
+ </li>
<li><span class="label label-info">Modified</span>
<code>AbstractSWTCallback</code> provides a default implementation of
<code>UICallBack.askSessionReopeningWithResourceVersionMismatch()</code> method to give feedback about version mismatch and give the choice to reopen session despite a potential corruption.
</li>
+ <li><span class="label label-warning">Deprecated</span> The method
+ <code>org.eclipse.sirius.ui.business.api.dialect.DialectUIServices.getHierarchyLabelProvider()</code> has been deprecated in favor of generic label provider
+ <code>HierarchyLabelProvider</code>.
+ </li>
</ul>
<h4 id="Changesinorg.eclipse.sirius.diagram">Changes in
<code>org.eclipse.sirius.diagram</code>
@@ -333,6 +341,13 @@
<code>org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManagerForSemanticElementsFactory</code> is deprecated, use
<code>org.eclipse.sirius.diagram.ui.tools.api.format.SiriusFormatDataManagerForSemanticElementsFactory</code> instead.
</li>
+ <li><span class="label label-info">Moved</span> The translation key
+ <code>HierarchyLabelProvider_elementWihtoutNameLabel</code> has been removed from the
+ <code>org.eclipse.sirius.diagram.ui</code> plug-in&#8217;s
+ <code>Messages</code> class, and moved into the
+ <code>org.eclipse.sirius.ui</code>'s
+ <code>Messages</code> class.
+ </li>
</ul>
<h4 id="Changesinorg.eclipse.sirius.ext.gmf.runtime">Changes in
<code>org.eclipse.sirius.ext.gmf.runtime</code>
@@ -644,7 +659,7 @@
<code>Messages_createRepresentationInputDialog_RepresentationDescriptionLabel</code> has been replaced by &#8220;Representation description: {0}&#8221; (previous value was &#8220;Representation description: &#8221;).
</li>
<li><span class="label label-info">Modified</span> The internationalizable label
- <code>Messages_createRepresentationInputDialog_Title</code> has been replaced by &#8220;New {0}&#8221; (previous value was &#8220;New Representation&#8221;).
+ <code>Messages_createRepresentationInputDialog_Title</code> has been replaced by &#8220;New {0}&#8221; (previous value was &#8220;New Representation&#8221;).
</li>
<li><span class="label label-danger">Removed</span> The internationalizable label
<code>org.eclipse.sirius.viewpoint.provider.Messages.OpenRepresentationsFileJob_initModelingProjectsTask</code> has been removed as this message is no more used.
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 1229cf944a..239963c59b 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -50,7 +50,9 @@ h4. Changes in @org.eclipse.sirius@
h4. Changes in @org.eclipse.sirius.ui@
+* <span class="label label-info">Added</span> The class @org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider@ has been added to provide a generic label provider for VSM model element giving hierarchical label. This label provider replaces the one returned by deprecated method @DialectUIServices.getHierarchyLabelProvider()@.
* <span class="label label-info">Modified</span> @AbstractSWTCallback@ provides a default implementation of @UICallBack.askSessionReopeningWithResourceVersionMismatch()@ method to give feedback about version mismatch and give the choice to reopen session despite a potential corruption.
+* <span class="label label-warning">Deprecated</span> The method @org.eclipse.sirius.ui.business.api.dialect.DialectUIServices.getHierarchyLabelProvider()@ has been deprecated in favor of generic label provider @HierarchyLabelProvider@.
h4. Changes in @org.eclipse.sirius.diagram@
@@ -77,7 +79,7 @@ h4. Changes in @org.eclipse.sirius.diagram.ui@
* <span class="label label-info">Modified</span> @org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataKey@ is deprecated, use @org.eclipse.sirius.diagram.ui.tools.api.format.FormatDataKey@ instead.
* <span class="label label-info">Modified</span> @org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManager@ is deprecated, use @org.eclipse.sirius.diagram.ui.tools.api.format.SiriusFormatDataManager@ instead.
* <span class="label label-info">Modified</span> @org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManagerForSemanticElementsFactory@ is deprecated, use @org.eclipse.sirius.diagram.ui.tools.api.format.SiriusFormatDataManagerForSemanticElementsFactory@ instead.
-
+* <span class="label label-info">Moved</span> The translation key @HierarchyLabelProvider_elementWihtoutNameLabel@ has been removed from the @org.eclipse.sirius.diagram.ui@ plug-in's @Messages@ class, and moved into the @org.eclipse.sirius.ui@'s @Messages@ class.
h4. Changes in @org.eclipse.sirius.ext.gmf.runtime@
@@ -177,7 +179,7 @@ h4. Changes in @org.eclipse.sirius.ui@
* <span class="label label-success">Added</span> The new internationalizable label @Messages_createRepresentationInputDialog_DefaultRepresentationDescName@ has been added (available through @org.eclipse.sirius.ui.tools.api.Messages.createRepresentationInputDialog_DefaultRepresentationDescName@. Its value is "Representation".
* <span class="label label-info">Modified</span> The internationalizable label @Messages_createRepresentationInputDialog_NewRepresentationNameLabel@ has been replaced by "Name:" (previous value was "Representation name:").
* <span class="label label-info">Modified</span> The internationalizable label @Messages_createRepresentationInputDialog_RepresentationDescriptionLabel@ has been replaced by "Representation description: {0}" (previous value was "Representation description: ").
-* <span class="label label-info">Modified</span> The internationalizable label @Messages_createRepresentationInputDialog_Title@ has been replaced by "New {0}" (previous value was "New Representation").
+* <span class="label label-info">Modified</span> The internationalizable label @Messages_createRepresentationInputDialog_Title@ has been replaced by "New {0}" (previous value was "New Representation").
* <span class="label label-danger">Removed</span> The internationalizable label @org.eclipse.sirius.viewpoint.provider.Messages.OpenRepresentationsFileJob_initModelingProjectsTask@ has been removed as this message is no more used.
* <span class="label label-danger">Removed</span> The class @org.eclipse.sirius.ui.business.api.editor.SpecificSessionManager@ has been removed.
diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogPropertySection.java
index d8ea2fed9c..9bb23b55fc 100644
--- a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogPropertySection.java
+++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogPropertySection.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES.
* 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
@@ -31,7 +31,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.sirius.common.ui.tools.api.dialog.FeatureEditorDialog;
import org.eclipse.sirius.editor.properties.ViewpointPropertySheetPage;
-import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
+import org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.SelectionAdapter;
@@ -155,7 +155,7 @@ public abstract class AbstractEditorDialogPropertySection extends AbstractViewpo
ILabelProvider labelProvider = propertyDescriptor.getLabelProvider();
// Start of user code getLabelProvider
if (getSelection() instanceof TreeSelection) {
- labelProvider = DialectUIManager.INSTANCE.getHierarchyLabelProvider(labelProvider);
+ labelProvider = new HierarchyLabelProvider(labelProvider);
}
// End of user code getLabelProvider
return labelProvider;
diff --git a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogWithListPropertySection.java b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogWithListPropertySection.java
index a0026515d7..1155fb771e 100644
--- a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogWithListPropertySection.java
+++ b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/properties/sections/common/AbstractEditorDialogWithListPropertySection.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 - 2010 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES.
* 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
@@ -25,6 +25,7 @@ import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.sirius.common.ui.tools.api.dialog.FeatureEditorDialog;
import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
+import org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider;
import org.eclipse.sirius.ui.business.api.featureExtensions.FeatureExtensionsUIManager;
import org.eclipse.sirius.viewpoint.provider.ViewpointItemProviderAdapterFactory;
import org.eclipse.swt.events.SelectionAdapter;
@@ -97,7 +98,9 @@ public abstract class AbstractEditorDialogWithListPropertySection extends Abstra
*/
protected ILabelProvider getLabelProvider() {
AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(getAdapterFactory());
- return DialectUIManager.INSTANCE.getHierarchyLabelProvider(labelProvider);
+ // Start of user code getLabelProvider
+ return new HierarchyLabelProvider(labelProvider);
+ // End of user code getLabelProvider
}
/**
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
index b8a9407431..ace43876f0 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
@@ -61,6 +61,7 @@ import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
import org.eclipse.sirius.ui.business.api.dialect.DialectUIServices;
import org.eclipse.sirius.ui.business.api.dialect.ExportFormat;
import org.eclipse.sirius.ui.business.api.dialect.ExportFormat.ExportDocumentFormat;
+import org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider;
import org.eclipse.sirius.ui.business.api.session.SessionEditorInput;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationDescriptor;
@@ -86,9 +87,7 @@ import com.google.common.collect.Sets;
* @author lredor
*/
public class TableDialectUIServices implements DialectUIServices {
- /**
- * {@inheritDoc}
- */
+
@Override
public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) {
IEditorPart editorPart = null;
@@ -138,10 +137,6 @@ public class TableDialectUIServices implements DialectUIServices {
return editorPart;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideNewChildDescriptors() {
final Collection<CommandParameter> newChilds = new ArrayList<CommandParameter>();
@@ -150,10 +145,6 @@ public class TableDialectUIServices implements DialectUIServices {
return newChilds;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideRepresentationCreationToolDescriptors(final Object feature) {
final Collection<CommandParameter> newChilds = new ArrayList<CommandParameter>();
@@ -163,10 +154,6 @@ public class TableDialectUIServices implements DialectUIServices {
return newChilds;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideRepresentationNavigationToolDescriptors(final Object feature) {
final Collection<CommandParameter> newChilds = new ArrayList<CommandParameter>();
@@ -176,10 +163,6 @@ public class TableDialectUIServices implements DialectUIServices {
return newChilds;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public AdapterFactory createAdapterFactory() {
final ComposedAdapterFactory factory = new ComposedAdapterFactory();
@@ -188,22 +171,11 @@ public class TableDialectUIServices implements DialectUIServices {
return factory;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandleEditor(org.eclipse.ui.IEditorPart)
- */
@Override
public boolean canHandleEditor(final IEditorPart editorPart) {
return editorPart instanceof AbstractDTableEditor;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#closeEditor(org.eclipse.ui.IEditorPart,
- * boolean)
- */
@Override
public boolean closeEditor(final IEditorPart editorPart, final boolean save) {
final boolean result = true;
@@ -221,12 +193,6 @@ public class TableDialectUIServices implements DialectUIServices {
return result;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationManagedByEditor(org.eclipse.sirius.viewpoint.DRepresentation,
- * org.eclipse.ui.IEditorPart)
- */
@Override
public boolean isRepresentationManagedByEditor(final DRepresentation representation, final IEditorPart editorPart) {
boolean isRepresentationManagedByEditor = false;
@@ -239,12 +205,6 @@ public class TableDialectUIServices implements DialectUIServices {
return isRepresentationManagedByEditor;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationDescriptionManagedByEditor(org.eclipse.sirius.viewpoint.description.RepresentationDescription,
- * org.eclipse.ui.IEditorPart)
- */
@Override
public boolean isRepresentationDescriptionManagedByEditor(final RepresentationDescription representationDescription, final IEditorPart editor) {
if (editor instanceof AbstractDTableEditor) {
@@ -269,31 +229,16 @@ public class TableDialectUIServices implements DialectUIServices {
return representation instanceof TableDescription;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription)
- * )
- */
@Override
public boolean canHandle(final RepresentationExtensionDescription description) {
return false;
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean canExport(ExportFormat format) {
return format.getDocumentFormat().equals(ExportDocumentFormat.CSV);
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#export(org.eclipse.sirius.viewpoint.DRepresentation,
- * org.eclipse.sirius.business.api.session.Session)
- */
@Override
public void export(final DRepresentation representation, final Session session, final IPath path, final ExportFormat exportFormat, final IProgressMonitor monitor) {
String content = null;
@@ -305,9 +250,6 @@ public class TableDialectUIServices implements DialectUIServices {
}
}
- /**
- * {@inheritDoc}
- */
@Override
public String getEditorName(DRepresentation representation) {
String editorName = representation.getName();
@@ -317,36 +259,22 @@ public class TableDialectUIServices implements DialectUIServices {
return editorName;
}
- /**
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideTools(EObject context) {
return Lists.newArrayList();
}
- /**
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideAdditionalMappings(EObject object) {
return Lists.newArrayList();
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getHierarchyLabelProvider(ILabelProvider)
- */
@Override
public ILabelProvider getHierarchyLabelProvider(ILabelProvider labelProvider) {
- return new HierarchyLabelTableProvider(labelProvider);
+ return new HierarchyLabelProvider(labelProvider);
}
- /**
- * {@inheritDoc}
- */
@Override
public void setSelection(DialectEditor dialectEditor, List<DRepresentationElement> selection) {
if (dialectEditor instanceof DTableEditor && dialectEditor instanceof IViewerProvider) {
@@ -363,11 +291,6 @@ public class TableDialectUIServices implements DialectUIServices {
setSelection(dialectEditor, selection);
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getSelection(org.eclipse.sirius.ui.business.api.dialect.DialectEditor)
- */
@Override
public Collection<DSemanticDecorator> getSelection(DialectEditor editor) {
Collection<DSemanticDecorator> selection = Sets.newLinkedHashSet();
@@ -383,12 +306,6 @@ public class TableDialectUIServices implements DialectUIServices {
return selection;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#completeToolTipText(String,
- * EObject, EStructuralFeature)
- */
@Override
public String completeToolTipText(String toolTipText, EObject eObject, EStructuralFeature feature) {
return toolTipText;
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java
index 1f07927063..4499c9b3d7 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/editor/vsm/CustomizationPropertySectionsTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
* 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
@@ -21,6 +21,9 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.sirius.diagram.description.AdditionalLayer;
import org.eclipse.sirius.diagram.description.DiagramDescription;
import org.eclipse.sirius.diagram.description.style.StylePackage;
@@ -29,6 +32,7 @@ import org.eclipse.sirius.tests.support.api.EclipseTestsSupportHelper;
import org.eclipse.sirius.tests.support.api.TestsUtil;
import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusHelper;
import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils;
+import org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider;
import org.eclipse.sirius.ui.tools.api.views.modelexplorerview.IModelExplorerView;
import org.eclipse.sirius.viewpoint.description.Customization;
import org.eclipse.sirius.viewpoint.description.EAttributeCustomization;
@@ -42,6 +46,7 @@ import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -152,8 +157,16 @@ public class CustomizationPropertySectionsTests extends AbstractContentAssistTes
SWTBotButton appliedOnButton = propertiesBot.bot().button(0);
appliedOnButton.click();
SWTBotShell appliedOnSelectorShell = bot.activeShell();
- assertEquals("The left list of available elements should be of 3, for the begin/center/end edge style description", 3, appliedOnSelectorShell.bot().table(0).rowCount());
- assertEquals("The right list of selected elements should be of 3", 3, appliedOnSelectorShell.bot().table(1).rowCount());
+ SWTBot appliedOnSelectorShellBot = appliedOnSelectorShell.bot();
+ SWTBotTable table1 = appliedOnSelectorShellBot.table(0);
+ assertEquals("The left list of available elements should be of 3, for the begin/center/end edge style description", 3, table1.rowCount());
+ SWTBotTable table2 = appliedOnSelectorShellBot.table(1);
+ assertEquals("The right list of selected elements should be of 3", 3, table2.rowCount());
+ AdapterFactoryLabelProvider wrappedProvider = new AdapterFactoryLabelProvider(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ ILabelProvider labelProvider = new HierarchyLabelProvider(wrappedProvider);
+ assertEquals(labelProvider.getText(eAttributeCustomization.getAppliedOn().get(0)), table2.getTableItem(0).getText());
+ assertEquals(labelProvider.getText(eAttributeCustomization.getAppliedOn().get(1)), table2.getTableItem(1).getText());
+ assertEquals(labelProvider.getText(eAttributeCustomization.getAppliedOn().get(2)), table2.getTableItem(2).getText());
appliedOnSelectorShell.close();
// Test that without attributeName we have 5 style description elements
@@ -162,16 +175,21 @@ public class CustomizationPropertySectionsTests extends AbstractContentAssistTes
appliedOnButton.setFocus();
appliedOnButton.click();
appliedOnSelectorShell = bot.activeShell();
+ appliedOnSelectorShellBot = appliedOnSelectorShell.bot();
assertEquals("The left list of available elements should be of 5, i.e. all available style description elements", 5, appliedOnSelectorShell.bot().table(0).rowCount());
- assertEquals("The right list of selected elements should be of 3", 3, appliedOnSelectorShell.bot().table(1).rowCount());
+ table2 = appliedOnSelectorShellBot.table(1);
+ assertEquals("The right list of selected elements should be of 3", 3, table2.rowCount());
+ assertEquals(labelProvider.getText(eAttributeCustomization.getAppliedOn().get(0)), table2.getTableItem(0).getText());
+ assertEquals(labelProvider.getText(eAttributeCustomization.getAppliedOn().get(1)), table2.getTableItem(1).getText());
+ assertEquals(labelProvider.getText(eAttributeCustomization.getAppliedOn().get(2)), table2.getTableItem(2).getText());
appliedOnSelectorShell.close();
+ labelProvider.dispose();
}
/**
* Test appliedOn and referenceName sections.
*/
public void testEReferenceCustomization() {
-
if (TestsUtil.shouldSkipUnreliableTests()) {
return;
}
@@ -210,8 +228,15 @@ public class CustomizationPropertySectionsTests extends AbstractContentAssistTes
SWTBotButton appliedOnButton = propertiesBot.bot().button(0);
appliedOnButton.click();
SWTBotShell appliedOnSelectorShell = bot.activeShell();
- assertEquals("The left list of available elements should be empty because we have already selected elements selectionnable", 0, appliedOnSelectorShell.bot().table(0).rowCount());
- assertEquals("The right list of selected elements should be of 3", 3, appliedOnSelectorShell.bot().table(1).rowCount());
+ SWTBot appliedOnSelectorShellBot = appliedOnSelectorShell.bot();
+ assertEquals("The left list of available elements should be empty because we have already selected elements selectionnable", 0, appliedOnSelectorShellBot.table(0).rowCount());
+ SWTBotTable table2 = appliedOnSelectorShellBot.table(1);
+ assertEquals("The right list of selected elements should be of 3", 3, table2.rowCount());
+ AdapterFactoryLabelProvider wrappedProvider = new AdapterFactoryLabelProvider(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ ILabelProvider labelProvider = new HierarchyLabelProvider(wrappedProvider);
+ assertEquals(labelProvider.getText(eReferenceCustomization.getAppliedOn().get(0)), table2.getTableItem(0).getText());
+ assertEquals(labelProvider.getText(eReferenceCustomization.getAppliedOn().get(1)), table2.getTableItem(1).getText());
+ assertEquals(labelProvider.getText(eReferenceCustomization.getAppliedOn().get(2)), table2.getTableItem(2).getText());
appliedOnSelectorShell.close();
// Test that without attributeName we have 5 style description elements
@@ -220,9 +245,15 @@ public class CustomizationPropertySectionsTests extends AbstractContentAssistTes
appliedOnButton.setFocus();
appliedOnButton.click();
appliedOnSelectorShell = bot.activeShell();
- assertEquals("The left list of available elements should be of 5, i.e. all available style description elements", 5, appliedOnSelectorShell.bot().table(0).rowCount());
- assertEquals("The right list of selected elements should be of 3", 3, appliedOnSelectorShell.bot().table(1).rowCount());
+ appliedOnSelectorShellBot = appliedOnSelectorShell.bot();
+ assertEquals("The left list of available elements should be of 5, i.e. all available style description elements", 5, appliedOnSelectorShellBot.table(0).rowCount());
+ table2 = appliedOnSelectorShellBot.table(1);
+ assertEquals("The right list of selected elements should be of 3", 3, table2.rowCount());
+ assertEquals(labelProvider.getText(eReferenceCustomization.getAppliedOn().get(0)), table2.getTableItem(0).getText());
+ assertEquals(labelProvider.getText(eReferenceCustomization.getAppliedOn().get(1)), table2.getTableItem(1).getText());
+ assertEquals(labelProvider.getText(eReferenceCustomization.getAppliedOn().get(2)), table2.getTableItem(2).getText());
appliedOnSelectorShell.close();
+ labelProvider.dispose();
}
/**
@@ -243,8 +274,8 @@ public class CustomizationPropertySectionsTests extends AbstractContentAssistTes
reuseButton.click();
SWTBotShell reuseSelectorShell = bot.activeShell();
- assertEquals("The left list of available elements should have only one style customization available because we have already selected the other one", 1, reuseSelectorShell.bot().table(0)
- .rowCount());
+ assertEquals("The left list of available elements should have only one style customization available because we have already selected the other one", 1,
+ reuseSelectorShell.bot().table(0).rowCount());
assertEquals("The right list of selected elements should be of 1", 1, reuseSelectorShell.bot().table(1).rowCount());
reuseSelectorShell.close();
diff --git a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java
index 981631959e..e9e0b3f6c3 100644
--- a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java
+++ b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/business/internal/dialect/TreeDialectUIServices.java
@@ -51,6 +51,7 @@ import org.eclipse.sirius.tree.ui.tools.internal.editor.DTreeEditor;
import org.eclipse.sirius.ui.business.api.dialect.DialectEditor;
import org.eclipse.sirius.ui.business.api.dialect.DialectUIServices;
import org.eclipse.sirius.ui.business.api.dialect.ExportFormat;
+import org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider;
import org.eclipse.sirius.ui.business.api.session.SessionEditorInput;
import org.eclipse.sirius.viewpoint.DRepresentation;
import org.eclipse.sirius.viewpoint.DRepresentationDescriptor;
@@ -75,6 +76,7 @@ import com.google.common.collect.Sets;
* @author pcdavid
*/
public class TreeDialectUIServices implements DialectUIServices {
+
@Override
public boolean canHandle(DRepresentation representation) {
return representation instanceof DTree;
@@ -238,7 +240,7 @@ public class TreeDialectUIServices implements DialectUIServices {
@Override
public ILabelProvider getHierarchyLabelProvider(ILabelProvider currentLabelProvider) {
- return new HierarchyLabelTreeProvider(currentLabelProvider);
+ return new HierarchyLabelProvider(currentLabelProvider);
}
@Override
@@ -277,6 +279,17 @@ public class TreeDialectUIServices implements DialectUIServices {
return toolTipText;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#completeToolTipText(String,
+ * EObject)
+ * @deprecated this method has not access to the feature of eObject. This is
+ * supported in
+ * org.eclipse.sirius.tree.ui.business.internal.dialect
+ * .TreeDialectUIServices.completeToolTipText(String, EObject,
+ * EStructuralFeature)
+ */
@Deprecated
@Override
public String completeToolTipText(String toolTipText, EObject eObject) {
diff --git a/plugins/org.eclipse.sirius.ui/plugin.properties b/plugins/org.eclipse.sirius.ui/plugin.properties
index 56f0ede2ad..d1da268b82 100644
--- a/plugins/org.eclipse.sirius.ui/plugin.properties
+++ b/plugins/org.eclipse.sirius.ui/plugin.properties
@@ -163,6 +163,7 @@ FilteredCommonTree_refreshFilterJob = Refresh Filter
GenericInitialObjectPage_containerLabel = &Model Object
GenericInitialObjectPage_encodingLabel = &XML Encoding
GenericModelCreationPage_fileExtensionError = The file name must end in .{0}
+HierarchyLabelProvider_elementWihtoutNameLabel = Element whithout name
LoadEMFResourceRunnableWithProgress_loadResourceTask = Loading resource
LogThroughActiveDialectEditorLogListener_permissionError = Permission Issue
MarkerDeletionJob_name = Remove modeling marker
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java
index f17a73f28b..0863305e86 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIServices.java
@@ -278,7 +278,9 @@ public interface DialectUIServices {
* the current label provider. If the current label is null, the
* result can be null
* @return a LabelProvider
+ * @deprecated use directly a {@link HierarchyLabelProvider}.
*/
+ @Deprecated
ILabelProvider getHierarchyLabelProvider(ILabelProvider currentLabelProvider);
/**
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/HierarchyLabelProvider.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/HierarchyLabelProvider.java
new file mode 100644
index 0000000000..b80c3fc6b4
--- /dev/null
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/HierarchyLabelProvider.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.ui.business.api.dialect;
+
+import java.util.LinkedList;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.sirius.business.api.query.IdentifiedElementQuery;
+import org.eclipse.sirius.viewpoint.description.IdentifiedElement;
+import org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription;
+import org.eclipse.sirius.viewpoint.provider.Messages;
+import org.eclipse.swt.graphics.Image;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Lists;
+
+/**
+ * A {@link LabelProvider} to display Sirius model description element in a
+ * hierarchical way.
+ *
+ * @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
+ * @author pcdavid
+ */
+public class HierarchyLabelProvider extends LabelProvider {
+
+ private static final String DELIMITER = " > "; //$NON-NLS-1$
+
+ private ILabelProvider wrappedProvider;
+
+ /**
+ * Create a new instance with wrapped label provider as base type.
+ *
+ * @param wrappedProvider
+ * the wrapped {@link ILabelProvider}
+ */
+ public HierarchyLabelProvider(ILabelProvider wrappedProvider) {
+ this.wrappedProvider = wrappedProvider;
+ }
+
+ @Override
+ public Image getImage(final Object element) {
+ return wrappedProvider != null ? wrappedProvider.getImage(element) : super.getImage(element);
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof EObject && handles((EObject) element)) {
+ LinkedList<String> segments = Lists.newLinkedList();
+ for (EObject current = (EObject) element; current != null; current = current.eContainer()) {
+ segments.addFirst(getLabel(current));
+ }
+ return Joiner.on(getDelimiter()).join(segments);
+ }
+ return wrappedProvider != null ? wrappedProvider.getText(element) : super.getText(element);
+ }
+
+ /**
+ * Tests whether this HierarchyLabelProvider can handle the specified
+ * element. If not, the plain label from the wrapped provider will be used.
+ *
+ * @param element
+ * the element to test.
+ * @return <code>true</code> if this provider can handl the element.
+ */
+ protected boolean handles(EObject element) {
+ return true;
+ }
+
+ /**
+ * The delimiter to use between the segments of the hierarchy.
+ *
+ * @return the delimiter to use.
+ */
+ protected String getDelimiter() {
+ return DELIMITER;
+ }
+
+ /**
+ * The label to use for null elements.
+ *
+ * @return the label to use for null elements.
+ */
+ protected String getDefaultLabel() {
+ return Messages.HierarchyLabelProvider_elementWihtoutNameLabel;
+ }
+
+ private String getLabel(EObject eObject) {
+ String label = getDefaultLabel();
+ if (eObject instanceof IdentifiedElement) {
+ label = new IdentifiedElementQuery((IdentifiedElement) eObject).getLabel();
+ } else if (eObject instanceof RepresentationExtensionDescription) {
+ label = ((RepresentationExtensionDescription) eObject).getName();
+ } else {
+ label = wrappedProvider.getText(eObject);
+ }
+ return label;
+ }
+
+ @Override
+ public void dispose() {
+ if (wrappedProvider != null) {
+ wrappedProvider.dispose();
+ wrappedProvider = null;
+ }
+ super.dispose();
+ }
+}
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java
index 9715c14c06..d971381a56 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java
@@ -58,7 +58,6 @@ import org.eclipse.ui.IEditorPart;
* using the Eclipse environment.
*
* @author cbrun
- *
*/
public class DialectUIManagerImpl implements DialectUIManager {
@@ -80,27 +79,16 @@ public class DialectUIManagerImpl implements DialectUIManager {
return manager;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public void disableDialectUI(final DialectUI dialect) {
dialects.remove(dialect.getName());
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public void enableDialectUI(final DialectUI dialect) {
dialects.put(dialect.getName(), dialect);
}
- /**
- * {@inheritDoc}
- */
@Override
public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) {
for (final DialectUI dialect : dialects.values()) {
@@ -112,10 +100,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return null;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideNewChildDescriptors() {
final Collection<CommandParameter> result = new ArrayList<CommandParameter>();
@@ -125,10 +109,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return result;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideRepresentationCreationToolDescriptors(final Object feature) {
final Collection<CommandParameter> result = new ArrayList<CommandParameter>();
@@ -138,10 +118,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return result;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideRepresentationNavigationToolDescriptors(final Object feature) {
final Collection<CommandParameter> result = new ArrayList<CommandParameter>();
@@ -151,9 +127,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return result;
}
- /**
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideAdditionalMappings(EObject object) {
final Collection<CommandParameter> result = new ArrayList<CommandParameter>();
@@ -163,10 +136,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return result;
}
- /**
- *
- * {@inheritDoc}
- */
@Override
public AdapterFactory createAdapterFactory() {
final ComposedAdapterFactory composed = new ComposedAdapterFactory();
@@ -184,11 +153,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return composed;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandleEditor(org.eclipse.ui.IEditorPart)
- */
@Override
public boolean canHandleEditor(final IEditorPart editorPart) {
boolean result = false;
@@ -198,12 +162,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return result;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#closeEditor(org.eclipse.ui.IEditorPart,
- * boolean)
- */
@Override
public boolean closeEditor(final IEditorPart editorPart, final boolean save) {
boolean result = false;
@@ -215,12 +173,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return result;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationManagedByEditor(org.eclipse.sirius.viewpoint.DRepresentation,
- * org.eclipse.ui.IEditorPart)
- */
@Override
public boolean isRepresentationManagedByEditor(final DRepresentation representation, final IEditorPart editorPart) {
for (final DialectUI dialect : dialects.values()) {
@@ -231,12 +183,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return false;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationDescriptionManagedByEditor(org.eclipse.sirius.viewpoint.description.RepresentationDescription,
- * org.eclipse.ui.IEditorPart)
- */
@Override
public boolean isRepresentationDescriptionManagedByEditor(final RepresentationDescription representationDescription, final IEditorPart editor) {
for (final DialectUI dialect : dialects.values()) {
@@ -247,11 +193,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return false;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getEditorName(org.eclipse.sirius.viewpoint.DRepresentation)
- */
@Override
public String getEditorName(final DRepresentation representation) {
for (final DialectUI dialect : dialects.values()) {
@@ -262,11 +203,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return ""; //$NON-NLS-1$
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.DRepresentation)
- */
@Override
public boolean canHandle(final DRepresentation representation) {
for (final DialectUI dialect : dialects.values()) {
@@ -287,11 +223,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return false;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.description.RepresentationDescription)
- */
@Override
public boolean canHandle(final RepresentationDescription description) {
for (final DialectUI dialect : dialects.values()) {
@@ -302,11 +233,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return false;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription)
- */
@Override
public boolean canHandle(final RepresentationExtensionDescription description) {
for (final DialectUI dialect : dialects.values()) {
@@ -317,9 +243,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return false;
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean canExport(ExportFormat format) {
for (final DialectUI dialect : dialects.values()) {
@@ -330,12 +253,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return false;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#export(org.eclipse.sirius.viewpoint.DRepresentation,
- * org.eclipse.sirius.business.api.session.Session)
- */
@Override
public void export(final DRepresentation representation, final Session session, final IPath path, final ExportFormat format, final IProgressMonitor monitor) throws SizeTooLargeException {
for (final DialectUI dialect : dialects.values()) {
@@ -351,9 +268,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
}
}
- /**
- * {@inheritDoc}
- */
@Override
public void setSelection(DialectEditor dialectEditor, List<DRepresentationElement> selection) {
for (final DialectUI dialect : dialects.values()) {
@@ -368,9 +282,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
}
}
- /**
- * {@inheritDoc}
- */
@Override
public Collection<DSemanticDecorator> getSelection(DialectEditor editor) {
for (final DialectUI dialect : dialects.values()) {
@@ -382,9 +293,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return Collections.emptyList();
}
- /**
- * {@inheritDoc}
- */
@Override
public Collection<CommandParameter> provideTools(EObject cur) {
final Collection<CommandParameter> result = new ArrayList<CommandParameter>();
@@ -397,8 +305,11 @@ public class DialectUIManagerImpl implements DialectUIManager {
/**
* {@inheritDoc}
*
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getHierarchyLabelProvider(ILabelProvider)
+ * @deprecated use directly a
+ * {@link org.eclipse.sirius.ui.business.api.dialect.HierarchyLabelProvider}
+ * .
*/
+ @Deprecated
@Override
public ILabelProvider getHierarchyLabelProvider(ILabelProvider currentLabelProvider) {
ILabelProvider result = currentLabelProvider;
@@ -431,17 +342,11 @@ public class DialectUIManagerImpl implements DialectUIManager {
return false;
}
- /**
- * {@inheritDoc}
- */
@Override
public String completeToolTipText(String toolTipText, EObject eObject) {
return completeToolTipText(toolTipText, eObject, null);
}
- /**
- * {@inheritDoc}
- */
@Override
public String completeToolTipText(String toolTipText, EObject eObject, EStructuralFeature feature) {
String toolTip = toolTipText;
@@ -465,11 +370,6 @@ public class DialectUIManagerImpl implements DialectUIManager {
return toolTip;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIManager#isRefreshActivatedOnRepresentationOpening()
- */
@Override
public boolean isRefreshActivatedOnRepresentationOpening() {
return SiriusEditPlugin.getPlugin().getPreferenceStore().getBoolean(SiriusUIPreferencesKeys.PREF_REFRESH_ON_REPRESENTATION_OPENING.name());
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/viewpoint/provider/Messages.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/viewpoint/provider/Messages.java
index 3d86150256..fc5ab3af57 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/viewpoint/provider/Messages.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/viewpoint/provider/Messages.java
@@ -472,6 +472,9 @@ public final class Messages {
public static String GenericModelCreationPage_fileExtensionError;
@TranslatableMessage
+ public static String HierarchyLabelProvider_elementWihtoutNameLabel;
+
+ @TranslatableMessage
public static String InvalidModelingProjectMarkerUpdaterJob_updateMarkers;
@TranslatableMessage

Back to the top