Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-10-25 06:56:36 -0400
committerCamille Letavernier2013-10-25 06:56:36 -0400
commitbd4533c4330ace059e27c929d311a6a033e666f8 (patch)
tree92b5f45b7d839113bc0d1d0ddb5e97a5672d974a /plugins
parent874179e6a3f49f0d0e8771cdaf589be3cad56e85 (diff)
downloadorg.eclipse.papyrus-bd4533c4330ace059e27c929d311a6a033e666f8.tar.gz
org.eclipse.papyrus-bd4533c4330ace059e27c929d311a6a033e666f8.tar.xz
org.eclipse.papyrus-bd4533c4330ace059e27c929d311a6a033e666f8.zip
420297: [CSS - Properties] CSS Engine shall support custom properties
https://bugs.eclipse.org/bugs/show_bug.cgi?id=420297
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java
index 1b554374d8d..f2dcb79960e 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/ResetStyleHandler.java
@@ -38,6 +38,7 @@ import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusC
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.common.helper.NotationHelper;
import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSAnnotations;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSStyles;
/**
@@ -128,7 +129,7 @@ public class ResetStyleHandler extends AbstractHandler {
break;
} else {
//Reset the style attribute to their default value
- resetStyle(view);
+ resetStyle(view, true);
}
}
}
@@ -158,11 +159,20 @@ public class ResetStyleHandler extends AbstractHandler {
}
private void resetStyle(View view) {
- for(Object styleObject : view.getStyles()) {
- if(styleObject instanceof Style) {
+
+ Iterator<?> styleIterator = view.getStyles().iterator();
+ while(styleIterator.hasNext()) {
+ Object styleObject = styleIterator.next();
+ if(styleObject instanceof NamedStyle) {
+ NamedStyle customStyle = (NamedStyle)styleObject;
+ if(!CSSStyles.RESERVED_KEYWORDS.contains(customStyle.getName())) {
+ styleIterator.remove();
+ }
+ } else if(styleObject instanceof Style) {
resetStyle((Style)styleObject);
}
}
+
if(view instanceof Style) {
resetStyle((Style)view);
}

Back to the top