use of javafx.scene.control.Tooltip in project JFoenix by jfoenixadmin.
the class ValidatorBase method onEval.
/**
* this method will update the source control after evaluating the validation condition
*/
protected void onEval() {
Node control = getSrcControl();
if (hasErrors.get()) {
/*
* TODO
* NOTE: NEED TO FIX adding error style class to text area
* is causing the caret to disappear
*/
if (!control.getStyleClass().contains(errorStyleClass.get()))
control.getStyleClass().add(errorStyleClass.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();
}
Tooltip errorTooltip = new Tooltip();
errorTooltip.getStyleClass().add("error-tooltip");
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);
control.getStyleClass().remove(errorStyleClass.get());
}
}
use of javafx.scene.control.Tooltip in project jabref by JabRef.
the class ViewModelListCellFactory method call.
@Override
public ListCell<T> call(ListView<T> param) {
return new ListCell<T>() {
@Override
protected void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
T viewModel = getItem();
if (empty || viewModel == null) {
setText(null);
setGraphic(null);
setOnMouseClicked(null);
setTooltip(null);
} else {
if (toText != null) {
setText(toText.call(viewModel));
}
if (toGraphic != null) {
setGraphic(toGraphic.call(viewModel));
}
if (toOnMouseClickedEvent != null) {
setOnMouseClicked(toOnMouseClickedEvent.call(viewModel));
}
if (toStyleClass != null) {
getStyleClass().setAll(toStyleClass.call(viewModel));
}
if (toTooltip != null) {
String tooltipText = toTooltip.call(viewModel);
if (StringUtil.isNotBlank(tooltipText)) {
setTooltip(new Tooltip(tooltipText));
}
}
}
getListView().refresh();
}
};
}
use of javafx.scene.control.Tooltip in project intellij-plugins by StepicOrg.
the class AuthDialog method makeExitButton.
@NotNull
private Button makeExitButton() {
Button button = createButtonWithImage(AllIcons.Actions.Exit);
button.setTooltip(new Tooltip("Login to another account"));
button.setOnAction(event -> Platform.runLater(() -> {
initCookieManager(true);
engine.load(url);
}));
return button;
}
use of javafx.scene.control.Tooltip in project intellij-plugins by StepicOrg.
the class AuthDialog method makeHomeButton.
@NotNull
private Button makeHomeButton() {
Button button = createButtonWithImage(AllIcons.Actions.Refresh);
button.setTooltip(new Tooltip("To home"));
button.setOnAction(event -> Platform.runLater(() -> engine.load(url)));
return button;
}
use of javafx.scene.control.Tooltip in project intellij-plugins by StepicOrg.
the class AuthDialog method makeGoBackButton.
@NotNull
private Button makeGoBackButton() {
Button button = createButtonWithImage(AllIcons.Actions.Back);
button.setTooltip(new Tooltip("Back"));
button.setDisable(true);
button.setOnAction(event -> Platform.runLater(() -> engine.getHistory().go(-1)));
return button;
}
Aggregations