Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Fasani2023-06-21 14:34:07 +0000
committersdarracq2023-06-30 13:02:19 +0000
commitd04c09cd8e0bc451f77914aab802178a4b4cf0be (patch)
treec4f33eedf65d4eea9ec20daae3995f8845e5861b /plugins
parent602b69276607b9121475e10318bc3bffe9541369 (diff)
downloadorg.eclipse.sirius-master.tar.gz
org.eclipse.sirius-master.tar.xz
org.eclipse.sirius-master.zip
[582106] Have reset style button disabled once clicked on edgeHEADmaster
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=582106 Change-Id: I0650cde66d1e46f7bf0f4b4256a3d9bf319bee8f Signed-off-by: Samuel Darracq <samuel.darracq@obeo.fr> Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/FontFormatUpdater.java25
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java3
2 files changed, 7 insertions, 21 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/FontFormatUpdater.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/FontFormatUpdater.java
index bef140cf95..0d516a21f6 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/FontFormatUpdater.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/FontFormatUpdater.java
@@ -47,8 +47,8 @@ import org.eclipse.sirius.viewpoint.Style;
import org.eclipse.sirius.viewpoint.ViewpointPackage;
/**
- * This class update the notation and viewpoint models font style attributes
- * when it receives a notification about a Node font style changes.
+ * This class update the notation and viewpoint models font style attributes when it receives a notification about a
+ * Node font style changes.
*
* Make sure to attach and detach the updater to the editing domain.
*
@@ -70,7 +70,7 @@ public class FontFormatUpdater extends ResourceSetListenerImpl {
* Default constructor.
*
* @param domain
- * the current editing domain.
+ * the current editing domain.
*/
public FontFormatUpdater(final TransactionalEditingDomain domain) {
super(FEATURES_TO_REFACTOR_FILTER);
@@ -115,24 +115,7 @@ public class FontFormatUpdater extends ResourceSetListenerImpl {
Style style = dDiagramElement.getStyle();
if (isViewFontStylePropertiesDifferentOfGMFOne(style, fontStyle, features)) {
Set<String> featureNames = getFeatureNames(features);
- if (style instanceof EdgeStyle) {
- EdgeStyle edgeStyle = (EdgeStyle) style;
- if (edgeStyle.getBeginLabelStyle() != null) {
- featureNames.addAll(edgeStyle.getBeginLabelStyle().getCustomFeatures());
- Command addCustomFeaturesCmd = SetCommand.create(getTarget(), edgeStyle.getBeginLabelStyle(), ViewpointPackage.Literals.CUSTOMIZABLE__CUSTOM_FEATURES, featureNames);
- cc.append(addCustomFeaturesCmd);
- }
- if (edgeStyle.getCenterLabelStyle() != null) {
- featureNames.addAll(edgeStyle.getCenterLabelStyle().getCustomFeatures());
- Command addCustomFeaturesCmd = SetCommand.create(getTarget(), edgeStyle.getCenterLabelStyle(), ViewpointPackage.Literals.CUSTOMIZABLE__CUSTOM_FEATURES, featureNames);
- cc.append(addCustomFeaturesCmd);
- }
- if (edgeStyle.getEndLabelStyle() != null) {
- featureNames.addAll(edgeStyle.getEndLabelStyle().getCustomFeatures());
- Command addCustomFeaturesCmd = SetCommand.create(getTarget(), edgeStyle.getEndLabelStyle(), ViewpointPackage.Literals.CUSTOMIZABLE__CUSTOM_FEATURES, featureNames);
- cc.append(addCustomFeaturesCmd);
- }
- } else {
+ if (!(style instanceof EdgeStyle)) {
featureNames.addAll(style.getCustomFeatures());
Command addCustomFeaturesCmd = SetCommand.create(getTarget(), style, ViewpointPackage.Literals.CUSTOMIZABLE__CUSTOM_FEATURES, featureNames);
cc.append(addCustomFeaturesCmd);
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java
index 9c5a74967a..1c737ff0b1 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/ResetStylePropertiesToDefaultValuesActionTests.java
@@ -235,6 +235,9 @@ public class ResetStylePropertiesToDefaultValuesActionTests extends AbstractSiri
edgeStyleImpl = (EdgeStyleImpl) ((DRepresentationElement) ((Node) (editPart.getModel())).getElement()).getStyle();
// Verify that colors are back to the inital ones
TestCase.assertTrue(colors.equals(extractLabelColors(edgeStyleImpl)));
+ // Check that the "Reset style properties to default values" button is
+ // disabled
+ getResetStylePropertiesToDefaultValuesButton(true, false);
}
private List<Integer> extractLabelColors(EdgeStyleImpl edgeImpl) {

Back to the top