Skip to content

Commit

Permalink
Do not try to create children for Show node in search view.
Browse files Browse the repository at this point in the history
Navigate feature of SearchView tries to create children for element for
Show node.
We should not support expanded state for ExpandableNode.

Fixes eclipse-platform#1024
  • Loading branch information
raghucssit committed Aug 23, 2023
1 parent ffb0cdc commit b72d6d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2596,6 +2596,12 @@ public void setExpandedState(Object elementOrTreePath, boolean expanded) {
Assert.isNotNull(elementOrTreePath);
if (checkBusy())
return;

// we do not support expand/collapse for ExpandableNode
if (isExpandableNode(elementOrTreePath)) {
return;
}

Widget item = internalExpand(elementOrTreePath, false);
if (item instanceof Item) {
if (expanded) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ private TreeItem getNextItemForward(TreeItem currentItem) {
return child;
TreeItem nextSibling= getNextSibling(currentItem, true);
if (nextSibling != null) {
// do not search for matches inside exp node. just select it.
if (fViewer.isExpandableNode(nextSibling.getData())) {
return nextSibling;
}
if (hasMatches(nextSibling))
return nextSibling;
return getFirstChildWithMatches(nextSibling);
Expand All @@ -116,6 +120,10 @@ private TreeItem getNextItemForward(TreeItem currentItem) {
while (parent != null) {
nextSibling= getNextSibling(parent, true);
if (nextSibling != null) {
// if the parent sibling is an exp node then select it.
if (fViewer.isExpandableNode(nextSibling.getData())) {
return nextSibling;
}
if (hasMatches(nextSibling))
return nextSibling;
return getFirstChildWithMatches(nextSibling);
Expand Down

0 comments on commit b72d6d9

Please sign in to comment.