GP-3551 Added support for internal project link-files with improved link

support within project data tree. Linked-folders are now supported.
Addressed link-support issues related to various actions.  Revised
link-file storage to use smaller non-DB storage. This change does impact
the Ghidra Server.
This commit is contained in:
ghidra1 2025-04-25 15:44:03 -04:00
parent 7482131bcc
commit 1aa7b089c0
209 changed files with 10096 additions and 3050 deletions

View file

@ -448,7 +448,14 @@ public abstract class GTreeNode extends CoreGTreeNode implements Comparable<GTre
int count = 1;
for (GTreeNode child : children) {
monitor.checkCancelled();
count += child.loadAll(monitor);
if (child.isAutoExpandPermitted()) {
// count the child and its children
count += child.loadAll(monitor);
}
else {
// count just the child
++count;
}
monitor.incrementProgress(1);
}
return count;

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -22,6 +22,9 @@ import docking.widgets.tree.GTreeNode;
/**
* Implements an iterator over all GTreeNodes in some gTree (or subtree). The nodes are
* return in breadth first order.
* <br>
* NOTE: Iterator will not include children of a node where {@link GTreeNode#isAutoExpandPermitted()}
* returns false.
*/
public class BreadthFirstIterator implements Iterator<GTreeNode> {
private Queue<GTreeNode> nodeQueue = new LinkedList<GTreeNode>();
@ -39,7 +42,7 @@ public class BreadthFirstIterator implements Iterator<GTreeNode> {
@Override
public GTreeNode next() {
lastNode = nodeQueue.poll();
if (lastNode != null) {
if (lastNode != null && lastNode.isAutoExpandPermitted()) {
List<GTreeNode> children = lastNode.getChildren();
nodeQueue.addAll(children);
}

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -25,6 +25,9 @@ import docking.widgets.tree.GTreeNode;
/**
* Implements an iterator over all GTreeNodes in some gTree (or subtree). The nodes are
* return in depth first order.
* <br>
* NOTE: Iterator will not include children of a node where {@link GTreeNode#isAutoExpandPermitted()}
* returns false.
*/
public class DepthFirstIterator implements Iterator<GTreeNode> {
private Stack<Iterator<GTreeNode>> stack = new Stack<>();
@ -49,7 +52,7 @@ public class DepthFirstIterator implements Iterator<GTreeNode> {
it = stack.pop();
}
lastNode = it.next();
if (lastNode.getChildCount() > 0) {
if (lastNode.isAutoExpandPermitted() && lastNode.getChildCount() > 0) {
if (it.hasNext()) {
stack.push(it);
}