Merge pull request #5036 from dannysmyda/3822-DataContentTopComponent-Pos-Warning

3822 data content top component pos warning
This commit is contained in:
Richard Cordovano 2019-09-11 16:51:05 -04:00 committed by GitHub
commit 7f68c9815c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -436,7 +436,7 @@
<folder name="Windows2"> <folder name="Windows2">
<folder name="Components"> <folder name="Components">
<file name="DirectoryTreeTopComponent.settings" url="DirectoryTreeTopComponentSettings.xml"/> <file name="DirectoryTreeTopComponent.settings" url="DirectoryTreeTopComponentSettings.xml"/>
<!-- <file name="DataContentTopComponent.settings" url="DataContentTopComponentSettings.xml" /> --> <file name="DataContentTopComponent.settings" url="DataContentTopComponentSettings.xml" />
<file name="IngestMessageTopComponent.settings" url="IngestMessageTopComponentSettings.xml"/> <file name="IngestMessageTopComponent.settings" url="IngestMessageTopComponentSettings.xml"/>
</folder> </folder>
<folder name="Modes"> <folder name="Modes">

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2018 Basis Technology Corp. * Copyright 2011-2019 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -40,9 +40,6 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* startup). * startup).
*/ */
// Registered as a service provider in layer.xml // Registered as a service provider in layer.xml
//@TopComponent.Description(preferredID = "DataContentTopComponent")
//@TopComponent.Registration(mode = "output", openAtStartup = true)
//@TopComponent.OpenActionRegistration(displayName = "#CTL_DataContentAction", preferredID = "DataContentTopComponent")
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
public final class DataContentTopComponent extends TopComponent implements DataContent, ExplorerManager.Provider { public final class DataContentTopComponent extends TopComponent implements DataContent, ExplorerManager.Provider {
@ -125,15 +122,18 @@ public final class DataContentTopComponent extends TopComponent implements DataC
public static synchronized DataContentTopComponent findInstance() { public static synchronized DataContentTopComponent findInstance() {
TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID); TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
if (win == null) { if (win == null) {
logger.warning("Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system."); //NON-NLS logger.log(Level.INFO, "Cannot find " + PREFERRED_ID + " component. It will "
+ "not be located properly in the window system."); //NON-NLS
return getDefault(); return getDefault();
} }
if (win instanceof DataContentTopComponent) { if (win instanceof DataContentTopComponent) {
return (DataContentTopComponent) win; return (DataContentTopComponent) win;
} }
logger.warning(
"There seem to be multiple components with the '" + PREFERRED_ID //NON-NLS logger.log(Level.INFO, "There seem to be multiple components with the '" + PREFERRED_ID //NON-NLS
+ "' ID. That is a potential source of errors and unexpected behavior."); //NON-NLS + "' ID. That is a potential source of errors and unexpected behavior."); //NON-NLS
return getDefault(); return getDefault();
} }