public JFXDefaultChip(JFXChipView<T> view, T item) { super(view, item); JFXButton closeButton = new JFXButton(null, new SVGGlyph()); closeButton.getStyleClass().add("close-button"); closeButton.setOnAction((event) -> view.getChips().remove(item)); String tagString = null; if (getItem() instanceof String) { tagString = (String) getItem(); } else { tagString = view.getConverter().toString(getItem()); } Label label = new Label(tagString); label.setWrapText(true); root = new HBox(label, closeButton); getChildren().setAll(root); label.setMaxWidth(100); } }
box.setMaxWidth(Double.MAX_VALUE); bar.setMaxWidth(Double.MAX_VALUE); message.setMaxWidth(Double.MAX_VALUE); cancel.setMaxWidth(128); VBox.setVgrow(message, Priority.ALWAYS);
/** * {@inheritDoc} */ @Override public Node getDisplayNode(List<IListFormValue> values) { final Label valueLabel = new Label(); valueLabel.setWrapText(true); valueLabel.setMaxWidth(100); valueLabel.getStyleClass().add("ep-list-form-data-value"); if (values != null && !values.isEmpty()) { valueLabel.setText(values.get(0).getDisplayedValue()); } return valueLabel; }
/** * Dispaly current value */ protected void displayValue() { String currVal = getCurrentDisplayText(); Label currValLabel = new Label(); currentValuesPresenter.getChildren().clear(); currentValuesPresenter.getChildren().add(currValLabel); if (StringUtils.isNotBlank(currVal)) { String[] t = currVal.split(File.separator); String val = t[t.length - 1]; currValLabel.setText(val); currValLabel.setMaxWidth(100); currValLabel.setTooltip(new Tooltip(currVal)); } }
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); }
public JFXDefaultChip(JFXChipView<T> view, T item) { super(view, item); JFXButton closeButton = new JFXButton(null, new SVGGlyph()); closeButton.getStyleClass().add("close-button"); closeButton.setOnAction((event) -> view.getChips().remove(item)); String tagString = null; if (getItem() instanceof String) { tagString = (String) getItem(); } else { tagString = view.getConverter().toString(getItem()); } Label label = new Label(tagString); label.setWrapText(true); root = new HBox(label, closeButton); getChildren().setAll(root); label.setMaxWidth(100); } }
/** * @{inheritedDoc} */ @Override public void build(IInputComponentWrapper inputComponentWrapper) { super.build(inputComponentWrapper); NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value"); label.setText(((StringConverter) inputComponentWrapper.getConverter()).toDisplay(inputComponentWrapper.getCurrentInternalValue())); if(AbstractApplicationRunner.isDesktop()) { // TODO HANDLE TOOLTIP label.setMaxWidth(400); } inputComponentWrapper.currentInternalValueProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { label.setText(((StringConverter) inputComponentWrapper.getConverter()).toDisplay(newValue)); }); }
messageLabel.setMaxWidth(Double.MAX_VALUE); messageLabel.setPrefSize(420, 56); messageLabel.setWrapText(true);
@Override protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) { final double contentPrefHeight = content.prefHeight(contentWidth); // we calculate the pref width of the expand/collapse button. We will // ensure that the button does not get smaller than this. final double toggleButtonPrefWidth = expandCollapseButton.prefWidth(-1); expandCollapseButton.setMinWidth(toggleButtonPrefWidth); // All remaining width goes to the info label final Insets infoPanelPadding = infoPanel.getPadding(); final double infoLabelWidth = snapSize(contentWidth - toggleButtonPrefWidth - infoPanelPadding.getLeft() - infoPanelPadding.getRight()); // we then can work out the necessary height for the info panel, based on // whether it is expanded or not, and given the current state of the animation. final double prefInfoPanelHeight = (snapSize(infoLabel.prefHeight(infoLabelWidth)) + snapSpace(infoPanel.getPadding().getTop()) + snapSpace(infoPanel.getPadding().getBottom())) * transition.get(); infoLabel.setMaxWidth(infoLabelWidth); infoLabel.setMaxHeight(prefInfoPanelHeight); // position the imageView layoutInArea(content, contentX, contentY, contentWidth, contentHeight, -1, HPos.CENTER, VPos.TOP); // position the infoPanel (the HBox consisting of the Label and ToggleButton) layoutInArea(infoPanel, contentX, snapPosition(contentPrefHeight - prefInfoPanelHeight), contentWidth, prefInfoPanelHeight, 0, HPos.CENTER, VPos.BOTTOM); }