19 package org.sleuthkit.autopsy.corecomponentinterfaces;
21 import java.util.Collection;
22 import java.util.logging.Level;
23 import org.openide.util.Lookup;
24 import org.openide.util.NbBundle;
25 import org.openide.windows.Mode;
26 import org.openide.windows.TopComponent;
27 import org.openide.windows.WindowManager;
39 @NbBundle.Messages(
"CoreComponentControl.CTL_DirectoryTreeTopComponent=Directory Tree")
40 private static final String
DIRECTORY_TREE = Bundle.CoreComponentControl_CTL_DirectoryTreeTopComponent();
41 @NbBundle.Messages(
"CoreComponentControl.CTL_FavoritesTopComponent=Favorites")
42 private static final String
FAVORITES = Bundle.CoreComponentControl_CTL_FavoritesTopComponent();
55 Collection<? extends DataExplorer> dataExplorers = Lookup.getDefault().lookupAll(
DataExplorer.class);
57 TopComponent explorerWin = de.getTopComponent();
58 Mode explorerMode = WindowManager.getDefault().findMode(
"explorer");
59 if (explorerMode == null) {
60 logger.log(Level.WARNING,
"Could not find explorer mode and dock explorer window");
62 explorerMode.dockInto(explorerWin);
69 Mode outputMode = WindowManager.
getDefault().findMode(
"output");
70 if (outputMode == null) {
71 logger.log(Level.WARNING,
"Could not find output mode and dock content window");
73 outputMode.dockInto(contentWin);
88 TopComponent directoryTree = null;
89 TopComponent favorites = null;
90 final WindowManager windowManager = WindowManager.getDefault();
94 for (Mode mode : windowManager.getModes()) {
95 for (TopComponent tc : windowManager.getOpenedTopComponents(mode)) {
97 ((DataContent) tc).setNode(null);
99 ((DataResult) tc).setNode(null);
104 for (Mode mode : windowManager.getModes()) {
106 for (TopComponent tc : windowManager.getOpenedTopComponents(mode)) {
107 String tcName = tc.getName();
109 if (tcName == null) {
110 logger.log(Level.INFO,
"tcName was null");
113 if (DIRECTORY_TREE.equals(tcName)) {
115 }
else if (FAVORITES.equals(tcName)) {
123 if (directoryTree != null) {
124 directoryTree.close();
126 if (favorites != null) {
static final String DIRECTORY_TREE
static synchronized DataContentTopComponent getDefault()
static void openCoreWindows()
static synchronized DataContentTopComponent findInstance()
static void closeCoreWindows()
static final Logger logger
synchronized static Logger getLogger(String name)
static final String FAVORITES