public class EEFStyleHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
EEFStyleHelper.IEEFTextStyleCallback
This class will be called to update the style of the text.
|
Constructor and Description |
---|
EEFStyleHelper(org.eclipse.sirius.common.interpreter.api.IInterpreter interpreter,
org.eclipse.sirius.common.interpreter.api.IVariableManager variableManager)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
applyTextStyle(java.lang.String fontNameExpression,
java.lang.String fontSizeExpression,
java.lang.String fontStyleExpression,
org.eclipse.swt.graphics.Font defaultFont,
java.lang.String backgroundColorExpression,
java.lang.String foregroundColorExpression,
EEFStyleHelper.IEEFTextStyleCallback callback)
Uses the given expressions to update the style using the given callback.
|
protected org.eclipse.emf.ecore.util.Switch<EEFWidgetStyle> |
getConditionalStyleToWidgetStyleSwitch()
Returns the switch to use to find the style of a conditional style.
|
protected org.eclipse.emf.ecore.util.Switch<java.util.List<EEFConditionalStyle>> |
getDescriptionToConditionalStylesSwitch()
Returns the switch to use to find the conditional styles of a widget description.
|
protected org.eclipse.emf.ecore.util.Switch<EEFWidgetStyle> |
getDescriptionToWidgetStyleSwitch()
Returns the switch to use to find the style of a description.
|
EEFWidgetStyle |
getWidgetStyle(EEFWidgetDescription widgetDescription)
Returns the widget style to use from the given widget description.
|
public EEFStyleHelper(org.eclipse.sirius.common.interpreter.api.IInterpreter interpreter, org.eclipse.sirius.common.interpreter.api.IVariableManager variableManager)
interpreter
- The interpretervariableManager
- The variable managerpublic EEFWidgetStyle getWidgetStyle(EEFWidgetDescription widgetDescription)
widgetDescription
- The widget descriptionprotected org.eclipse.emf.ecore.util.Switch<java.util.List<EEFConditionalStyle>> getDescriptionToConditionalStylesSwitch()
return new ComposedSwitch<>(Arrays.asList(new EEFDescriptionToConditionalStylesSwitch(), new
CustomDescriptionToConditionalStylesSwitch()));
protected org.eclipse.emf.ecore.util.Switch<EEFWidgetStyle> getConditionalStyleToWidgetStyleSwitch()
return new ComposedSwitch<>(Arrays.asList(new EEFConditionalStyleToWidgetStyleSwitch(), new
CustomConditionalStyleToWidgetStyleSwitch()));
protected org.eclipse.emf.ecore.util.Switch<EEFWidgetStyle> getDescriptionToWidgetStyleSwitch()
return new ComposedSwitch<>(Arrays.asList(new EEFDescriptionToWidgetStyleSwitch(), new
EEFDescriptionToWidgetStyleSwitch()));
public void applyTextStyle(java.lang.String fontNameExpression, java.lang.String fontSizeExpression, java.lang.String fontStyleExpression, org.eclipse.swt.graphics.Font defaultFont, java.lang.String backgroundColorExpression, java.lang.String foregroundColorExpression, EEFStyleHelper.IEEFTextStyleCallback callback)
fontNameExpression
- The expression used to compute the name of the fontfontSizeExpression
- The expression used to compute the size of the fontfontStyleExpression
- The expression used to compute the style of the fontdefaultFont
- The default fontbackgroundColorExpression
- The expression used to compute the background color of the fontforegroundColorExpression
- The expression used to compute the foreground color of the fontcallback
- The callback which will be called when a property of the style has been computed