diff options
author | Maxime Porhel | 2015-10-19 09:23:03 +0000 |
---|---|---|
committer | Maxime Porhel | 2015-10-20 08:32:04 +0000 |
commit | ec934ba144abe8ac73f17354e99d437b0a57abfe (patch) | |
tree | 55ea56c049df05cac6884b495e7bbf83835589b1 | |
parent | a08b35c7947eb2328282998fdfdf560c7c3860f6 (diff) | |
download | org.eclipse.sirius-ec934ba144abe8ac73f17354e99d437b0a57abfe.tar.gz org.eclipse.sirius-ec934ba144abe8ac73f17354e99d437b0a57abfe.tar.xz org.eclipse.sirius-ec934ba144abe8ac73f17354e99d437b0a57abfe.zip |
[479935] Do not disable the stack options
The validation rules are here to warn the user.
Bug: 479935
Change-Id: I334b7dbf8a3ec45a84532faf19ab5adde02d9541
1 files changed, 4 insertions, 28 deletions
diff --git a/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/properties/section/description/containermapping/ContainerMappingChildrenPresentationPropertySectionSpec.java b/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/properties/section/description/containermapping/ContainerMappingChildrenPresentationPropertySectionSpec.java index 9abf5d8e3a..f28531f717 100644 --- a/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/properties/section/description/containermapping/ContainerMappingChildrenPresentationPropertySectionSpec.java +++ b/plugins/org.eclipse.sirius.editor.diagram/src/org/eclipse/sirius/diagram/editor/properties/section/description/containermapping/ContainerMappingChildrenPresentationPropertySectionSpec.java @@ -36,9 +36,7 @@ public class ContainerMappingChildrenPresentationPropertySectionSpec extends Con if (button != null && eObject instanceof ContainerMapping) { ContainerMapping containerMapping = (ContainerMapping) eObject; Option<String> experimentalStackButtons = shouldMarkCompartmentsExperimental(containerMapping); - Option<String> disabledStackButtons = shouldDisableCompartments(containerMapping); - - updateControls(experimentalStackButtons, disabledStackButtons); + updateControls(experimentalStackButtons); } } @@ -62,15 +60,7 @@ public class ContainerMappingChildrenPresentationPropertySectionSpec extends Con return experimental ? Options.newSome(message.toString()) : Options.<String> newNone(); } - private Option<String> shouldDisableCompartments(ContainerMapping containerMapping) { - String message = null; - if (!containerMapping.getAllNodeMappings().isEmpty()) { - message = "The mapping contains node mappings, it cannot be a RegionContainer mapping."; - } - return Options.newSome(message); - } - - private void updateControls(Option<String> experimentalStackButtons, Option<String> disabledStackButtons) { + private void updateControls(Option<String> experimentalStackButtons) { String hStackButtonText = getText(ContainerLayout.HORIZONTAL_STACK); String vStackButtonText = getText(ContainerLayout.VERTICAL_STACK); @@ -78,13 +68,10 @@ public class ContainerMappingChildrenPresentationPropertySectionSpec extends Con boolean needsLayout = false; for (Button b : button) { if (hStackButtonText.equals(b.getText()) || vStackButtonText.equals(b.getText())) { - needsLayout = updateButton(b, experimentalStackButtons, disabledStackButtons) || needsLayout; + needsLayout = updateButton(b, experimentalStackButtons) || needsLayout; } } - // Update group - updateGroup(disabledStackButtons); - // If the section has been created with italic buttons, it might require // layout be able to display the buttons with normal font. if (needsLayout) { @@ -92,7 +79,7 @@ public class ContainerMappingChildrenPresentationPropertySectionSpec extends Con } } - private boolean updateButton(Button b, Option<String> experimentalStackButtons, Option<String> disabledStackButtons) { + private boolean updateButton(Button b, Option<String> experimentalStackButtons) { boolean needsLayout = false; if (experimentalStackButtons.some()) { b.setToolTipText(experimentalStackButtons.get()); @@ -117,17 +104,6 @@ public class ContainerMappingChildrenPresentationPropertySectionSpec extends Con } } - b.setEnabled(!disabledStackButtons.some()); return needsLayout; } - - private void updateGroup(Option<String> disabledStackButtons) { - if (group != null) { - if (disabledStackButtons.some()) { - group.setToolTipText(disabledStackButtons.get()); - } else { - group.setToolTipText(null); - } - } - } } |