diff options
author | Maxime PORHEL | 2014-05-28 14:22:14 +0000 |
---|---|---|
committer | Maxime Porhel | 2014-06-02 08:43:40 +0000 |
commit | f27908c340c4491f3e676d179797c13e61da1cff (patch) | |
tree | 5baf98da11956f780e5ca32be292fb19ac99cd2b | |
parent | 763812c6f2c74a5b7f2b5891347f7c5150967ce7 (diff) | |
download | org.eclipse.sirius-f27908c340c4491f3e676d179797c13e61da1cff.tar.gz org.eclipse.sirius-f27908c340c4491f3e676d179797c13e61da1cff.tar.xz org.eclipse.sirius-f27908c340c4491f3e676d179797c13e61da1cff.zip |
[435879] Disable SetEObject model operation from sirius.editor
It was previously done from sirius.editor.diagram.
Bug: 435879
Change-Id: I620ede63b9acdc9fec119d63138ab13b5b13938a
Signed-off-by: Maxime PORHEL <maxime.porhel@obeo.fr>
3 files changed, 62 insertions, 6 deletions
diff --git a/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/tools/internal/editor/SiriusDiagramEditorCustomization.java b/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/tools/internal/editor/SiriusDiagramEditorCustomization.java index ea6d37c269..915f1d1f6c 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/tools/internal/editor/SiriusDiagramEditorCustomization.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/tools/internal/editor/SiriusDiagramEditorCustomization.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014 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 @@ -15,11 +15,10 @@ import java.util.LinkedHashSet; import org.eclipse.emf.ecore.EModelElement; import org.eclipse.sirius.diagram.description.DescriptionPackage; import org.eclipse.sirius.editor.tools.api.editor.EditorCustomization; -import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; /** - * We deactivate the tool section creation menu on DiagramDescription. We - * shouldn't have tool section out of a layer. + * We deactivate several menu creations. We shouldn't have tool section or + * mappings out of a layer. * * @author fbarbin * @@ -42,7 +41,6 @@ public class SiriusDiagramEditorCustomization implements EditorCustomization { deprecation.add(DescriptionPackage.eINSTANCE.getDiagramDescription_ToolSection()); deprecation.add(DescriptionPackage.eINSTANCE.getDiagramDescription_ReusedTools()); deprecation.add(DescriptionPackage.eINSTANCE.getDiagramDescription_ReusedMappings()); - deprecation.add(ToolPackage.eINSTANCE.getSetObject()); } /** diff --git a/plugins/org.eclipse.sirius.editor/plugin.xml b/plugins/org.eclipse.sirius.editor/plugin.xml index ac5d7c8661..3606e9de4f 100644 --- a/plugins/org.eclipse.sirius.editor/plugin.xml +++ b/plugins/org.eclipse.sirius.editor/plugin.xml @@ -1294,5 +1294,11 @@ </perspective> </extension> + <extension + point="org.eclipse.sirius.editor.editorCustomization"> + <customizer + class="org.eclipse.sirius.editor.tools.internal.editor.SiriusCoreEditorCustomization"></customizer> + </extension> + <!-- End of user code plugin.xml end specifics --> -</plugin>
\ No newline at end of file +</plugin> diff --git a/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/editor/SiriusCoreEditorCustomization.java b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/editor/SiriusCoreEditorCustomization.java new file mode 100644 index 0000000000..8db0d38b8c --- /dev/null +++ b/plugins/org.eclipse.sirius.editor/src/org/eclipse/sirius/editor/tools/internal/editor/SiriusCoreEditorCustomization.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2014 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.editor.tools.internal.editor; + +import java.util.LinkedHashSet; + +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.sirius.editor.tools.api.editor.EditorCustomization; +import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; + +/** + * We deactivate the SetEObject model operation. + * + * @author mporhel + * + */ +public class SiriusCoreEditorCustomization implements EditorCustomization { + + // Features referenced in this list will not have corresponding new child + // creation menus. + private final LinkedHashSet<EModelElement> deprecation; + + /** + * Create the customization. + */ + public SiriusCoreEditorCustomization() { + deprecation = new LinkedHashSet<EModelElement>(); + deprecation.add(ToolPackage.eINSTANCE.getSetObject()); + } + + /** + * {@inheritDoc} + */ + public boolean isHidden(final EModelElement metaElement) { + return deprecation.contains(metaElement); + } + + /** + * {@inheritDoc} + */ + public boolean showAllTab() { + return false; + } +} |