Remove references to TypeWrapper class

This commit is contained in:
Dick Fickling 2012-02-09 13:18:16 -05:00
parent 5d0bee3714
commit acc739d40e
4 changed files with 17 additions and 23 deletions

View File

@ -23,7 +23,6 @@ import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children.Keys;
import org.openide.nodes.Node;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardArtifact.TypeWrapper;
import org.sleuthkit.datamodel.Directory;
import org.sleuthkit.datamodel.File;
import org.sleuthkit.datamodel.FileSystem;
@ -97,7 +96,7 @@ abstract class AbstractContentChildren extends Keys<Object> {
}
@Override
public AbstractNode visit(TypeWrapper a) {
public AbstractNode visit(BlackboardArtifact.ARTIFACT_TYPE a) {
return defaultVisit(a);
}
@ -126,6 +125,11 @@ abstract class AbstractContentChildren extends Keys<Object> {
public AbstractNode visit(SearchFilters sf) {
return new SearchFiltersNode(sf.getSleuthkitCase());
}
@Override
public AbstractNode visit(RecentFiles rf) {
return new RecentFilesNode(rf.getSleuthkitCase());
}
@Override
protected AbstractNode defaultVisit(AutopsyVisitableItem di) {

View File

@ -36,9 +36,9 @@ import org.sleuthkit.datamodel.TskException;
class ArtifactTypeChildren extends ChildFactory<BlackboardArtifact>{
private SleuthkitCase skCase;
private BlackboardArtifact.TypeWrapper type;
private BlackboardArtifact.ARTIFACT_TYPE type;
public ArtifactTypeChildren(BlackboardArtifact.TypeWrapper type, SleuthkitCase skCase) {
public ArtifactTypeChildren(BlackboardArtifact.ARTIFACT_TYPE type, SleuthkitCase skCase) {
this.skCase = skCase;
this.type = type;
}
@ -46,7 +46,7 @@ class ArtifactTypeChildren extends ChildFactory<BlackboardArtifact>{
@Override
protected boolean createKeys(List<BlackboardArtifact> list) {
try {
list.addAll(skCase.getBlackboardArtifacts(type.getTypeId()));
list.addAll(skCase.getBlackboardArtifacts(type.getTypeID()));
} catch (TskException ex) {
Logger.getLogger(ArtifactTypeChildren.class.getName())
.log(Level.SEVERE, "Couldn't get blackboard artifacts from database", ex);

View File

@ -26,8 +26,6 @@ import org.openide.nodes.Children;
import org.openide.nodes.Sheet;
import org.openide.util.lookup.Lookups;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
import org.sleuthkit.datamodel.BlackboardArtifact.TypeWrapper;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskException;
@ -37,17 +35,17 @@ import org.sleuthkit.datamodel.TskException;
*/
public class ArtifactTypeNode extends AbstractNode implements DisplayableItemNode{
BlackboardArtifact.TypeWrapper type;
BlackboardArtifact.ARTIFACT_TYPE type;
int childCount = 0;
ArtifactTypeNode(BlackboardArtifact.TypeWrapper type, SleuthkitCase skCase) {
ArtifactTypeNode(BlackboardArtifact.ARTIFACT_TYPE type, SleuthkitCase skCase) {
super(Children.create(new ArtifactTypeChildren(type, skCase), true), Lookups.singleton(type));
super.setName(type.getDisplayName());
// NOTE: This completely destroys our lazy-loading ideal
// a performance increase might be had by adding a
// "getBlackboardArtifactCount()" method to skCase
try {
this.childCount = skCase.getBlackboardArtifacts(type.getTypeId()).size();
this.childCount = skCase.getBlackboardArtifacts(type.getTypeID()).size();
} catch (TskException ex) {
Logger.getLogger(ArtifactTypeNode.class.getName())
.log(Level.INFO, "Error getting child count", ex);

View File

@ -18,21 +18,18 @@
*/
package org.sleuthkit.autopsy.datamodel;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.openide.nodes.ChildFactory;
import org.openide.nodes.Node;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskException;
/**
*
* @author dfickling
*/
public class ExtractedContentChildren extends ChildFactory<BlackboardArtifact.TypeWrapper> {
public class ExtractedContentChildren extends ChildFactory<BlackboardArtifact.ARTIFACT_TYPE> {
private SleuthkitCase skCase;
@ -42,18 +39,13 @@ public class ExtractedContentChildren extends ChildFactory<BlackboardArtifact.Ty
}
@Override
protected boolean createKeys(List<BlackboardArtifact.TypeWrapper> list) {
try {
list.addAll(skCase.getBlackboardArtifactTypes());
} catch (TskException ex) {
Logger.getLogger(ExtractedContentChildren.class.getName())
.log(Level.SEVERE, "Couldn't get all artifact types from db", ex);
}
protected boolean createKeys(List<BlackboardArtifact.ARTIFACT_TYPE> list) {
list.addAll(Arrays.asList(BlackboardArtifact.ARTIFACT_TYPE.values()));
return true;
}
@Override
protected Node createNodeForKey(BlackboardArtifact.TypeWrapper key){
protected Node createNodeForKey(BlackboardArtifact.ARTIFACT_TYPE key){
return new ArtifactTypeNode(key, skCase);
}