Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMélanie Bats2016-12-05 04:57:38 -0500
committerStéphane Bégaudeau2017-04-14 04:30:12 -0400
commit8b52ee5d13cc89c5e2057c517992357899bbcdf7 (patch)
tree1372cd9000c60125c54139164deeaf8f0c8e1648
parente89e0694be00795da8656b45aaa711e144b3b83c (diff)
downloadorg.eclipse.eef-8b52ee5d13cc89c5e2057c517992357899bbcdf7.tar.gz
org.eclipse.eef-8b52ee5d13cc89c5e2057c517992357899bbcdf7.tar.xz
org.eclipse.eef-8b52ee5d13cc89c5e2057c517992357899bbcdf7.zip
[515282] Reset Widget Label to default valuesv1.9.1
Bug: 515282 Change-Id: I4e6a69a74772ea5ba36322977ec14f509a3dd6fd Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/EEFStyleHelper.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/EEFStyleHelper.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/EEFStyleHelper.java
index ebed4a4e9..901d4d455 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/EEFStyleHelper.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/EEFStyleHelper.java
@@ -27,6 +27,7 @@ import org.eclipse.emf.ecore.util.Switch;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
@@ -153,9 +154,13 @@ public class EEFStyleHelper {
String backgroundColorExpression, String foregroundColorExpression, IEEFTextStyleCallback callback) {
if (!Util.isBlank(foregroundColorExpression)) {
this.applyForegroundColor(foregroundColorExpression, callback);
+ } else {
+ callback.applyForegroundColor(new EEFColor((Color) null));
}
if (!Util.isBlank(backgroundColorExpression)) {
this.applyBackgroundColor(backgroundColorExpression, callback);
+ } else {
+ callback.applyBackgroundColor(new EEFColor((Color) null));
}
String fontStyleValue = EvalFactory.of(interpreter, variableManager).logIfInvalidType(String.class).evaluate(fontStyleExpression);
@@ -216,10 +221,11 @@ public class EEFStyleHelper {
.defaultValue(Integer.valueOf(defaultFontData.getHeight())).evaluate(fontSizeExpression).intValue();
int fontStyle = defaultFontData.getStyle();
- if (fontStyleValue != null && fontStyleValue.contains("bold")) { //$NON-NLS-1$
+ if (fontStyleValue == null) {
+ fontStyle = 0;
+ } else if (fontStyleValue.contains("bold")) { //$NON-NLS-1$
fontStyle = fontStyle | SWT.BOLD;
- }
- if (fontStyleValue != null && fontStyleValue.contains("italic")) { //$NON-NLS-1$
+ } else if (fontStyleValue.contains("italic")) { //$NON-NLS-1$
fontStyle = fontStyle | SWT.ITALIC;
}
EEFFont font = new EEFFont(fontName, fontSize, fontStyle);

Back to the top