Class WidgetStyle


  • public class WidgetStyle
    extends Object
    • Method Detail

      • isStyle

        public static boolean isStyle​(String widgetStyle,
                                      String target)
        Check whether a given widget style contains the target style.
        Parameters:
        widgetStyle - The style declaration to test, usually a comma-separated String; trailing spaces are ignored.
        target - The style being checked, case-insensitive.
        Returns:
        true if the target style matches.
      • isStyle

        public static boolean isStyle​(ModuleItem<?> item,
                                      String target)
        Check whether a given ModuleItem has the target style.
        Parameters:
        item - The module item to test.
        target - The style being checked, case-insensitive.
        Returns:
        true if the module item has the target style.
      • getStyleModifier

        public static String getStyleModifier​(String widgetStyle,
                                              String target)
        Get the modifying value for a given style attribute in a style declaration.

        For example, for style="format:#0.00", this will return "#0.00".

        Parameters:
        widgetStyle - The style declaration string, e.g. "format:#0.00".
        target - The target style attribute, e.g. "format".
        Returns:
        The modifier for the given target, e.g. "#0.00".
      • getStyleModifiers

        public static String[] getStyleModifiers​(String widgetStyle,
                                                 String target)
        Get an array of all modifying values for a given style attribute.

        For example, for style="extensions:png/gif/bmp", this will return ["png", "gif", "bmp"].

        Parameters:
        widgetStyle - The style declaration string, e.g. "extensions:png/gif/bmp".
        target - The target style attribute, e.g. "extensions".
        Returns:
        An array of modifiers for the given target, e.g. ["png", "gif", "bmp"].