fieldName.getTooltip().setText(item.getDbmsNameMeaning());
private static Tooltip createTooltip(FXDockableData dockableData, final String tooltipText) { Tooltip tooltip = dockableData.getTooltip(); if (tooltip == null) { tooltip = new Tooltip(tooltipText); tooltip.setTextOverrun(OverrunStyle.CENTER_WORD_ELLIPSIS); dockableData.setTooltip(tooltip); } else { tooltip.setText(tooltipText); } return tooltip; }
/** * this method will update the source control after evaluating the validation condition */ protected void onEval() { Node control = getSrcControl(); if (hasErrors.get()) { control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, true); if (control instanceof Control) { Tooltip controlTooltip = ((Control) control).getTooltip(); if (controlTooltip != null && !controlTooltip.getStyleClass().contains("error-tooltip")) { tooltip = ((Control) control).getTooltip(); } errorTooltip.setText(getMessage()); ((Control) control).setTooltip(errorTooltip); } } else { if (control instanceof Control) { Tooltip controlTooltip = ((Control) control).getTooltip(); if ((controlTooltip != null && controlTooltip.getStyleClass().contains("error-tooltip")) || (controlTooltip == null && tooltip != null)) { ((Control) control).setTooltip(tooltip); } tooltip = null; } control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, false); } }
public static void setTooltip(@Nonnull Control control, @Nullable String text) { runInsideUIThread(() -> { if (isBlank(text)) { return; } requireNonNull(control, ERROR_CONTROL_NULL); Tooltip tooltip = control.tooltipProperty().get(); if (tooltip == null) { tooltip = new Tooltip(); control.tooltipProperty().set(tooltip); } tooltip.setText(text); }); }
/** * set the toolTip * * @param toolTip */ public void setToolTip(String toolTip) { if (control.getTooltip() == null) control.setTooltip(new Tooltip()); control.getTooltip().setText(toolTip); }
private void setDeleteIcon(final GridPane grid, final Label label, final ImageView imgView, final boolean isYaml) { final Tooltip tooltip = new Tooltip(); tooltip.setText(RESOURCES.getString("delete")); Tooltip.install(imgView, tooltip); grid.getChildren().remove(imgView); grid.add(imgView, 0, 2); imgView.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() { @Override public void handle(final MouseEvent event) { label.setText(""); grid.getChildren().remove(imgView); if (isYaml) { setSwitchBatchSelected(false); } } }); }
tooltip.setText(validationErrorText.toString()); tooltip.setShowDelay(Duration.ZERO); tooltip.setAnchorLocation(PopupWindow.AnchorLocation.CONTENT_BOTTOM_LEFT);
public TooltippedTextFieldTableCell(String tooltipMessage) { requireNotBlank(tooltipMessage, "Tooltiped cell must have a tooltip message"); this.tooltip.setText(tooltipMessage);
tooltip.setText(field.getHint()); control.setTooltip(tooltip);
/** * Constructs a new map view with an initially empty list of countries which will * result in the entire world to be shown. */ public WorldMapView() { getStyleClass().add(DEFAULT_STYLE_CLASS); setCountryViewFactory(country -> { CountryView view = new CountryView(country); view.setOnMouseEntered(evt -> tooltip.setText(country.getLocale().getDisplayCountry())); Tooltip.install(view, tooltip); return view; }); setLocationViewFactory(location -> { Circle circle = new Circle(); circle.setRadius(4); circle.setTranslateX(-4); circle.setTranslateY(-4); circle.setOnMouseEntered(evt -> tooltip.setText(location.getName())); Tooltip.install(circle, tooltip); return circle; }); }
public static void configureDockableDataFromExistingDocument(FXDockableData dockableData, DataHandler<?> dataHandler) { // TODO: rename dockableData.setTitle(dataHandler.getTitle()); dataHandler.addPropertyChangeListener(DataHandler.TITLE_PROPERTY_NAME, evt -> dockableData.setTitle(dataHandler.getTitle())); String tooltipText = dataHandler.getTooltipText(); Tooltip tooltip = createTooltip(dockableData, tooltipText); dataHandler.addPropertyChangeListener(DataHandler.TOOLTIP_TEXT_PROPERTY_NAME, evt -> tooltip.setText(dataHandler.getTooltipText())); }
@Override public void updateItem(ScenarioExecutionUnit item, boolean empty) { super.updateItem(item, empty); if (empty) { return; } setText(item.scenario.getDisplayMeta() + " " + item.scenario.getName()); tooltip.setText(item.scenario.getName()); setTooltip(tooltip); if (item.result.isFailed()) { setStyle(STYLE_FAIL); } else if (!item.result.getStepResults().isEmpty()) { setStyle(STYLE_PASS); } else { setStyle(""); } }
/** * Sets the error message as tooltip for the matching control. * * @param below * The control needed for positioning the tooltip. * @param reference * The control which gets the tooltip. */ protected void toggleTooltip(Node reference, Control below) { String fieldTooltip = field.getTooltip(); if ((reference.isFocused() || reference.isHover()) && (!fieldTooltip.equals("") || field.getErrorMessages().size() > 0)) { tooltip.setText((!fieldTooltip.equals("") ? fieldTooltip + "\n" : "") + String.join("\n", field.getErrorMessages())); if (tooltip.isShowing()) { return; } Point2D p = below.localToScene(0.0, 0.0); tooltip.show( getScene().getWindow(), p.getX() + getScene().getX() + getScene().getWindow().getX(), p.getY() + getScene().getY() + getScene().getWindow().getY() + below.getHeight() + 5 ); } else { tooltip.hide(); } }
private static void updatePseudoState(Label statusIcon, Status status) { statusIcon.pseudoClassStateChanged(error, status.getState() == State.ERROR); statusIcon.pseudoClassStateChanged(warning, status.getState() == State.WARNING); statusIcon.pseudoClassStateChanged(ok, status.getState() == State.OK); statusIcon.pseudoClassStateChanged(cancel, status.getState() == State.CANCEL); statusIcon.autosize(); if( statusIcon.getTooltip() == null ) { if( status.getState() != State.OK ) { statusIcon.setTooltip(new Tooltip(status.getMessage())); } } else { statusIcon.getTooltip().setText(status.getMessage()); } }
/** * this method will update the source control after evaluating the validation condition */ protected void onEval() { Node control = getSrcControl(); if (hasErrors.get()) { control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, true); if (control instanceof Control) { Tooltip controlTooltip = ((Control) control).getTooltip(); if (controlTooltip != null && !controlTooltip.getStyleClass().contains("error-tooltip")) { tooltip = ((Control) control).getTooltip(); } errorTooltip.setText(getMessage()); ((Control) control).setTooltip(errorTooltip); } } else { if (control instanceof Control) { Tooltip controlTooltip = ((Control) control).getTooltip(); if ((controlTooltip != null && controlTooltip.getStyleClass().contains("error-tooltip")) || (controlTooltip == null && tooltip != null)) { ((Control) control).setTooltip(tooltip); } tooltip = null; } control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, false); } }