下面列出了javafx.scene.control.Tooltip#install ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
protected void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
var image = Image.class.cast(item);
imageView.setImage(image);
if (image != null) {
var popupImageView = new ImageView(image);
popupImageView.setFitHeight(TOOLTIP_SIZE);
popupImageView.setFitWidth(TOOLTIP_SIZE);
popupImageView.setPreserveRatio(true);
Tooltip tooltip = new Tooltip("");
tooltip.getStyleClass().add("imageTooltip");
tooltip.setShowDelay(Duration.millis(250));
tooltip.setGraphic(popupImageView);
Tooltip.install(this, tooltip);
}
}
public ClickableBitcoinAddress() {
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("bitcoin_address.fxml"));
loader.setRoot(this);
loader.setController(this);
// The following line is supposed to help Scene Builder, although it doesn't seem to be needed for me.
loader.setClassLoader(getClass().getClassLoader());
loader.load();
AwesomeDude.setIcon(copyWidget, AwesomeIcon.COPY);
Tooltip.install(copyWidget, new Tooltip("Copy address to clipboard"));
AwesomeDude.setIcon(qrCode, AwesomeIcon.QRCODE);
Tooltip.install(qrCode, new Tooltip("Show a barcode scannable with a mobile phone for this address"));
addressStr = convert(address);
addressLabel.textProperty().bind(addressStr);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private void fillBox(Color color) {
GraphicsContext gc = box.getGraphicsContext2D();
gc.save();
gc.clearRect(0, 0, box.getWidth(), box.getHeight());
gc.setFill(color);
gc.fillRect(0, 0, box.getWidth(), box.getHeight());
gc.restore();
//generate hex string and bind it to tooltip
final double f = 255.0;
int r = (int) (color.getRed() * f);
int g = (int) (color.getGreen() * f);
int b = (int) (color.getBlue() * f);
String opacity = DecimalFormat.getNumberInstance().format(color.getOpacity() * 100);
Tooltip.install(box, new Tooltip(String.format(
"red:%d, green:%d, blue:%d, opacity:%s%%", r, g, b, opacity))
);
}
/**
* Sets the tooltip text, with the (x, y) location being used for the
* anchor. If the text is {@code null}, no tooltip will be displayed.
* This method is intended for calling by the {@link TooltipHandlerFX}
* class, you won't normally call it directly.
*
* @param text the text ({@code null} permitted).
* @param x the x-coordinate of the mouse pointer.
* @param y the y-coordinate of the mouse pointer.
*/
public void setTooltip(String text, double x, double y) {
if (text != null) {
if (this.tooltip == null) {
this.tooltip = new Tooltip(text);
Tooltip.install(this, this.tooltip);
} else {
this.tooltip.setText(text);
this.tooltip.setAnchorX(x);
this.tooltip.setAnchorY(y);
}
} else {
Tooltip.uninstall(this, this.tooltip);
this.tooltip = null;
}
}
private void updateAttr(@Nullable Attribute attr) {
if (tooltip != null) {
Tooltip.uninstall(this, tooltip);
getStyleClass().remove(DEPRECATED_CSS_CLASS);
tooltip = null;
}
if (attr == null) {
return;
}
String replacement = attr.replacementIfDeprecated();
if (replacement != null) {
String txt = "This attribute is deprecated";
if (!replacement.isEmpty()) {
txt += ", please use " + replacement + " instead";
}
Tooltip t = new Tooltip(txt);
tooltip = t;
getStyleClass().add(DEPRECATED_CSS_CLASS);
Tooltip.install(this, t);
}
}
public void addLocation(final Location LOCATION) {
double x = (LOCATION.getLongitude() + 180) * (PREFERRED_WIDTH / 360) + MAP_OFFSET_X;
double y = (PREFERRED_HEIGHT / 2) - (PREFERRED_WIDTH * (Math.log(Math.tan((Math.PI / 4) + (Math.toRadians(LOCATION.getLatitude()) / 2)))) / (2 * Math.PI)) + MAP_OFFSET_Y;
Circle locationIcon = new Circle(x, y, size * 0.01);
locationIcon.setFill(null == LOCATION.getColor() ? getLocationColor() : LOCATION.getColor());
StringBuilder tooltipBuilder = new StringBuilder();
if (!LOCATION.getName().isEmpty()) tooltipBuilder.append(LOCATION.getName());
if (!LOCATION.getInfo().isEmpty()) tooltipBuilder.append("\n").append(LOCATION.getInfo());
String tooltipText = tooltipBuilder.toString();
if (!tooltipText.isEmpty()) {
Tooltip tooltip = new Tooltip(tooltipText);
tooltip.setFont(Font.font(10));
Tooltip.install(locationIcon, tooltip);
}
if (null != LOCATION.getMouseEnterHandler()) locationIcon.setOnMouseEntered(new WeakEventHandler<>(LOCATION.getMouseEnterHandler()));
if (null != LOCATION.getMousePressHandler()) locationIcon.setOnMousePressed(new WeakEventHandler<>(LOCATION.getMousePressHandler()));
if (null != LOCATION.getMouseReleaseHandler()) locationIcon.setOnMouseReleased(new WeakEventHandler<>(LOCATION.getMouseReleaseHandler()));
if (null != LOCATION.getMouseExitHandler()) locationIcon.setOnMouseExited(new WeakEventHandler<>(LOCATION.getMouseExitHandler()));
locations.put(LOCATION, locationIcon);
}
/**
* Sets the tooltip text, with the (x, y) location being used for the
* anchor. If the text is {@code null}, no tooltip will be displayed.
* This method is intended for calling by the {@link TooltipHandlerFX}
* class, you won't normally call it directly.
*
* @param text the text ({@code null} permitted).
* @param x the x-coordinate of the mouse pointer.
* @param y the y-coordinate of the mouse pointer.
*/
public void setTooltip(String text, double x, double y) {
if (text != null) {
if (this.tooltip == null) {
this.tooltip = new Tooltip(text);
Tooltip.install(this, this.tooltip);
} else {
this.tooltip.setText(text);
this.tooltip.setAnchorX(x);
this.tooltip.setAnchorY(y);
}
} else {
Tooltip.uninstall(this, this.tooltip);
this.tooltip = null;
}
}
/**
* Sets the tooltip text, with the (x, y) location being used for the
* anchor. If the text is {@code null}, no tooltip will be displayed.
* This method is intended for calling by the {@link TooltipHandlerFX}
* class, you won't normally call it directly.
*
* @param text the text ({@code null} permitted).
* @param x the x-coordinate of the mouse pointer.
* @param y the y-coordinate of the mouse pointer.
*/
public void setTooltip(String text, double x, double y) {
if (text != null) {
if (this.tooltip == null) {
this.tooltip = new Tooltip(text);
Tooltip.install(this, this.tooltip);
} else {
this.tooltip.setText(text);
this.tooltip.setAnchorX(x);
this.tooltip.setAnchorY(y);
}
} else {
Tooltip.uninstall(this, this.tooltip);
this.tooltip = null;
}
}
/**
* Augments components of PanelMenuBar when the renaming of the panel happens.
* The confirm button and the undo button are added to the panel.
*/
private void augmentRenameableTextField() {
menuBarNameArea.getChildren().remove(nameBox);
this.getChildren().removeAll(menuBarRenameButton, menuBarCloseButton);
menuBarNameArea.getChildren().addAll(renameableTextField);
Tooltip.install(menuBarConfirmButton, new Tooltip("Confirm this name change"));
Tooltip undoTip = new Tooltip("Abandon this name change and go back to the previous name");
undoTip.setPrefWidth(TOOLTIP_WRAP_WIDTH);
Tooltip.install(menuBarUndoButton, undoTip);
this.getChildren().addAll(menuBarConfirmButton, menuBarUndoButton);
}
public CountryPath(final String NAME, final String CONTENT) {
super();
name = NAME;
locale = new Locale("", NAME);
tooltip = new Tooltip(locale.getDisplayCountry());
Tooltip.install(CountryPath.this, tooltip);
if (null == CONTENT) return;
setContent(CONTENT);
}
private Candle(String seriesStyleClass, String dataStyleClass) {
setAutoSizeChildren(false);
getChildren().addAll(highLowLine, bar);
this.seriesStyleClass = seriesStyleClass;
this.dataStyleClass = dataStyleClass;
updateStyleClasses();
tooltip.setGraphic(new TooltipContent());
Tooltip.install(bar, tooltip);
}
private void updateHeroPower(Hero hero) {
Image heroPowerImage = new Image(IconFactory.getHeroPowerIconUrl(hero.getHeroPower()));
heroPowerIcon.setImage(heroPowerImage);
Card card = CardCatalogue.getCardById(hero.getHeroPower().getCardId());
Tooltip tooltip = new Tooltip();
CardTooltip tooltipContent = new CardTooltip();
tooltipContent.setCard(card);
tooltip.setGraphic(tooltipContent);
Tooltip.install(heroPowerIcon, tooltip);
}
private HBox createCloseButton() {
HBox closeArea = new HBox();
closeButton = new Label(OCTICON_CLOSE_PANEL);
closeButton.setId(IdGenerator.getPanelCloseButtonId(panel.panelIndex));
closeButton.getStyleClass().addAll("octicon", "label-button");
closeButton.setOnMouseClicked((e) -> {
e.consume();
panel.parentPanelControl.closePanel(panel.panelIndex);
});
Tooltip.install(closeArea, new Tooltip("Close this panel"));
closeArea.getChildren().add(closeButton);
return closeArea;
}
public CheckItemBuilt tip(String tipText) {
Tooltip tooltip = new Tooltip(tipText);
Tooltip.install(menuItem.getGraphic(), tooltip);
return this;
}
@Override
public void initialize() {
paymentLabelString = Res.get("funds.deposit.fundBisqWallet");
addressColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.address")));
balanceColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.balanceWithCur", Res.getBaseCurrencyCode())));
confirmationsColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.confirmations")));
usageColumn.setGraphic(new AutoTooltipLabel(Res.get("shared.usage")));
// trigger creation of at least 1 savings address
walletService.getFreshAddressEntry();
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tableView.setPlaceholder(new AutoTooltipLabel(Res.get("funds.deposit.noAddresses")));
tableViewSelectionListener = (observableValue, oldValue, newValue) -> {
if (newValue != null) {
fillForm(newValue.getAddressString());
GUIUtil.requestFocus(amountTextField);
}
};
setAddressColumnCellFactory();
setBalanceColumnCellFactory();
setUsageColumnCellFactory();
setConfidenceColumnCellFactory();
addressColumn.setComparator(Comparator.comparing(DepositListItem::getAddressString));
balanceColumn.setComparator(Comparator.comparing(DepositListItem::getBalanceAsCoin));
confirmationsColumn.setComparator(Comparator.comparingDouble(o -> o.getTxConfidenceIndicator().getProgress()));
usageColumn.setComparator(Comparator.comparingInt(DepositListItem::getNumTxOutputs));
tableView.getSortOrder().add(usageColumn);
tableView.setItems(sortedList);
titledGroupBg = addTitledGroupBg(gridPane, gridRow, 4, Res.get("funds.deposit.fundWallet"));
titledGroupBg.getStyleClass().add("last");
qrCodeImageView = new ImageView();
qrCodeImageView.getStyleClass().add("qr-code");
Tooltip.install(qrCodeImageView, new Tooltip(Res.get("shared.openLargeQRWindow")));
qrCodeImageView.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(
() -> UserThread.runAfter(
() -> new QRCodeWindow(getBitcoinURI()).show(),
200, TimeUnit.MILLISECONDS)));
GridPane.setRowIndex(qrCodeImageView, gridRow);
GridPane.setRowSpan(qrCodeImageView, 4);
GridPane.setColumnIndex(qrCodeImageView, 1);
GridPane.setMargin(qrCodeImageView, new Insets(Layout.FIRST_ROW_DISTANCE, 0, 0, 10));
gridPane.getChildren().add(qrCodeImageView);
addressTextField = addAddressTextField(gridPane, ++gridRow, Res.get("shared.address"), Layout.FIRST_ROW_DISTANCE);
addressTextField.setPaymentLabel(paymentLabelString);
amountTextField = addInputTextField(gridPane, ++gridRow, Res.get("funds.deposit.amount"));
amountTextField.setMaxWidth(380);
if (DevEnv.isDevMode())
amountTextField.setText("10");
titledGroupBg.setVisible(false);
titledGroupBg.setManaged(false);
qrCodeImageView.setVisible(false);
qrCodeImageView.setManaged(false);
addressTextField.setVisible(false);
addressTextField.setManaged(false);
amountTextField.setManaged(false);
generateNewAddressButton = addButton(gridPane, ++gridRow, Res.get("funds.deposit.generateAddress"), -20);
GridPane.setColumnIndex(generateNewAddressButton, 0);
GridPane.setHalignment(generateNewAddressButton, HPos.LEFT);
generateNewAddressButton.setOnAction(event -> {
boolean hasUnUsedAddress = observableList.stream().anyMatch(e -> e.getNumTxOutputs() == 0);
if (hasUnUsedAddress) {
new Popup().warning(Res.get("funds.deposit.selectUnused")).show();
} else {
AddressEntry newSavingsAddressEntry = walletService.getFreshAddressEntry();
updateList();
observableList.stream()
.filter(depositListItem -> depositListItem.getAddressString().equals(newSavingsAddressEntry.getAddressString()))
.findAny()
.ifPresent(depositListItem -> tableView.getSelectionModel().select(depositListItem));
}
});
balanceListener = new BalanceListener() {
@Override
public void onBalanceChanged(Coin balance, Transaction tx) {
updateList();
}
};
GUIUtil.focusWhenAddedToScene(amountTextField);
}
@Override
public FXFormNode call(Void param) {
String promptText = "Enter local path or URL";
textField.setPromptText(promptText);
tooltip.setText(promptText);
textField.setDisable(false);
selectButton.setText("Change");
editButton.setText("Edit");
browseButton.setText("Browse");
textField.setOnMouseEntered(event -> {
Optional.of(textField).filter(e -> !e.isFocused())
.map(TextField::getText)
.ifPresent(text -> textField.positionCaret(text.length()));
});
textField.setOnMouseExited(event -> {
if (!textField.isFocused())
textField.positionCaret(0);
});
textField.textProperty().bindBidirectional(property);
property.addListener((observable, oldValue, newValue) -> {
if (Objects.nonNull(newValue)) {
tooltip.setText(newValue);
if (newValue.isEmpty()) {
property.set(null);
}
}
});
browseButton.visibleProperty().bind(property.isNotNull());
browseButton.managedProperty().bind(property.isNotNull());
editButton.visibleProperty().bind(property.isNotNull());
editButton.managedProperty().bind(property.isNotNull());
selectButton.setOnAction(event -> {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle(promptText);
File openDialog = fileChooser.showOpenDialog(null);
if (Objects.nonNull(openDialog)) {
property.setValue(openDialog.toPath().toString());
}
});
HBox hBox = new HBox(5);
hBox.getChildren().addAll(textField, selectButton, editButton, browseButton);
HBox.setHgrow(textField, Priority.ALWAYS);
Tooltip.install(textField, tooltip);
return new FXFormNodeWrapper(hBox, property);
}
private void initGraphics() {
// Set initial size
if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
} else {
gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();
ledCanvas = new Canvas();
led = ledCanvas.getGraphicsContext2D();
thresholdTooltip = new Tooltip("Threshold\n(" + String.format(locale, formatString, gauge.getThreshold()) + ")");
thresholdTooltip.setTextAlignment(TextAlignment.CENTER);
threshold = new Path();
Helper.enableNode(threshold, gauge.isThresholdVisible());
Tooltip.install(threshold, thresholdTooltip);
average = new Path();
Helper.enableNode(average, gauge.isAverageVisible());
markerPane = new Pane();
needleRotate = new Rotate(180 - START_ANGLE);
needleRotate.setAngle(needleRotate.getAngle() + (gauge.getValue() - oldValue - gauge.getMinValue()) * angleStep);
needleMoveTo1 = new MoveTo();
needleCubicCurveTo2 = new CubicCurveTo();
needleCubicCurveTo3 = new CubicCurveTo();
needleCubicCurveTo4 = new CubicCurveTo();
needleLineTo5 = new LineTo();
needleCubicCurveTo6 = new CubicCurveTo();
needleClosePath7 = new ClosePath();
needle = new Path(needleMoveTo1, needleCubicCurveTo2, needleCubicCurveTo3, needleCubicCurveTo4, needleLineTo5, needleCubicCurveTo6, needleClosePath7);
needle.setFillRule(FillRule.EVEN_ODD);
needle.getTransforms().setAll(needleRotate);
dropShadow = new DropShadow();
dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);
shadowGroup = new Group(needle);
shadowGroup.setEffect(gauge.isShadowsEnabled() ? dropShadow : null);
titleText = new Text(gauge.getTitle());
titleText.setTextOrigin(VPos.CENTER);
titleText.setFill(gauge.getTitleColor());
Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
unitText = new Text(gauge.getUnit());
unitText.setMouseTransparent(true);
unitText.setTextOrigin(VPos.CENTER);
lcd = new Rectangle(0.3 * PREFERRED_WIDTH, 0.1 * PREFERRED_HEIGHT);
lcd.setArcWidth(0.0125 * PREFERRED_HEIGHT);
lcd.setArcHeight(0.0125 * PREFERRED_HEIGHT);
lcd.relocate((PREFERRED_WIDTH - lcd.getWidth()) * 0.5, 0.44 * PREFERRED_HEIGHT);
Helper.enableNode(lcd, gauge.isLcdVisible() && gauge.isValueVisible());
lcdText = new Label(String.format(locale, "%." + gauge.getDecimals() + "f", gauge.getValue()));
lcdText.setAlignment(Pos.CENTER_RIGHT);
lcdText.setVisible(gauge.isValueVisible());
// Set initial value
angleStep = ANGLE_RANGE / gauge.getRange();
double targetAngle = 180 - START_ANGLE + (gauge.getValue() - gauge.getMinValue()) * angleStep;
targetAngle = clamp(180 - START_ANGLE, 180 - START_ANGLE + ANGLE_RANGE, targetAngle);
needleRotate.setAngle(targetAngle);
lightEffect = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(255, 255, 255, 0.65), 2, 0.0, 0.0, 2.0);
foreground = new SVGPath();
foreground.setContent("M 26 26.5 C 26 20.2432 26.2432 20 32.5 20 L 277.5 20 C 283.7568 20 284 20.2432 284 26.5 L 284 143.5 C 284 149.7568 283.7568 150 277.5 150 L 32.5 150 C 26.2432 150 26 149.7568 26 143.5 L 26 26.5 ZM 0 6.7241 L 0 253.2758 C 0 260 0 260 6.75 260 L 303.25 260 C 310 260 310 260 310 253.2758 L 310 6.7241 C 310 0 310 0 303.25 0 L 6.75 0 C 0 0 0 0 0 6.7241 Z");
foreground.setEffect(lightEffect);
// Add all nodes
pane = new Pane();
pane.getChildren().setAll(ticksAndSectionsCanvas,
markerPane,
ledCanvas,
unitText,
lcd,
lcdText,
shadowGroup,
foreground,
titleText);
getChildren().setAll(pane);
}
public AddressTextField(String label) {
JFXTextField textField = new BisqTextField();
textField.setId("address-text-field");
textField.setEditable(false);
textField.setLabelFloat(true);
textField.setPromptText(label);
textField.textProperty().bind(address);
String tooltipText = Res.get("addressTextField.openWallet");
textField.setTooltip(new Tooltip(tooltipText));
textField.setOnMousePressed(event -> wasPrimaryButtonDown = event.isPrimaryButtonDown());
textField.setOnMouseReleased(event -> {
if (wasPrimaryButtonDown)
GUIUtil.showFeeInfoBeforeExecute(AddressTextField.this::openWallet);
wasPrimaryButtonDown = false;
});
textField.focusTraversableProperty().set(focusTraversableProperty().get());
//TODO app wide focus
//focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus());
Label extWalletIcon = new Label();
extWalletIcon.setLayoutY(3);
extWalletIcon.getStyleClass().addAll("icon", "highlight");
extWalletIcon.setTooltip(new Tooltip(tooltipText));
AwesomeDude.setIcon(extWalletIcon, AwesomeIcon.SIGNIN);
extWalletIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet));
Label copyIcon = new Label();
copyIcon.setLayoutY(3);
copyIcon.getStyleClass().addAll("icon", "highlight");
Tooltip.install(copyIcon, new Tooltip(Res.get("addressTextField.copyToClipboard")));
AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY);
copyIcon.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(() -> {
if (address.get() != null && address.get().length() > 0)
Utilities.copyToClipboard(address.get());
}));
AnchorPane.setRightAnchor(copyIcon, 30.0);
AnchorPane.setRightAnchor(extWalletIcon, 5.0);
AnchorPane.setRightAnchor(textField, 55.0);
AnchorPane.setLeftAnchor(textField, 0.0);
getChildren().addAll(textField, copyIcon, extWalletIcon);
}
@Override
public void initialize(final URL location, final ResourceBundle resources) {
final ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
final Model model = new Model();
final Validator validator = factory.getValidator();
nameErrorTooltip = new Tooltip();
Tooltip.install( nameErrorNode, nameErrorTooltip );
countErrorTooltip = new Tooltip();
Tooltip.install( countErrorNode, countErrorTooltip );
tagErrorTooltip = new Tooltip();
Tooltip.install( tagErrorNode, tagErrorTooltip );
nameField.textProperty().bindBidirectional(model.nameProperty());
model.countProperty().bind(Bindings.createObjectBinding(() ->
countSlider.valueProperty().intValue(),
countSlider.valueProperty()));
tagListView.itemsProperty().bind(model.tagsProperty());
tagListView.setCellFactory(e -> new ValidatorCell(validator));
addTagButton.setOnAction(e -> model.tagsProperty().add(tagNameField.getText()));
nameErrorNode.visibleProperty().bind(Bindings.createBooleanBinding(() ->
!validator.validateProperty(model, "name").isEmpty(),
model.nameProperty()));
nameErrorTooltip.textProperty().bind(
Bindings.createStringBinding(
() -> validator.validateProperty(model, "name")
.stream()
.map( cv -> cv.getMessage() )
.collect( Collectors.joining() ),
model.nameProperty()
)
);
countErrorNode.visibleProperty().bind(Bindings.createBooleanBinding(() ->
!validator.validateProperty(model, "count").isEmpty(),
model.countProperty()));
countErrorTooltip.textProperty().bind(
Bindings.createStringBinding(
() -> validator.validateProperty(model, "count")
.stream()
.map( cv -> cv.getMessage() )
.collect( Collectors.joining() ),
model.countProperty()
)
);
tagErrorNode.visibleProperty().bind(Bindings.createBooleanBinding(() ->
!validator.validateProperty(model, "tags").isEmpty(),
model.tagsProperty()));
tagErrorTooltip.textProperty().bind(
Bindings.createStringBinding(
() -> validator.validateProperty(model, "tags")
.stream()
.map( cv -> cv.getMessage() )
.collect( Collectors.joining() ),
model.tagsProperty()
)
);
}
public MenuItemBuilt tip(String tipText) {
Tooltip tooltip = new Tooltip(tipText);
Tooltip.install(menuItem.getGraphic(), tooltip);
return this;
}