private void hideShowBehaviour(Node node){ node.visibleProperty().bind(enabled); node.managedProperty().bind(enabled); node.disableProperty().bind(Bindings.not(enabled)); }
closeButton.managedProperty().bind(closeButton.visibleProperty()); closeButton.setVisible(false);
protected void doLayout(AbstractTableStructure ts) { if (ts.getToolbar().isPresent()) { toolbar = ts.getToolbar().get(); actionsAndFiltersContainer.getChildren().add(toolbar); HBox.setHgrow(toolbar, Priority.NEVER); if(!toolbar.managedProperty().isBound()) { toolbar.managedProperty().bind(toolbar.visibleProperty()); } } }
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); }
import javafx.application.Application; import javafx.scene.*; import javafx.scene.control.*; import javafx.stage.Stage; public class DialogClosure extends Application{ @Override public void start(Stage stage) throws Exception { Button openDialog = new Button("Open Dialog"); openDialog.setOnAction(event -> { Dialog dialog = new Dialog(); dialog.getDialogPane().getButtonTypes().add(ButtonType.CLOSE); Node closeButton = dialog.getDialogPane().lookupButton(ButtonType.CLOSE); closeButton.managedProperty().bind(closeButton.visibleProperty()); closeButton.setVisible(false); dialog.showAndWait(); }); stage.setScene(new Scene(openDialog)); stage.show(); } public static void main(String[] args) { launch(args); } }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); locationContainer.managedProperty().bind(locationContainer.visibleProperty()); locationContainer.setVisible(false); primaryMenuButton.getDisplay().managedProperty().bind(primaryMenuButton.getDisplay().visibleProperty()); }
nodecontent.managedProperty().bind(nodecontent.visibleProperty()); selectableCompsLayout.getChildren().add(nodecontent);
header.setFormRowEditor(this); header.buildFrom(controller, inlineActionconfiguration); header.getDisplay().managedProperty().bind(header.getDisplay().visibleProperty()); rootLayout.setTop(header.getDisplay());
closeButton.managedProperty().bind(closeButton.visibleProperty()); closeButton.setVisible(false);
closeButton.managedProperty().bind(closeButton.visibleProperty()); closeButton.setVisible(false);