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();
91 for (Mode mode : windowManager.getModes()) {
92 for (TopComponent tc : windowManager.getOpenedTopComponents(mode)) {
93 String tcName = tc.getName();
96 logger.log(Level.INFO,
"tcName was null");
99 if (DIRECTORY_TREE.equals(tcName)) {
101 }
else if (FAVORITES.equals(tcName)) {
109 if (directoryTree != null) {
110 directoryTree.close();
112 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