19 package org.sleuthkit.autopsy.corecomponents;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24 import java.util.logging.Level;
25 import javax.swing.JComponent;
26 import org.openide.explorer.ExplorerManager;
27 import org.openide.explorer.ExplorerUtils;
28 import org.openide.nodes.Node;
29 import org.openide.util.NbBundle;
30 import org.openide.windows.Mode;
31 import org.openide.windows.RetainLocation;
32 import org.openide.windows.TopComponent;
33 import org.openide.windows.WindowManager;
59 @RetainLocation(
"editor")
63 private final ExplorerManager explorerManager =
new ExplorerManager();
69 private static final List<String> activeComponentIds = Collections.synchronizedList(
new ArrayList<String>());
79 associateLookup(ExplorerUtils.createLookup(explorerManager, getActionMap()));
82 customizeComponent(isMain, title);
96 associateLookup(ExplorerUtils.createLookup(explorerManager, getActionMap()));
97 this.customModeName = mode;
100 customizeComponent(isMain, name);
104 this.isMain = isMain;
105 this.customModeName = null;
114 putClientProperty(TopComponent.PROP_CLOSING_DISABLED, isMain);
115 putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED,
true);
116 putClientProperty(TopComponent.PROP_DRAGGING_DISABLED,
true);
118 activeComponentIds.add(title);
131 newDataResult.setNumMatches(totalMatches);
133 newDataResult.
open();
136 newDataResult.
setNode(givenNode);
137 newDataResult.
setPath(pathText);
139 newDataResult.requestActive();
156 initInstance(pathText, givenNode, totalMatches, newDataResult);
158 return newDataResult;
179 initInstance(pathText, givenNode, totalMatches, newDataResult);
180 return newDataResult;
195 return newDataResult;
200 return explorerManager;
209 return new ArrayList<>(activeComponentIds);
222 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
223 this.setLayout(layout);
224 layout.setHorizontalGroup(
225 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
226 .addComponent(dataResultPanelLocal, javax.swing.GroupLayout.DEFAULT_SIZE, 967, Short.MAX_VALUE)
228 layout.setVerticalGroup(
229 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
230 .addComponent(dataResultPanelLocal, javax.swing.GroupLayout.DEFAULT_SIZE, 579, Short.MAX_VALUE)
238 if (customModeName == null) {
239 return TopComponent.PERSISTENCE_NEVER;
241 return TopComponent.PERSISTENCE_ALWAYS;
257 if (customModeName != null) {
258 Mode mode = WindowManager.getDefault().findMode(customModeName);
260 logger.log(Level.INFO,
"Found custom mode, setting: {0}", customModeName);
263 logger.log(Level.WARNING,
"Could not find mode: {0}, will dock into the default one", customModeName);
270 super.componentOpened();
271 this.dataResultPanel.
open();
276 super.componentClosed();
277 activeComponentIds.remove(this.getName());
278 dataResultPanel.close();
293 dataResultPanel.
setNode(selectedNode);
303 dataResultPanel.
setPath(pathText);
340 void setNumMatches(
int matches) {
void customizeComponent(boolean isMain, String title)
final DataResultPanel dataResultPanel
static final KeyStroke BOOKMARK_SHORTCUT
List< DataResultViewer > getViewers()
static DataResultTopComponent createInstance(String title, String pathText, Node givenNode, int totalMatches)
void setNumMatches(Integer numberOfChildNodes)
void setTitle(String title)
static List< String > getActiveComponentIds()
void setNode(Node rootNode)
List< DataResultViewer > getViewers()
void setSelectedNodes(Node[] selectedNodes)
void resetTabs(Node selectedNode)
DataResultTopComponent(boolean isMain, String title)
static DataResultTopComponent createInstance(String title, final String mode, String pathText, Node givenNode, int totalMatches, DataContentTopComponent dataContentWindow)
void setPath(String pathText)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
ExplorerManager getExplorerManager()
void setSelectedNodes(Node[] selected)
void setPath(String pathText)
void resetTabs(Node unusedSelectedNode)
static boolean isCaseOpen()
static DataResultTopComponent createInstance(String title)
static void initInstance(String pathText, Node givenNode, int totalMatches, DataResultTopComponent newDataResult)
void setNode(Node selectedNode)