Search in sources :

Example 1 with ASTTreeItem

use of net.sourceforge.pmd.util.fxdesigner.util.controls.ASTTreeItem in project pmd by pmd.

the class SourceEditorController method setUpToDateCompilationUnit.

private void setUpToDateCompilationUnit(Node node) {
    astTitleLabel.setText("Abstract Syntax Tree");
    ASTTreeItem root = ASTTreeItem.getRoot(node);
    astTreeView.setRoot(root);
}
Also used : ASTTreeItem(net.sourceforge.pmd.util.fxdesigner.util.controls.ASTTreeItem)

Example 2 with ASTTreeItem

use of net.sourceforge.pmd.util.fxdesigner.util.controls.ASTTreeItem 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());
    }
}
Also used : TreeItem(javafx.scene.control.TreeItem) ASTTreeItem(net.sourceforge.pmd.util.fxdesigner.util.controls.ASTTreeItem) ASTTreeItem(net.sourceforge.pmd.util.fxdesigner.util.controls.ASTTreeItem)

Aggregations

ASTTreeItem (net.sourceforge.pmd.util.fxdesigner.util.controls.ASTTreeItem)2 TreeItem (javafx.scene.control.TreeItem)1