Package org.scijava.widget
Class WidgetStyle
- java.lang.Object
-
- org.scijava.widget.WidgetStyle
-
public class WidgetStyle extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetStyleModifier(String widgetStyle, String target)Get the modifying value for a given style attribute in a style declaration.static String[]getStyleModifiers(String widgetStyle, String target)Get an array of all modifying values for a given style attribute.static booleanisStyle(String widgetStyle, String target)Check whether a given widget style contains the target style.static booleanisStyle(ModuleItem<?> item, String target)Check whether a givenModuleItemhas the target style.
-
-
-
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-separatedString; trailing spaces are ignored.target- The style being checked, case-insensitive.- Returns:
trueif the target style matches.
-
isStyle
public static boolean isStyle(ModuleItem<?> item, String target)
Check whether a givenModuleItemhas the target style.- Parameters:
item- The module item to test.target- The style being checked, case-insensitive.- Returns:
trueif 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"].
-
-