GP-3281 fixed DataTypes tree is allow multiple file archives with the

same name to be opened.
This commit is contained in:
ghidragon 2023-04-06 16:39:40 -04:00
parent ca9a56b5f4
commit 5db99f4167
2 changed files with 13 additions and 1 deletions

View file

@ -222,8 +222,8 @@ public class ArchiveRootNode extends DataTypeTreeNode {
int index = Collections.binarySearch(allChildrenList, node);
if (index < 0) {
index = -index - 1;
addNode(index, node);
}
addNode(index, node);
}
}

View file

@ -30,10 +30,12 @@ public class FileArchiveNode extends ArchiveNode {
new GIcon("icon.plugin.datatypes.tree.node.archive.file.checked.out.exclusive");
FileArchive fileArchive; // casted reference for easy access
String fullName;
public FileArchiveNode(FileArchive archive, ArrayPointerFilterState filterState) {
super(archive, filterState);
this.fileArchive = archive;
fullName = archive.getName() + ": " + archive.getFile().getAbsolutePath();
}
@Override
@ -58,6 +60,16 @@ public class FileArchiveNode extends ArchiveNode {
return "[Unsaved New Archive]";
}
@Override
public String getName() {
return fullName;
}
@Override
public String getDisplayText() {
return archive.getName();
}
public boolean hasWriteLock() {
return fileArchive.hasWriteLock();
}