private static Object getConstraint(Node node, Object key) { if (node.hasProperties()) { Object value = node.getProperties().get(key); if (value != null) { return value; } } return null; }
private static void setConstraint(Node node, Object key, Object value) { if (value == null) { node.getProperties().remove(key); } else { node.getProperties().put(key, value); } if (node.getParent() != null) { node.getParent().requestLayout(); } }
private static ObservableMap<Object, Object> getProperties(Node node) { return node.getProperties(); } }
/** called from the subnodes in FXML via MigPane.cc="..." */ public static void setCc(Node node, CC cc) { node.getProperties().put(FXML_CC_KEY, cc); }
/** * Finds out if an {@code Action} has been registered with the target {@code Node}, returning the action id if found. * * @param node the target node on which the action may have been registered. * * @return the name of the action registered with the target {@code Node} or {@code null} if not found. * * @since 2.8.0 */ @Nullable public static String getGriffonActionId(@Nonnull Node node) { requireNonNull(node, ERROR_NODE_NULL); return (String) node.getProperties().get(Action.class.getName()); }
/** * Associates a {@code Action} with a target {@code Node}. * * @param node the target node on which the action will be registered. * @param actionId the id of the action to be registered. * * @since 2.8.0 */ public static void setGriffonActionId(@Nonnull Node node, @Nonnull String actionId) { requireNonNull(node, ERROR_NODE_NULL); requireNonBlank(actionId, ERROR_ID_BLANK); node.getProperties().put(Action.class.getName(), actionId); }
/*************************************************************************** * * * Implementation * * * **************************************************************************/ private static final ObservableList<Decoration> getDecorations(Node target, boolean createIfAbsent) { @SuppressWarnings("unchecked") ObservableList<Decoration> decorations = (ObservableList<Decoration>) target.getProperties().get(DECORATIONS_PROPERTY_KEY); if (decorations == null && createIfAbsent) { decorations = FXCollections.observableArrayList(); target.getProperties().put(DECORATIONS_PROPERTY_KEY, decorations); } return decorations; }
private static Object getConstraint(Node node, Object key) { if (node.hasProperties()) { Object value = node.getProperties().get(key); if (value != null) { return value; } } return null; }
private static void setConstraint(Node node, Object key, Object value) { if (value == null) { node.getProperties().remove(key); } else { node.getProperties().put(key, value); } if (node.getParent() != null) { node.getParent().requestLayout(); } }
private static void updateManagedProperty(Node n, DeviceType type) { // first time we've set this invisible => store the preset if (!n.getProperties().containsKey(PROP_MANAGED_STATE)) { n.getProperties().put(PROP_MANAGED_STATE, n.isManaged()); } // don't track changes through this n.managedProperty().removeListener(MANAGED_LISTENER); // If it's visible we use the stored value for "managed" property n.setManaged(n.isVisible() ? (Boolean) n.getProperties().get(PROP_MANAGED_STATE) : false); // need to track changes through API n.managedProperty().addListener(MANAGED_LISTENER); }
/** * Access the current constraint value * * @param node * the node * @param key * the key * @return the value if associated */ protected static @Nullable Object getConstraint(@NonNull Node node, @NonNull Object key) { if (node.hasProperties()) { Object value = node.getProperties().get(key); if (value != null) { return value; } } return null; }
Class<?> connectorShapeClass = (Class<?>) n.getProperties().get(ConnectorShape.CONNECTOR_SHAPE_CLASS); if (nodeClass.isAssignableFrom(result.getClass())) { return result;
/** * Remember a layout constraint * * @param node * the node * @param key * the constraint key * @param value * the value */ protected static void setConstraint(@NonNull Node node, @NonNull Object key, @Nullable Object value) { if (value == null) { node.getProperties().remove(key); } else { node.getProperties().put(key, value); } if (node.getParent() != null) { node.getParent().requestLayout(); } }
/** * Access the current constraint value * * @param node * the node * @param key * the key * @return the value if associated */ protected static @Nullable Object getConstraint(@NonNull Node node, @NonNull Object key) { if (node.hasProperties()) { Object value = node.getProperties().get(key); if (value != null) { return value; } } return null; }
/** * Removes all the decorations that have previously been set on the given node. * @param target The node from which all previously set decorations should be removed. */ public static final void removeAllDecorations(Node target) { List<Decoration> decorations = getDecorations(target, true); List<Decoration> removed = FXCollections.observableArrayList(decorations); target.getProperties().remove(DECORATIONS_PROPERTY_KEY); updateDecorationsOnNode(target, null, removed); }
/** * Remember a layout constraint * * @param node * the node * @param key * the constraint key * @param value * the value */ protected static void setConstraint(@NonNull Node node, @NonNull Object key, @Nullable Object value) { if (value == null) { node.getProperties().remove(key); } else { node.getProperties().put(key, value); } if (node.getParent() != null) { node.getParent().requestLayout(); } }
private void configureMnemonicTarget( Node target ){ if( target.getProperties().containsKey("mnemonicTarget") ){ getLabel().setMnemonicParsing(true); getLabel().setLabelFor(target); } }
public static void setMnemonicTarget( Node target ){ Field parent = NodeHelper.findParentOfType( target, Field.class); if( parent != null ){ parent.getLabel().setMnemonicParsing(true); parent.getLabel().setLabelFor(target); } else { // we will detect this when this target is added as an input target.getProperties().put("mnemonicTarget",Boolean.TRUE); } }
Pane parent = (Pane) original.getParent(); replacement.getProperties().putAll( original.getProperties() ); original.getProperties().clear();
CC cc = (CC) node.getProperties().remove(FXML_CC_KEY); FXComponentWrapper wrapper = new FXComponentWrapper(node);