Example usage for javafx.scene Parent lookup

List of usage examples for javafx.scene Parent lookup

Introduction

In this page you can find the example usage for javafx.scene Parent lookup.

Prototype

@Override
    public Node lookup(String selector) 

Source Link

Usage

From source file:ambroafb.general.AnnotiationUtils.java

private static void changeNodeTitleLabelVisual(Node node, String explain) {
    Parent parent = node.getParent();
    Label nodeTitleLabel = (Label) parent.lookup(".validationMessage");

    if (explain.isEmpty()) {
        if (default_colors_map.containsKey(nodeTitleLabel)) {// This order of 'if' statements is correct!
            nodeTitleLabel.setTextFill(default_colors_map.get(nodeTitleLabel));
            default_colors_map.remove(nodeTitleLabel);
            Tooltip.uninstall(nodeTitleLabel, toolTip);
        }//from w  ww .  j  av a 2s . c  o  m
    } else {
        node.requestFocus();
        toolTip.setText(GeneralConfig.getInstance().getTitleFor(explain));
        toolTip.setStyle("-fx-background-color: gray; -fx-font-size: 8pt;");
        Tooltip.install(nodeTitleLabel, toolTip);
        default_colors_map.putIfAbsent(nodeTitleLabel, nodeTitleLabel.getTextFill());
        nodeTitleLabel.setTextFill(Color.RED);
    }
}