final Button button = new Button("I love you", imageView); button.setStyle("-fx-base: coral;"); button.setContentDisplay(ContentDisplay.TOP); button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) {
Button b = new Button("text", graphics); b.setContentDisplay(ContentDisplay.TOP);
public Button createIconButton(GlyphIcons icon, String text, String iconSize, String fontSize, ContentDisplay contentDisplay) { Text label = createIcon(icon, iconSize); Button button = new Button(text); button.setStyle("-fx-font-size: " + fontSize); button.setGraphic(label); button.setContentDisplay(contentDisplay); return button; }
btBuscaOrdem.setContentDisplay(ContentDisplay.GRAPHIC_ONLY); btBuscaLote.setStyle("-fx-content-display: graphic-only;");
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); button.setDefaultButton(configuration.booleanPropertyValueOf(XMLConstants.DEFAULT).orElse(false)); ComponentToLabeledHelper.setTooltip(configuration, button, (AbstractViewController) controller); IconUtils.setIcon(button, configuration); NodeHelper.styleClassAddAll(button, configuration); button.getStyleClass().add("ep-button"); // content display final String upperCase = configuration.getPropertyValue("upperCase"); ComponentToLabeledHelper.setText(configuration, button, "true".equalsIgnoreCase(upperCase), (AbstractViewController) controller); if(AbstractApplicationRunner.isDesktop()) { final String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE, "LEFT"); button.setContentDisplay(ContentDisplay.valueOf(displayMode)); } else { final String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE); if(StringUtils.isNotBlank(displayMode)) { button.setContentDisplay(ContentDisplay.valueOf(displayMode)); } } }
final Button button = new Button("I love you", imageView); button.setStyle("-fx-base: coral;"); button.setContentDisplay(ContentDisplay.TOP); button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) {
Button result = new Button(tag,closeImg); result.setPrefHeight(20); result.setContentDisplay(ContentDisplay.RIGHT);
((Button) e.getDisplay()).setContentDisplay(ContentDisplay.GRAPHIC_ONLY); ((Button) e.getDisplay()).disableProperty().bind(Bindings.not(tableView.hasSelectedRowProperty())); e.getDisplay().getStyleClass().add("flat-action-button");
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.controller = (AbstractViewController) controller; backIcon = new Button(); backIcon.setOnAction(e -> goBack()); IconUtils.setHeaderNavigationBack(backIcon); backIcon.getStyleClass().addAll("ep-headerless-app-header-button", "hand-hover"); backIcon.setDisable(true); backIcon.setVisible(true); backIcon.setContentDisplay(ContentDisplay.GRAPHIC_ONLY); backIcon.setAlignment(Pos.CENTER); getChildren().addAll(backIcon); getStyleClass().addAll("hand-hover"); //getStyleClass().add("ep-primary-menu-with-navbar-top-toolbar"); //getStyleClass().add("ep-primary-menu-with-navbar-toolbar"); setAlignment(Pos.CENTER); setMinHeight(54); addEventFilter(MouseEvent.MOUSE_CLICKED, e->{ }); }
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; } }