Class CSSSWTFontHelper
java.lang.Object
org.eclipse.e4.ui.css.swt.helpers.CSSSWTFontHelper
CSS SWT Font Helper to :
- get CSS2FontProperties from Font of SWT Control.
- get Font of SWT Control from CSS2FontProperties.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
On certain platforms, may have two font instances that actually are the samestatic CSS2FontProperties
getCSS2FontProperties
(Font font) Build CSS2FontProperties from SWT Font.static CSS2FontProperties
getCSS2FontProperties
(Font font, CSSElementContext context) static CSS2FontProperties
getCSS2FontProperties
(Widget widget, CSSElementContext context) Get CSS2FontProperties from the widget.static CSS2FontProperties
getCSS2FontProperties
(Widget widget, Font font, CSSElementContext context) Get CSS2FontProperties from Control stored into Data of Control.static FontData
getFirstFontData
(Font font) Return first FontData from SWT Font.static FontData
getFirstFontData
(Control control) Return first FontData from Control Font.static Font
getFont
(CSS2FontProperties fontProperties, FontData oldFontData, Display display) static Font
getFont
(CSS2FontProperties fontProperties, Control control) Get CSS2FontProperties from Font of JComponent and store CSS2FontProperties instance into ClientProperty of JComponent.static String
getFontComposite
(Font font) Return CSS Value font-family from SWT Fontstatic String
getFontComposite
(FontData fontData) static String
getFontComposite
(Control control) Return CSS Value font-family from Control Fontstatic FontData
getFontData
(CSS2FontProperties fontProperties, FontData oldFontData) Return FontData fromCSS2FontProperties
.static String
getFontFamily
(Font font) Return CSS Value font-family from SWT Fontstatic String
getFontFamily
(FontData fontData) static String
getFontFamily
(Widget widget) Return CSS Value font-family from the widget's font, if it has a fontstatic String
getFontSize
(Font font) Return CSS Value font-size from SWT Fontstatic String
getFontSize
(FontData fontData) static String
getFontSize
(Widget widget) Return CSS Value font-size the widget's font, if it has a fontstatic String
getFontStyle
(Font font) Return CSS Value font-style from SWT Fontstatic String
getFontStyle
(FontData fontData) static String
getFontStyle
(Widget widget) Return CSS Value font-style from the widget's font, if it has a fontstatic String
getFontWeight
(Font font) Return CSS Value font-weight from Control Fontstatic String
getFontWeight
(FontData fontData) static String
getFontWeight
(Widget widget) Return CSS Value font-weight from the widget's font, if it has a fontstatic int
getSWTStyle
(CSS2FontProperties fontProperties, FontData fontData) Return SWT style Font fromCSS2FontProperties
.static boolean
static boolean
static boolean
static void
restoreDefaultFont
(CTabItem item) static void
restoreDefaultFont
(Control control) static void
Helper function to avoid setting fonts unnecessarilystatic void
Helper function to avoid setting fonts unnecessarilystatic void
storeDefaultFont
(CTabItem item) static void
storeDefaultFont
(Control control)
-
Field Details
-
FONT_DEFINITION_MARKER
- See Also:
-
-
Constructor Details
-
CSSSWTFontHelper
public CSSSWTFontHelper()
-
-
Method Details
-
getCSS2FontProperties
public static CSS2FontProperties getCSS2FontProperties(Widget widget, Font font, CSSElementContext context) Get CSS2FontProperties from Control stored into Data of Control. If CSS2FontProperties doesn't exist, create it from Font of Control and store it into Data of Control. -
getCSS2FontProperties
Get CSS2FontProperties from the widget. If CSS2FontProperties doesn't exist, create it from the widget's font, if it has one, and then store it in the widget's data if applicable.- Parameters:
widget
- the widget to retrieve CSS2 font properties from- Returns:
- the font properties of the specified widget, or
null
if none
-
getCSS2FontProperties
-
getCSS2FontProperties
Build CSS2FontProperties from SWT Font. -
getFont
Get CSS2FontProperties from Font of JComponent and store CSS2FontProperties instance into ClientProperty of JComponent. -
getFont
public static Font getFont(CSS2FontProperties fontProperties, FontData oldFontData, Display display) -
getFontData
Return FontData fromCSS2FontProperties
. -
hasFontDefinitionAsFamily
-
getSWTStyle
Return SWT style Font fromCSS2FontProperties
. -
getFontFamily
Return CSS Value font-family from the widget's font, if it has a font -
getFontFamily
Return CSS Value font-family from SWT Font -
getFontFamily
-
getFontSize
Return CSS Value font-size the widget's font, if it has a font -
getFontSize
Return CSS Value font-size from SWT Font -
getFontSize
-
getFontStyle
Return CSS Value font-style from the widget's font, if it has a font -
getFontStyle
Return CSS Value font-style from SWT Font -
getFontStyle
-
isItalic
-
getFontWeight
Return CSS Value font-weight from the widget's font, if it has a font -
getFontWeight
Return CSS Value font-weight from Control Font -
getFontWeight
-
isBold
-
getFontComposite
Return CSS Value font-family from Control Font -
getFontComposite
Return CSS Value font-family from SWT Font -
getFontComposite
-
getFirstFontData
Return first FontData from Control Font. -
getFirstFontData
Return first FontData from SWT Font. -
storeDefaultFont
-
storeDefaultFont
-
restoreDefaultFont
-
restoreDefaultFont
-
setFont
Helper function to avoid setting fonts unnecessarily -
setFont
Helper function to avoid setting fonts unnecessarily -
equals
On certain platforms, may have two font instances that actually are the same
-