@Override public void populate(Pane parent) { final ObservableList<Node> children = parent.getChildren(); children.clear(); leftSide.stream() .map(ToolbarItem::createNode) .forEachOrdered(children::add); final Pane separator = new Pane(); separator.setPrefHeight(1); HBox.setHgrow(separator, Priority.ALWAYS); children.add(separator); final ListIterator<ToolbarItem<?>> it = rightSide.listIterator(rightSide.size()); while (it.hasPrevious()) { children.add(it.previous().createNode()); } } }
private void updateContent() { paddingPane.setPrefSize(0, 0); paddingPane.setMinSize(0, 0); Node contentNode = content; switch (getDirection()) { case TOP: contentNode = new VBox(paddingPane, content); VBox.setVgrow(content, Priority.ALWAYS); break; case BOTTOM: contentNode = new VBox(content, paddingPane); VBox.setVgrow(content, Priority.ALWAYS); break; case LEFT: contentNode = new HBox(paddingPane, content); HBox.setHgrow(content, Priority.ALWAYS); break; case RIGHT: contentNode = new HBox(content, paddingPane); HBox.setHgrow(content, Priority.ALWAYS); break; } contentNode.setPickOnBounds(false); if (isOpened()) { paddingSizeProperty.set(computePaddingSize()); } contentHolder.getChildren().setAll(contentNode); }
@Override protected Node createUndecoratedEditor() { //TODO: CustomValue should be bound to defaultValue until we disable auto for the first time final HBox container = new HBox(); final TextInputControl textInput = getInputControl(); final CheckBox auto = new CheckBox("Auto"); final boolean useDefaultValue = value.isEmpty().get() || value.get().equals(defaultValue.get()); textInput.disableProperty().bind(auto.selectedProperty()); if (useDefaultValue) { textInput.textProperty().bind(defaultValue); } else { textInput.setText(value.get()); } customValue.bind(textInput.textProperty()); attachListener(textInput.textProperty(), (ov, o, n) -> { if (n == null || n.isEmpty() || n.equalsIgnoreCase(defaultValue.getValue())) { value.setValue(null); } else { value.setValue(n); } }); auto.selectedProperty().setValue(useDefaultValue); attachListener(auto.selectedProperty(), (ov, o, isAuto) -> setTextFieldBehaviour(textInput, isAuto, defaultValue, customValue) ); HBox.setHgrow(textInput, Priority.ALWAYS); HBox.setHgrow(auto, Priority.NEVER); container.getChildren().addAll(auto, textInput); return container; }
graphicTextContainer.setAlignment(Pos.CENTER_LEFT); graphicTextContainer.setPickOnBounds(false); HBox.setHgrow(graphicTextContainer, Priority.ALWAYS); HBox.setMargin(graphicContainer, new Insets(0, 8 , 0, 8));
errorContainer.getChildren().add(errorIcon); HBox.setHgrow(errorLabelContainer, Priority.ALWAYS); errorLabelContainer.setMaxWidth(Double.MAX_VALUE);
labelContainer.setAlignment(Pos.TOP_LEFT); getChildren().setAll(labelContainer, errorIcon); HBox.setHgrow(labelContainer, Priority.ALWAYS);
@Inject public BannerPane(BannerButtons buttons, ImageView payoff, @Named("logo32") Image logo) { getStyleClass().add("pdfsam-banner"); current.getStyleClass().add("header-title"); HBox.setHgrow(buttons, Priority.ALWAYS); HBox logoView = new HBox(); logoView.getStyleClass().add("pdfsam-logo"); logoView.getChildren().addAll(new ImageView(logo), payoff); getChildren().addAll(logoView, current, buttons); eventStudio().addAnnotatedListeners(this); }
@Inject public PreferencePane(PreferenceAppearencePane appearence, PreferenceBehaviorPane behavior, PreferenceWorkspacePane workspace, PreferenceOutputPane output) { getStyleClass().add("dashboard-container"); VBox left = new VBox(Style.DEFAULT_SPACING); left.setMinWidth(USE_PREF_SIZE); addSectionTitle(DefaultI18nContext.getInstance().i18n("Appearance"), left); left.getChildren().add(appearence); addSectionTitle(DefaultI18nContext.getInstance().i18n("Behavior"), left); left.getChildren().add(behavior); VBox right = new VBox(Style.DEFAULT_SPACING); HBox.setHgrow(right, Priority.ALWAYS); addSectionTitle(DefaultI18nContext.getInstance().i18n("Workspace"), right); right.getChildren().add(workspace); addSectionTitle(DefaultI18nContext.getInstance().i18n("Output"), right); right.getChildren().add(output); getChildren().addAll(left, right); }
HBox workigDirPane = new HBox(workingDirectory, helpIcon(i18n.i18n("Select a directory where documents will be saved and loaded by default"))); HBox.setHgrow(workingDirectory, Priority.ALWAYS); workigDirPane.getStyleClass().add("with-help-hcontainer"); HBox workspaceDirPane = new HBox(workspace, helpIcon( i18n.i18n("Select a previously saved workspace that will be automatically loaded at startup"))); HBox.setHgrow(workspace, Priority.ALWAYS); workspaceDirPane.getStyleClass().add("with-help-hcontainer"); workspace.getTextField().validProperty().addListener((o, oldVal, newVal) -> {
public Footer(RunButton runButton, OpenButton openButton, String ownerModule) { this.ownerModule = defaultString(ownerModule); this.openButton = openButton; this.runButton = runButton; this.getStyleClass().addAll("pdfsam-container", "footer-pane"); this.statusLabel.getStyleClass().add("status-label"); this.statusLabel.setVisible(false); this.bar.setMaxWidth(Double.MAX_VALUE); this.bar.getStyleClass().add("pdfsam-footer-bar"); this.statusLabel.setMaxHeight(Double.MAX_VALUE); VBox progressPane = new VBox(statusLabel, bar); progressPane.getStyleClass().add("progress-pane"); VBox.setVgrow(statusLabel, Priority.ALWAYS); HBox.setHgrow(bar, Priority.ALWAYS); HBox.setHgrow(progressPane, Priority.ALWAYS); this.failed.setVisible(false); StackPane buttons = new StackPane(failed, openButton); buttons.setAlignment(Pos.CENTER_LEFT); this.getChildren().addAll(runButton, buttons, progressPane); eventStudio().add(TaskExecutionRequestEvent.class, e -> { if (e.getModuleId().equals(ownerModule)) { failed.setVisible(false); openButton.setVisible(false); statusLabel.setVisible(true); statusLabel.setText(DefaultI18nContext.getInstance().i18n("Requested")); bar.setProgress(0); } }); eventStudio().addAnnotatedListeners(this); }
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); }
public SingleSelectionPane(String ownerModule) { this.getStyleClass().add("single-selection-pane"); this.ownerModule = defaultString(ownerModule); this.details.getStyleClass().add("-pdfsam-selection-details"); field.enforceValidation(true, false); passwordPopup = new PasswordFieldPopup(this.ownerModule); encryptionIndicator.getStyleClass().addAll("encryption-status"); encryptionIndicator.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> { if (descriptor.loadingStatus().getValue() == ENCRYPTED) { showPasswordFieldPopup(); } else if (descriptor.loadingStatus().getValue() == WITH_ERRORS) { eventStudio().broadcast(ShowStageRequest.INSTANCE, "LogStage"); } }); HBox.setMargin(encryptionIndicator, new Insets(0, 0, 0, 2)); field.setGraphic(encryptionIndicator); field.getStyleClass().add("single-selection-top"); HBox.setHgrow(field, Priority.ALWAYS); getChildren().addAll(field, details); field.getTextField().validProperty().addListener(onValidState); initContextMenu(); eventStudio().addAnnotatedListeners(this); }
MaterialDesignIconFactory.get().createIcon(MaterialDesignIcon.CLOCK)); labelDate.setPrefWidth(Integer.MAX_VALUE); HBox.setHgrow(labelDate, Priority.ALWAYS); HBox bottom = new HBox(labelDate); bottom.setAlignment(Pos.CENTER_LEFT);
private void addShareNotification(long usages) { Region spacer = new Region(); HBox.setHgrow(spacer, Priority.ALWAYS); VBox content = new VBox(3, buildLabel(DefaultI18nContext.getInstance().i18n("You performed {0} tasks with PDFsam, did it help?", Long.toString(usages)), NotificationType.SHARE), new HBox(3, spacer, styledUrlButton(null, pdfsam.property(ConfigurableProperty.FACEBOOK_SHARE_URL), FontAwesomeIcon.FACEBOOK), styledUrlButton(DefaultI18nContext.getInstance().i18n("Spread the word!"), pdfsam.property(ConfigurableProperty.TWEETER_SHARE_URL), FontAwesomeIcon.TWITTER))); content.setAlignment(Pos.TOP_RIGHT); container.addStickyNotification(DefaultI18nContext.getInstance().i18n("PDFsam worked hard!"), content); }
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 void updateMenuBar(ObservableValue<? extends Node> o, Node oldMenuBar, Node newMenuBar) { if (oldMenuBar != null) { ((Pane) lookup("#menu-bar-area")).getChildren().remove(oldMenuBar); //$NON-NLS-1$ oldMenuBar.getStyleClass().remove("window-menubar"); //$NON-NLS-1$ } if (newMenuBar != null) { ((Pane) lookup("#menu-bar-area")).getChildren().add(0, newMenuBar); //$NON-NLS-1$ newMenuBar.getStyleClass().add("window-menubar"); //$NON-NLS-1$ HBox.setHgrow(newMenuBar, Priority.ALWAYS); } }
private void configureHgrow(Node node) { HBox.setHgrow(node, getInputGrow()); if( node instanceof Field ){ ((Field)node).configureHGrow( getInputGrow() ); } else if ( node instanceof Pane){ ((Pane)node).getChildren().forEach( child -> configureHgrow( child )); } }
public LineInfo() { this.markerLabel = new Label(); this.markerLabel.setPrefWidth(20); this.lineText = new Label(); this.lineText.getStyleClass().add("line-ruler-text"); //$NON-NLS-1$ this.lineText.setMaxWidth(Double.MAX_VALUE); this.lineText.setMaxHeight(Double.MAX_VALUE); this.lineText.setAlignment(Pos.CENTER_RIGHT); HBox.setHgrow(this.lineText, Priority.ALWAYS); getChildren().addAll(this.markerLabel, this.lineText); }
/** * Populates the repository details step for the classpath repository */ private void populate() { this.classpathField = new TextField(); Label classpathLabel = new Label(tr("Classpath:")); classpathLabel.setLabelFor(classpathField); HBox content = new HBox(classpathLabel, classpathField); content.setId("addClasspathRepository"); HBox.setHgrow(classpathField, Priority.ALWAYS); this.setCenter(content); }