mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
fix setting icons for file and dir nodes: make sure it is always set regardless of constructor used
This commit is contained in:
parent
a143bb7744
commit
832b4467a6
@ -23,21 +23,27 @@ import org.sleuthkit.datamodel.Directory;
|
|||||||
import org.sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM;
|
import org.sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used to represent the "Node" for the directory.
|
* This class is used to represent the "Node" for the directory. Its children
|
||||||
* Its children are more directories.
|
* are more directories.
|
||||||
*/
|
*/
|
||||||
public class DirectoryNode extends AbstractFsContentNode<Directory> {
|
public class DirectoryNode extends AbstractFsContentNode<Directory> {
|
||||||
|
|
||||||
public static final String DOTDOTDIR = "[parent folder]";
|
public static final String DOTDOTDIR = "[parent folder]";
|
||||||
public static final String DOTDIR = "[current folder]";
|
public static final String DOTDIR = "[current folder]";
|
||||||
|
|
||||||
public DirectoryNode(Directory dir) {
|
public DirectoryNode(Directory dir) {
|
||||||
this(dir, true);
|
this(dir, true);
|
||||||
|
|
||||||
|
setIcon(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DirectoryNode(Directory dir, boolean directoryBrowseMode) {
|
public DirectoryNode(Directory dir, boolean directoryBrowseMode) {
|
||||||
super(dir, directoryBrowseMode);
|
super(dir, directoryBrowseMode);
|
||||||
|
|
||||||
|
setIcon(dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setIcon(Directory dir) {
|
||||||
// set name, display name, and icon
|
// set name, display name, and icon
|
||||||
if (dir.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
|
if (dir.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
|
||||||
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-deleted.png");
|
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-deleted.png");
|
||||||
@ -66,12 +72,9 @@ public class DirectoryNode extends AbstractFsContentNode<Directory> {
|
|||||||
public <T> T accept(DisplayableItemNodeVisitor<T> v) {
|
public <T> T accept(DisplayableItemNodeVisitor<T> v) {
|
||||||
return v.visit(this);
|
return v.visit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TYPE getDisplayableItemNodeType() {
|
public TYPE getDisplayableItemNodeType() {
|
||||||
return TYPE.CONTENT;
|
return TYPE.CONTENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,11 +33,19 @@ public class FileNode extends AbstractFsContentNode<File> {
|
|||||||
*/
|
*/
|
||||||
public FileNode(File file) {
|
public FileNode(File file) {
|
||||||
this(file, true);
|
this(file, true);
|
||||||
|
|
||||||
|
setIcon(file);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileNode(File file, boolean directoryBrowseMode) {
|
public FileNode(File file, boolean directoryBrowseMode) {
|
||||||
super(file, directoryBrowseMode);
|
super(file, directoryBrowseMode);
|
||||||
|
|
||||||
|
setIcon(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setIcon(File file) {
|
||||||
// set name, display name, and icon
|
// set name, display name, and icon
|
||||||
if (file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
|
if (file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
|
||||||
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png");
|
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png");
|
||||||
@ -58,12 +66,12 @@ public class FileNode extends AbstractFsContentNode<File> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T accept(ContentNodeVisitor<T> v) {
|
public <T> T accept(ContentNodeVisitor< T> v) {
|
||||||
return v.visit(this);
|
return v.visit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T accept(DisplayableItemNodeVisitor<T> v) {
|
public <T> T accept(DisplayableItemNodeVisitor< T> v) {
|
||||||
return v.visit(this);
|
return v.visit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,6 +148,4 @@ public class FileNode extends AbstractFsContentNode<File> {
|
|||||||
public boolean isLeafTypeNode() {
|
public boolean isLeafTypeNode() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user