mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
getNameIdentifier
This commit is contained in:
parent
aa41747841
commit
98bf69a788
@ -93,8 +93,15 @@ public class DataSourcesByTypeNode extends DisplayableItemNode {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String NAME = Bundle.DataSourcesHostsNode_name();
|
private static final String NAME = Bundle.DataSourcesHostsNode_name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The name used to identify the node of this type with a lookup.
|
||||||
|
*/
|
||||||
|
public static String getNameIdentifier() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main constructor.
|
* Main constructor.
|
||||||
*/
|
*/
|
||||||
|
@ -43,7 +43,15 @@ import org.sleuthkit.datamodel.TskDataException;
|
|||||||
*/
|
*/
|
||||||
public class DataSourcesNode extends DisplayableItemNode {
|
public class DataSourcesNode extends DisplayableItemNode {
|
||||||
|
|
||||||
public static final String NAME = NbBundle.getMessage(DataSourcesNode.class, "DataSourcesNode.name");
|
private static final String NAME = NbBundle.getMessage(DataSourcesNode.class, "DataSourcesNode.name");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The name used to identify the node of this type with a lookup.
|
||||||
|
*/
|
||||||
|
public static String getNameIdentifier() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
private final String displayName;
|
private final String displayName;
|
||||||
|
|
||||||
// NOTE: The images passed in via argument will be ignored.
|
// NOTE: The images passed in via argument will be ignored.
|
||||||
|
@ -211,7 +211,7 @@ public class ViewContextAction extends AbstractAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for this data source, get the "Data Sources" child node
|
// for this data source, get the "Data Sources" child node
|
||||||
Node datasourceGroupingNode = treeNode.getChildren().findChild(DataSourcesNode.NAME);
|
Node datasourceGroupingNode = treeNode.getChildren().findChild(DataSourcesNode.getNameIdentifier());
|
||||||
|
|
||||||
// check whether this is the data source we are looking for
|
// check whether this is the data source we are looking for
|
||||||
parentTreeViewNode = findParentNodeInTree(parentContent, datasourceGroupingNode);
|
parentTreeViewNode = findParentNodeInTree(parentContent, datasourceGroupingNode);
|
||||||
@ -227,7 +227,7 @@ public class ViewContextAction extends AbstractAction {
|
|||||||
Node datasourceGroupingNode = rootChildren.findChild(dsname);
|
Node datasourceGroupingNode = rootChildren.findChild(dsname);
|
||||||
if (!Objects.isNull(datasourceGroupingNode)) {
|
if (!Objects.isNull(datasourceGroupingNode)) {
|
||||||
Children dsChildren = datasourceGroupingNode.getChildren();
|
Children dsChildren = datasourceGroupingNode.getChildren();
|
||||||
parentTreeViewNode = dsChildren.findChild(DataSourcesNode.NAME);
|
parentTreeViewNode = dsChildren.findChild(DataSourcesNode.getNameIdentifier());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ public class ViewContextAction extends AbstractAction {
|
|||||||
} else { // Classic view
|
} else { // Classic view
|
||||||
// Start the search at the DataSourcesNode
|
// Start the search at the DataSourcesNode
|
||||||
Children rootChildren = treeViewExplorerMgr.getRootContext().getChildren();
|
Children rootChildren = treeViewExplorerMgr.getRootContext().getChildren();
|
||||||
Node rootDsNode = rootChildren == null ? null : rootChildren.findChild(DataSourcesByTypeNode.NAME);
|
Node rootDsNode = rootChildren == null ? null : rootChildren.findChild(DataSourcesByTypeNode.getNameIdentifier());
|
||||||
if (rootDsNode != null) {
|
if (rootDsNode != null) {
|
||||||
for (Node dataSourceLevelNode : getDataSourceLevelNodes(rootDsNode)) {
|
for (Node dataSourceLevelNode : getDataSourceLevelNodes(rootDsNode)) {
|
||||||
DataSource dataSource = dataSourceLevelNode.getLookup().lookup(DataSource.class);
|
DataSource dataSource = dataSourceLevelNode.getLookup().lookup(DataSource.class);
|
||||||
@ -313,7 +313,7 @@ public class ViewContextAction extends AbstractAction {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
} else if (node.getLookup().lookup(Host.class) != null ||
|
} else if (node.getLookup().lookup(Host.class) != null ||
|
||||||
node.getLookup().lookup(Person.class) != null ||
|
node.getLookup().lookup(Person.class) != null ||
|
||||||
DataSourcesByTypeNode.NAME.equals(node.getLookup().lookup(String.class))) {
|
DataSourcesByTypeNode.getNameIdentifier().equals(node.getLookup().lookup(String.class))) {
|
||||||
Children children = node.getChildren();
|
Children children = node.getChildren();
|
||||||
Node[] childNodes = children == null ? null : children.getNodes();
|
Node[] childNodes = children == null ? null : children.getNodes();
|
||||||
if (childNodes == null) {
|
if (childNodes == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user