Search in sources :

Example 21 with Tooltip

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());
    }
}
Also used : Control(javafx.scene.control.Control) Node(javafx.scene.Node) Tooltip(javafx.scene.control.Tooltip)

Example 22 with Tooltip

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();
        }
    };
}
Also used : ListCell(javafx.scene.control.ListCell) Tooltip(javafx.scene.control.Tooltip)

Example 23 with Tooltip

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;
}
Also used : Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) NotNull(org.jetbrains.annotations.NotNull)

Example 24 with Tooltip

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;
}
Also used : Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) NotNull(org.jetbrains.annotations.NotNull)

Example 25 with Tooltip

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;
}
Also used : Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Tooltip (javafx.scene.control.Tooltip)38 Button (javafx.scene.control.Button)12 Label (javafx.scene.control.Label)9 IOException (java.io.IOException)5 Node (javafx.scene.Node)5 Account (jgnash.engine.Account)4 DockTab (com.kyj.fx.voeditor.visual.component.dock.tab.DockTab)3 GargoyleException (com.kyj.fx.voeditor.visual.exceptions.GargoyleException)3 MaterialIconView (de.jensd.fx.glyphs.materialicons.MaterialIconView)3 Contract (io.bitsquare.trade.Contract)3 BigDecimal (java.math.BigDecimal)3 SimpleDateFormat (java.text.SimpleDateFormat)3 KeyFrame (javafx.animation.KeyFrame)3 Timeline (javafx.animation.Timeline)3 Platform (javafx.application.Platform)3 Insets (javafx.geometry.Insets)3 Scene (javafx.scene.Scene)3 PieChart (javafx.scene.chart.PieChart)3 TextField (javafx.scene.control.TextField)3 NotNull (org.jetbrains.annotations.NotNull)3