Explanations

This commit is contained in:
Clément Fournier
2019-01-16 12:02:29 +01:00
parent fe717c3af5
commit d0fbf4a313
2 changed files with 7 additions and 4 deletions

View File

@ -50,7 +50,7 @@ public class NodeInfoPanelController extends AbstractController {
private final MainDesignerController parent;
/** List of attribute names that are ignored if {@link #isShowAllAttributes()} is false. */
/** List of attribute names that are ignored if {@link #isHideCommonAttributes()} is true. */
private static final List<String> IGNORABLE_ATTRIBUTES =
Arrays.asList("BeginLine", "EndLine", "BeginColumn", "EndColumn", "FindBoundary", "SingleLine");
@ -152,8 +152,11 @@ public class NodeInfoPanelController extends AbstractController {
scopeHierarchyTreeView.setRoot(rootScope);
if (focusScopeView && previousSelection != null) {
// Try to find the node that was previously selected and focus it in the new ascendant hierarchy
// Otherwise, when you select a node in the scope tree, since focus of the app is shifted to that
// node, the scope hierarchy is reset and you lose the selection - even though obviously the node
// you selected is in its own scope hierarchy so it looks buggy.
int maxDepth = IteratorUtil.count(IteratorUtil.parentIterator(previousSelection, true));
rootScope.tryFindNode(previousSelection.getValue(), maxDepth)
.ifPresent(scopeHierarchyTreeView.getSelectionModel()::select);
}

View File

@ -70,13 +70,13 @@ public class SourceEditorController extends AbstractController {
private static final Duration AST_REFRESH_DELAY = Duration.ofMillis(100);
@FXML
private MenuButton languageSelectionMenuButton;
@FXML
private ToolbarTitledPane editorTitledPane;
@FXML
private ToolbarTitledPane astViewTitledPane;
@FXML
private MenuButton languageSelectionMenuButton;
@FXML
private TreeView<Node> astTreeView;
@FXML
private HighlightLayerCodeArea<StyleLayerIds> codeEditorArea;