Example usage for javafx.scene Node equals

List of usage examples for javafx.scene Node equals

Introduction

In this page you can find the example usage for javafx.scene Node equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:cz.lbenda.dataman.rc.DatamanApp.java

private void focusNode(@Nonnull Node node) {
    detailTabs.getTabs().stream().filter(tab -> node.equals(tab.getContent()))
            .forEach(tab -> this.detailTabs.getSelectionModel().select(tab));
}

From source file:cz.lbenda.dataman.rc.DatamanApp.java

/** Add node to center pane */
private void addRemoveToDetail(@Nonnull String title, @Nonnull Node node, boolean closable) {
    boolean removed = false;
    for (Iterator<Tab> itt = detailTabs.getTabs().iterator(); itt.hasNext();) {
        Tab tab = itt.next();/*from   w ww.ja v a  2s .  c  o  m*/
        if (node.equals(tab.getContent())) {
            itt.remove();
            removed = true;
        }
    }
    if (!removed) {
        Tab tab = new Tab(title, node);
        tab.setClosable(closable);
        this.detailTabs.getTabs().add(tab);
        this.detailTabs.getSelectionModel().select(tab);
    }
}