private Button buildButton(String text, boolean response) { Button button = new Button(text); button.getStyleClass().addAll(Style.BUTTON.css()); button.setOnAction(e -> { this.response = response; hide(); }); return button; }
public ClosePane(EventHandler<ActionEvent> handler) { setAlignment(Pos.CENTER_RIGHT); getStyleClass().addAll(Style.CONTAINER.css()); Button closeButton = new Button(DefaultI18nContext.getInstance().i18n("Close")); closeButton.getStyleClass().addAll(Style.BUTTON.css()); closeButton.setTextAlignment(TextAlignment.CENTER); closeButton.setOnAction(ofNullable(handler).orElse(defaultHandler)); getChildren().add(closeButton); } }
closeButton.getStyleClass().add("tab-close-button"); closeButton.setOnAction(action->{ TabPaneBehavior behavior = getBehavior();
OpenWithDialog initFor(InputPdfArgumentsLoadRequest event) { this.messageTitle .setText(DefaultI18nContext.getInstance().i18n("Select the task to perform on the following files")); filesList .setItems(FXCollections.observableArrayList(event.pdfs.stream().map(Path::toString).collect(toList()))); modules.forEach(m -> { if (m.descriptor().hasInputType(event.requiredInputTyle())) { Button current = new Button(m.descriptor().getName()); current.getStyleClass().addAll(Style.FOOTER_BUTTON.css()); Optional.ofNullable(m.graphic()).ifPresent(g -> { g.setScaleX(0.7); g.setScaleY(0.7); current.setGraphic(g); }); current.setOnAction((e) -> { eventStudio().broadcast(new ClearModuleEvent(), m.id()); eventStudio().broadcast(activeteModule(m.id())); hide(); PdfLoadRequestEvent loadEvent = new PdfLoadRequestEvent(m.id()); event.pdfs.stream().map(Path::toFile).map(PdfDocumentDescriptor::newDescriptorNoPassword) .forEach(loadEvent::add); eventStudio().broadcast(loadEvent, m.id()); }); buttons.getChildren().add(current); } }); return this; }
public DashboardTile(String title, String description, Node graphic) { getStyleClass().addAll("dashboard-modules-tile"); Label titleLabel = new Label(title); titleLabel.getStyleClass().add("dashboard-modules-tile-title"); if (nonNull(graphic)) { titleLabel.setGraphic(graphic); } Label textLabel = new Label(description); textLabel.getStyleClass().add("dashboard-modules-tile-text"); textLabel.setMinHeight(USE_PREF_SIZE); VBox topTile = new VBox(5); topTile.getChildren().addAll(titleLabel, textLabel); button.getStyleClass().add("dashboard-modules-invisible-button"); button.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); armed.bind(button.armedProperty()); getChildren().addAll(new StackPane(topTile, button)); setMaxHeight(USE_PREF_SIZE); setMinHeight(USE_PREF_SIZE); }
public NewsPanel() { getStyleClass().add("news-panel"); getStyleClass().addAll(Style.CONTAINER.css()); Button closeButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.TIMES); closeButton.getStyleClass().addAll("close-button"); closeButton.setOnAction(e -> eventStudio().broadcast(HideNewsPanelRequest.INSTANCE)); Label titleLabel = new Label(DefaultI18nContext.getInstance().i18n("What's new")); titleLabel.setPrefWidth(Integer.MAX_VALUE); titleLabel.getStyleClass().add("news-panel-title"); StackPane top = new StackPane(titleLabel, closeButton); top.setAlignment(Pos.TOP_RIGHT); scroll.getStyleClass().add("scrollable-news"); scroll.setHbarPolicy(ScrollBarPolicy.NEVER); scroll.setFitToHeight(true); scroll.setFitToWidth(true); getChildren().addAll(top, scroll); eventStudio().addAnnotatedListeners(this); }
private HBox buildFooter() { Button closeButton = new Button(DefaultI18nContext.getInstance().i18n("Close")); closeButton.getStyleClass().addAll(Style.BUTTON.css()); closeButton.setTextAlignment(TextAlignment.CENTER); closeButton.setOnAction(e -> eventStudio().broadcast(activeteCurrentModule())); HBox footer = new HBox(closeButton); footer.getStyleClass().addAll(Style.CLOSE_FOOTER.css()); return footer; }
public HidingPane() { Button closeButton = new Button(DefaultI18nContext.getInstance().i18n("Close")); closeButton.getStyleClass().addAll(Style.BUTTON.css()); closeButton.setTextAlignment(TextAlignment.CENTER); closeButton.setOnAction(e -> this.setVisible(false)); HBox bottom = new HBox(closeButton); bottom.setAlignment(Pos.CENTER_RIGHT); bottom.getStyleClass().addAll(Style.CONTAINER.css()); super.setBottom(bottom); } }
public BrowsableField() { HBox.setHgrow(textField, Priority.ALWAYS); this.getStyleClass().add("browsable-field"); validableContainer = new HBox(textField); validableContainer.getStyleClass().add("validable-container"); textField.getStyleClass().add("validable-container-field"); browseButton = new Button(DefaultI18nContext.getInstance().i18n("Browse")); browseButton.getStyleClass().addAll(Style.BROWSE_BUTTON.css()); browseButton.prefHeightProperty().bind(validableContainer.heightProperty()); browseButton.setMaxHeight(USE_PREF_SIZE); browseButton.setMinHeight(USE_PREF_SIZE); HBox.setHgrow(validableContainer, Priority.ALWAYS); textField.validProperty().addListener((o, oldValue, newValue) -> { if (newValue == ValidationState.INVALID) { validableContainer.getStyleClass().addAll(Style.INVALID.css()); } else { validableContainer.getStyleClass().removeAll(Style.INVALID.css()); } }); textField.focusedProperty().addListener( (o, oldVal, newVal) -> validableContainer.pseudoClassStateChanged(SELECTED_PSEUDOCLASS_STATE, newVal)); getChildren().addAll(validableContainer, browseButton); }
Notification(String title, Node content) { requireNotNull(content, "Notification content cannot be blank"); getStyleClass().add("notification"); getStyleClass().addAll(Style.CONTAINER.css()); setId(UUID.randomUUID().toString()); Button closeButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.TIMES); closeButton.getStyleClass().addAll("close-button"); closeButton.setOnAction(e -> eventStudio().broadcast(new RemoveNotificationRequestEvent(getId()))); Label titleLabel = new Label(title); titleLabel.setPrefWidth(Integer.MAX_VALUE); titleLabel.getStyleClass().add("notification-title"); StackPane top = new StackPane(titleLabel, closeButton); top.setAlignment(Pos.TOP_RIGHT); getChildren().addAll(top, content); setOpacity(0); setOnMouseEntered(e -> { fade.stop(); setOpacity(1); }); setOnMouseClicked(e -> { setOnMouseEntered(null); setOnMouseExited(null); fade.stop(); eventStudio().broadcast(new RemoveNotificationRequestEvent(getId())); }); fade.setFromValue(1); fade.setToValue(0); }
public PasswordFieldPopupContent() { getStyleClass().setAll("pdfsam-input-password-content"); passwordField.setPromptText(DefaultI18nContext.getInstance().i18n("Enter the user password")); Button doneButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.UNLOCK, DefaultI18nContext.getInstance().i18n("Unlock")); doneButton.getStyleClass().addAll(Style.BUTTON.css()); doneButton.prefHeightProperty().bind(passwordField.heightProperty()); doneButton.setMaxHeight(USE_PREF_SIZE); doneButton.setMinHeight(USE_PREF_SIZE); doneButton.setOnAction(e -> requestLoad()); passwordField.setOnAction(e -> requestLoad()); getChildren().addAll(passwordField, doneButton); }
Button copyButton = new Button(DefaultI18nContext.getInstance().i18n("Copy to clipboard")); FontAwesomeIconFactory.get().setIcon(copyButton, FontAwesomeIcon.COPY); copyButton.getStyleClass().addAll(Style.BUTTON.css()); copyButton.setId("copyEnvDetails"); copyButton.setOnAction(a -> {
/** * Creates a new {@link Button} object used to clear the search box * * @return The created clear button */ private Button createClearButton() { Button clearButton = new Button(); clearButton.getStyleClass().add("searchCleanButton"); AnchorPane.setRightAnchor(clearButton, 0.0); return clearButton; }
private Button createCrumb( final Callback<TreeItem<T>, Button> factory, final TreeItem<T> selectedCrumb) { Button crumb = factory.call(selectedCrumb); crumb.getStyleClass().add("crumb"); //$NON-NLS-1$ // We want all buttons to have the same height // so we bind their preferred height to the enclosing container // crumb.prefHeightProperty().bind(getSkinnable().heightProperty()); // listen to the action event of each bread crumb crumb.setOnAction(ae -> onBreadCrumbAction(selectedCrumb)); return crumb; }
private void setDropShadow() { boolean isPill = false; if (getSkinnable().getStyleClass().contains(ButtonType.LEFT_PILL.getStyleName()) || getSkinnable().getStyleClass().contains( ButtonType.CENTER_PILL.getStyleName()) || getSkinnable().getStyleClass().contains( ButtonType.RIGHT_PILL.getStyleName())) { isPill = true; } getSkinnable().setEffect(new Shadow(isPill)); }
public ErrorDialog buildPrimary(AbstractViewController controller) { final ErrorDialog dialog = (ErrorDialog) Services.getBean("ErrorDialog"); dialog.buildFrom(controller, getPrimaryDialogConfig()); dialog.dialogHeader.setTitle(title); dialog.dialogContent.setMessage(message); dialog.callBack = this.callBack; if(callBack == null) { dialog.hideFooter(); } dialog.okButton.getStyleClass().addAll("button-xl", "button-primary"); return dialog; }
public ErrorDialog buildAccent(AbstractViewController controller) { final ErrorDialog dialog = (ErrorDialog) Services.getBean("ErrorDialog"); dialog.buildFrom(controller, getAccentDialogConfig()); dialog.dialogHeader.setTitle(title); dialog.dialogContent.setMessage(message); dialog.callBack = this.callBack; if(callBack == null) { dialog.hideFooter(); } dialog.okButton.getStyleClass().addAll("button-xl", "button-accent"); return dialog; }
public WarningDialog buildPrimary(AbstractViewController controller) { final WarningDialog dialog = (WarningDialog) Services.getBean("WarningDialog"); dialog.buildFrom(controller, getPrimaryDialogConfig()); dialog.dialogHeader.setTitle(title); dialog.dialogContent.setMessage(message); dialog.callBack = this.callBack; if(callBack == null) { dialog.hideFooter(); } dialog.okButton.getStyleClass().addAll("button-xl", "button-primary"); return dialog; }
/** * Build done button */ private void buildDoneButton() { doneButton.getStyleClass().addAll("button-small", "table-toolbar-action", "ep-button"); doneButton.setOnAction(e -> modifyClicked(controller)); doneButton.setText(controller.getGLocalised("DONE_LABEL").toUpperCase()); IconUtils.setFontIcon("fa-check:16", doneButton); modifyingActionsWrapper.getChildren().addAll(NodeHelper.horizontalSpacer(), doneButton); }
public FailurePanel() { this.getStyleClass().add("rightPane"); this.setSpacing(10); this.failureNotification = new Label(); this.failureNotification.setTextAlignment(TextAlignment.CENTER); this.failureReason = new Label(); this.failureReason.setTextAlignment(TextAlignment.CENTER); this.retryButton = new Button(tr("Retry")); this.retryButton.getStyleClass().addAll("retryButton", "refreshIcon"); this.getChildren().addAll(this.failureNotification, this.failureReason, this.retryButton); }