/** * Constructor */ public SingleLocationNavigationBar() { super(); IconUtils.setHeaderNavigationBack(backIcon); backIcon.setOnAction(e -> goBack()); backIcon.getStyleClass().addAll("app-header-button", "simple-button"); backIcon.managedProperty().bind(backIcon.visibleProperty()); backIcon.setDisable(true); getChildren().addAll(backIcon, locationContainer); getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar"); getStyleClass().add("ep-primary-menu-with-navbar-toolbar"); managedProperty().bind(visibleProperty()); }
@Override public void changed( ObservableValue<? extends Service<?>> observableValue, Service<?> oldValue, Service<?> newValue) { try { if (oldValue != null) { taskTitleLabel.textProperty().unbind(); taskMessageLabel.textProperty().unbind(); taskProgress.progressProperty().unbind(); killTaskButton.visibleProperty().unbind(); } if (newValue != null) { taskTitleLabel.textProperty().bind(newValue.titleProperty()); taskMessageLabel.textProperty().bind(newValue.messageProperty()); taskProgress.progressProperty().bind(newValue.progressProperty()); if (newValue instanceof DataFxService<?>) { killTaskButton.visibleProperty().bind(((DataFxService<?>) newValue).cancelableProperty()); } else { killTaskButton.visibleProperty().set(true); } anchorPane.setVisible(true); } else { anchorPane.setVisible(false); } } catch (Exception e) { e.printStackTrace(); } } });
@Override public void changed( ObservableValue<? extends Service<?>> observableValue, Service<?> oldValue, Service<?> newValue) { try { if (oldValue != null) { taskTitleLabel.textProperty().unbind(); taskMessageLabel.textProperty().unbind(); taskProgress.progressProperty().unbind(); killTaskButton.visibleProperty().unbind(); } if (newValue != null) { taskTitleLabel.textProperty().bind(newValue.titleProperty()); taskMessageLabel.textProperty().bind(newValue.messageProperty()); taskProgress.progressProperty().bind(newValue.progressProperty()); newValue.progressProperty().addListener((e) -> System.out.println("Changed: " + newValue.progressProperty().get())); if (newValue instanceof DataFxService<?>) { killTaskButton.visibleProperty().bind(((DataFxService<?>) newValue).cancelableProperty()); } else { killTaskButton.visibleProperty().set(true); } anchorPane.setVisible(true); } else { anchorPane.setVisible(false); } } catch (Exception e) { e.printStackTrace(); } } });
closeFilterButton.managedProperty().bind(closeFilterButton.visibleProperty()); closeFilterButton.setVisible(false); closeFilterButton.setOnAction(e -> endFiltering()); IconUtils.setFontIcon("fa-close:20", closeFilterButton); filterButton.managedProperty().bind(filterButton.visibleProperty()); IconUtils.setFontIcon("fa-filter:20", filterButton); actionsAndFiltersContainer.getChildren().add(0, filterButton);
maximize.managedProperty().bind(maximize.visibleProperty()); maximize.visibleProperty().bind(Bindings.not(maximizeProperty)); restore.managedProperty().bind(restore.visibleProperty()); restore.visibleProperty().bind(maximizeProperty); iconify.managedProperty().bind(iconify.visibleProperty());
/** * Constructor */ public SingleLocationPrimaryMenuWithNavigationBar() { super(); IconUtils.setHeaderNavigationBack(backIcon); backIcon.setOnAction(e -> goBack()); backIcon.getStyleClass().remove("jfx-button"); backIcon.getStyleClass().remove("button"); backIcon.managedProperty().bind(backIcon.visibleProperty()); backIcon.setVisible(false); final HBox box = NodeHelper.wrapInHbox(backIcon); box.getStyleClass().add("ep-navbar-top-toolbar-back-icon-container"); topToolbar.getChildren().addAll(box, locationContainer); getChildren().addAll(topToolbar, bottomToolbar); topToolbar.getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar"); bottomToolbar.getStyleClass().add("ep-primary-menu-with-navbar-bottom-toolbar"); getStyleClass().add("ep-primary-menu-with-navbar-toolbar"); // location0.getStyleClass().add("current-location-item-label"); topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty()); topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty()); bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.managedProperty().bind(bottomToolbar.visibleProperty()); NodeHelper.setHVGrow(topToolbar, bottomToolbar, this); bottomToolbar.setVisible(false); }
protected ButtonBase build(VLViewComponentXML configuration) { if ("button".equals(type)) { Button buttonAction = new JFXButton(); buttonAction.getStyleClass().remove(0); buttonAction.getStyleClass().removeAll("jfx-button", "button"); buttonAction.managedProperty().bind(buttonAction.visibleProperty()); NodeHelper.setTitle(buttonAction, configuration, controller); IconUtils.setIcon(buttonAction, configuration); NodeHelper.setStyleClass(buttonAction, configuration, "styleClass", true); buttonAction.getStyleClass().add("ep-button"); String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE, "LEFT"); buttonAction.setContentDisplay(ContentDisplay.valueOf(displayMode)); boolean readOnly = configuration.getBooleanProperty("readOnly", false); buttonAction.setDisable(readOnly); buttonAction.addEventFilter(ActionEvent.ACTION, e -> onAction(buttonAction)); return buttonAction; } else { Hyperlink hyperlinkAction = new Hyperlink(); hyperlinkAction.managedProperty().bind(hyperlinkAction.visibleProperty()); NodeHelper.setTitle(hyperlinkAction, configuration, controller); NodeHelper.setStyleClass(hyperlinkAction, configuration, "styleClass", true); IconUtils.setIcon(hyperlinkAction, configuration); boolean readOnly = configuration.getBooleanProperty("readOnly", false); hyperlinkAction.setDisable(readOnly); hyperlinkAction.addEventFilter(ActionEvent.ACTION, e -> onAction(hyperlinkAction)); return hyperlinkAction; } }
/** * Constructor */ public PrimaryMenuWithNavigationBar() { super(); IconUtils.setHeaderNavigationBack(backIcon); backIcon.setOnAction(e -> goBack()); backIcon.getStyleClass().addAll("app-header-button", "hand-hover"); backIcon.managedProperty().bind(backIcon.visibleProperty()); // TO DO HANDLE PREVIOUS AND CURRENT previousLocation.managedProperty().bind(previousLocation.visibleProperty()); previousLocation.setVisible(false); topToolbar.getChildren().addAll(backIcon, currentLocation); bottomToolbar.getChildren().add(previousLocation); getChildren().addAll(topToolbar, bottomToolbar); topToolbar.getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar"); bottomToolbar.getStyleClass().add("ep-primary-menu-with-navbar-bottom-toolbar"); getStyleClass().add("ep-primary-menu-with-navbar-toolbar"); topToolbar.minWidthProperty().bind(topToolbar.prefWidthProperty()); // topToolbar.maxWidthProperty().bind(topToolbar.prefWidthProperty()); topToolbar.minHeightProperty().bind(topToolbar.prefHeightProperty()); topToolbar.maxHeightProperty().bind(topToolbar.prefHeightProperty()); bottomToolbar.minWidthProperty().bind(bottomToolbar.prefWidthProperty()); // bottomToolbar.maxWidthProperty().bind(bottomToolbar.prefWidthProperty()); bottomToolbar.minHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.maxHeightProperty().bind(bottomToolbar.prefHeightProperty()); bottomToolbar.managedProperty().bind(bottomToolbar.visibleProperty()); NodeHelper.setHVGrow(topToolbar, bottomToolbar, this); bottomToolbar.setVisible(false); }