Merge pull request #7251 from kellykelly3/7962-disabled-text-table

7962 - TextViewer tab will now be enabled for Reports
This commit is contained in:
Richard Cordovano 2021-09-09 17:34:58 -04:00 committed by GitHub
commit a88f62f759
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact;
/** /**
* A DataContentViewer that displays text with the TextViewers available. * A DataContentViewer that displays text with the TextViewers available.
@ -91,14 +92,10 @@ public class TextContentViewer implements DataContentViewer {
if (node == null) { if (node == null) {
return false; return false;
} }
// get the node's File, if it has one // get the node's File, if it has one
AbstractFile file = node.getLookup().lookup(AbstractFile.class); AbstractFile file = node.getLookup().lookup(AbstractFile.class);
if (file == null) { if (file != null && (file.isDir() || file.getSize() == 0)) {
return false;
}
// disable the text content viewer for directories and empty files
if (file.isDir() || file.getSize() == 0) {
return false; return false;
} }