public final class JavaFXUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
JavaFXUtils.Predicate<T>
An unary function that evaluates its input.
|
Modifier and Type | Method and Description |
---|---|
static void |
configure(ButtonBase control,
JavaFXAction action) |
static void |
configure(CheckBox control,
JavaFXAction action) |
static void |
configure(CheckMenuItem control,
JavaFXAction action) |
static void |
configure(MenuItem control,
JavaFXAction action) |
static void |
configure(RadioButton control,
JavaFXAction action) |
static void |
configure(RadioMenuItem control,
JavaFXAction action) |
static void |
configure(ToggleButton control,
JavaFXAction action) |
static void |
connectActions(Object node,
GriffonController controller) |
static <E> ObservableList<E> |
createJavaFXThreadProxyList(ObservableList<E> source)
Wraps an ObservableList, publishing updates inside the UI thread.
|
static <B> Property<?> |
extractProperty(B bean,
String propertyName) |
static Object |
findElement(Object root,
JavaFXUtils.Predicate<Object> predicate) |
static Object |
findElement(Object root,
String id) |
static Collection<Object> |
findElements(Object root,
JavaFXUtils.Predicate<Object> predicate) |
static Node |
findNode(Node root,
String id) |
static String |
getGriffonActionId(MenuItem menuItem)
Finds out if an
Action has been registered with the target MenuItem , returning the aciton id if found. |
static String |
getGriffonActionId(Node node)
Finds out if an
Action has been registered with the target Node , returning the aciton id if found. |
static Window |
getWindowAncestor(Object node) |
static Node |
resolveIcon(String iconUrl) |
static void |
setGraphic(Labeled control,
Image graphic) |
static void |
setGraphic(Labeled control,
Node graphic) |
static void |
setGraphic(MenuItem control,
Image graphic) |
static void |
setGraphic(MenuItem control,
Node graphic) |
static void |
setGriffonActionId(MenuItem menuItem,
String actionId)
Associates a
Action with a target MenuItem . |
static void |
setGriffonActionId(Node node,
String actionId)
Associates a
Action with a target Node . |
static void |
setIcon(Labeled control,
String iconUrl) |
static void |
setIcon(MenuItem control,
String iconUrl) |
static void |
setStyleClass(MenuItem node,
String styleClass) |
static void |
setStyleClass(MenuItem node,
String styleClass,
boolean remove) |
static void |
setStyleClass(Node node,
String styleClass) |
static void |
setStyleClass(Node node,
String styleClass,
boolean remove) |
static void |
setTooltip(Control control,
String text) |
public static void setGriffonActionId(@Nonnull Node node, @Nonnull String actionId)
Action
with a target Node
.node
- the target node on which the action will be registered.actionId
- the id of the action to be registered.@Nullable public static String getGriffonActionId(@Nonnull Node node)
Action
has been registered with the target Node
, returning the aciton id if found.node
- the target node on which the action may have been registered.Node
or null
if not found.public static void setGriffonActionId(@Nonnull MenuItem menuItem, @Nonnull String actionId)
Action
with a target MenuItem
.menuItem
- the target menuItem on which the action will be registered.actionId
- the id of the action to be registered.@Nullable public static String getGriffonActionId(@Nonnull MenuItem menuItem)
Action
has been registered with the target MenuItem
, returning the aciton id if found.menuItem
- the target menuItem on which the action may have been registered.MenuItem
or null
if not found.@Nonnull public static <E> ObservableList<E> createJavaFXThreadProxyList(@Nonnull ObservableList<E> source)
E
- the list's paramter type.source
- the ObservableList to be wrapped@Nonnull public static <B> Property<?> extractProperty(@Nonnull B bean, @Nonnull String propertyName)
public static void connectActions(@Nonnull Object node, @Nonnull GriffonController controller)
public static void configure(@Nonnull ToggleButton control, @Nonnull JavaFXAction action)
public static void configure(@Nonnull CheckBox control, @Nonnull JavaFXAction action)
public static void configure(@Nonnull RadioButton control, @Nonnull JavaFXAction action)
public static void configure(@Nonnull ButtonBase control, @Nonnull JavaFXAction action)
public static void configure(@Nonnull CheckMenuItem control, @Nonnull JavaFXAction action)
public static void configure(@Nonnull RadioMenuItem control, @Nonnull JavaFXAction action)
public static void configure(@Nonnull MenuItem control, @Nonnull JavaFXAction action)
public static void setStyleClass(@Nonnull Node node, @Nonnull String styleClass, boolean remove)
public static void setStyleClass(@Nonnull MenuItem node, @Nonnull String styleClass, boolean remove)
@Nullable public static Object findElement(@Nonnull Object root, @Nonnull JavaFXUtils.Predicate<Object> predicate)
@Nonnull public static Collection<Object> findElements(@Nonnull Object root, @Nonnull JavaFXUtils.Predicate<Object> predicate)