use of javafx.scene.control.TreeItem in project jgnash by ccavanaugh.
the class BudgetTableController method loadChildren.
private synchronized void loadChildren(final TreeItem<Account> parentItem) {
final Account parent = parentItem.getValue();
parent.getChildren(Comparators.getAccountByCode()).stream().filter(budgetResultsModel::includeAccount).forEach(child -> {
final TreeItem<Account> childItem = new TreeItem<>(child);
childItem.setExpanded(true);
parentItem.getChildren().add(childItem);
if (child.getChildCount() > 0) {
loadChildren(childItem);
}
});
}
use of javafx.scene.control.TreeItem in project jgnash by ccavanaugh.
the class AbstractAccountTreeController method loadAccountTree.
private void loadAccountTree() {
final Engine engine = EngineFactory.getEngine(EngineFactory.DEFAULT);
if (engine != null) {
final TreeItem<Account> root = new TreeItem<>(engine.getRootAccount());
root.setExpanded(true);
getTreeView().setRoot(root);
loadChildren(root);
} else {
getTreeView().setRoot(null);
}
}
use of javafx.scene.control.TreeItem in project jgnash by ccavanaugh.
the class AbstractAccountTreeController method loadChildren.
private synchronized void loadChildren(final TreeItem<Account> parentItem) {
final Account parent = parentItem.getValue();
parent.getChildren(Comparators.getAccountByCode()).stream().filter(child -> !filteredAccounts.contains(child) && isAccountVisible(child)).forEach(child -> {
final TreeItem<Account> childItem = new TreeItem<>(child);
childItem.setExpanded(true);
parentItem.getChildren().add(childItem);
if (child.getChildCount() > 0) {
loadChildren(childItem);
}
});
}
use of javafx.scene.control.TreeItem in project pmd by pmd.
the class NodeInfoPanelController method initialize.
@Override
public void initialize(URL location, ResourceBundle resources) {
EventStreams.valuesOf(scopeHierarchyTreeView.getSelectionModel().selectedItemProperty()).filter(Objects::nonNull).map(TreeItem::getValue).filterMap(o -> o instanceof NameDeclaration, o -> (NameDeclaration) o).subscribe(parent::onNameDeclarationSelected);
scopeHierarchyTreeView.setCellFactory(view -> new ScopeHierarchyTreeCell(parent));
}
use of javafx.scene.control.TreeItem in project pmd by pmd.
the class SourceEditorController method focusNodeInTreeView.
public void focusNodeInTreeView(Node node) {
ASTTreeItem found = ((ASTTreeItem) astTreeView.getRoot()).findItem(node);
if (found != null) {
SelectionModel<TreeItem<Node>> selectionModel = astTreeView.getSelectionModel();
selectionModel.select(found);
astTreeView.getFocusModel().focus(selectionModel.getSelectedIndex());
// astTreeView.scrollTo(selectionModel.getSelectedIndex());
}
}
Aggregations