19 package org.sleuthkit.autopsy.corecomponents;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
25 import java.util.logging.Level;
26 import javax.swing.JComponent;
27 import org.openide.explorer.ExplorerManager;
28 import org.openide.explorer.ExplorerUtils;
29 import org.openide.util.NbBundle;
30 import org.openide.windows.TopComponent;
31 import org.openide.nodes.Node;
32 import org.openide.windows.Mode;
33 import org.openide.windows.WindowManager;
67 private static final List<String>
activeComponentIds = Collections.synchronizedList(
new ArrayList<String>());
77 associateLookup(ExplorerUtils.createLookup(explorerManager, getActionMap()));
94 associateLookup(ExplorerUtils.createLookup(explorerManager, getActionMap()));
95 this.customModeName = mode;
103 this.customModeName = null;
112 putClientProperty(TopComponent.PROP_CLOSING_DISABLED, isMain);
113 putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED,
true);
114 putClientProperty(TopComponent.PROP_DRAGGING_DISABLED,
true);
116 activeComponentIds.add(title);
129 newDataResult.setNumMatches(totalMatches);
131 newDataResult.
open();
134 newDataResult.
setNode(givenNode);
135 newDataResult.
setPath(pathText);
137 newDataResult.requestActive();
154 initInstance(pathText, givenNode, totalMatches, newDataResult);
156 return newDataResult;
177 initInstance(pathText, givenNode, totalMatches, newDataResult);
178 return newDataResult;
193 return newDataResult;
220 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
221 this.setLayout(layout);
222 layout.setHorizontalGroup(
223 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
224 .addComponent(dataResultPanelLocal, javax.swing.GroupLayout.DEFAULT_SIZE, 967, Short.MAX_VALUE)
226 layout.setVerticalGroup(
227 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
228 .addComponent(dataResultPanelLocal, javax.swing.GroupLayout.DEFAULT_SIZE, 579, Short.MAX_VALUE)
236 if (customModeName == null) {
237 return TopComponent.PERSISTENCE_NEVER;
239 return TopComponent.PERSISTENCE_ALWAYS;
255 if (customModeName != null) {
256 Mode mode = WindowManager.getDefault().findMode(customModeName);
258 StringBuilder message =
new StringBuilder(
"Found custom mode, setting: ");
259 message.append(customModeName);
260 logger.log(Level.INFO, message.toString());
264 StringBuilder message =
new StringBuilder(
"Could not find mode: ");
265 message.append(customModeName);
266 message.append(
", will dock into the default one");
267 logger.log(Level.WARNING, message.toString());
274 super.componentOpened();
275 this.dataResultPanel.
open();
280 super.componentClosed();
281 activeComponentIds.remove(this.getName());
282 dataResultPanel.close();
297 dataResultPanel.
setNode(selectedNode);
307 dataResultPanel.
setPath(pathText);
339 void setNumMatches(
int matches) {
void customizeComponent(boolean isMain, String title)
static final KeyStroke BOOKMARK_SHORTCUT
ExplorerManager explorerManager
List< DataResultViewer > getViewers()
static DataResultTopComponent createInstance(String title, String pathText, Node givenNode, int totalMatches)
void setSelectedNodes(Node[] selected)
static final Logger logger
void setTitle(String title)
void setNode(Node selectedNode)
static List< String > getActiveComponentIds()
List< DataResultViewer > getViewers()
void resetTabs(Node selectedNode)
DataResultTopComponent(boolean isMain, String title)
DataResultPanel dataResultPanel
static DataResultTopComponent createInstance(String title, final String mode, String pathText, Node givenNode, int totalMatches, DataContentTopComponent dataContentWindow)
void resetTabs(Node selectedNode)
void setNumMatches(Integer numMatches)
void setPath(String pathText)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static final List< String > activeComponentIds
ExplorerManager getExplorerManager()
void setSelectedNodes(Node[] selected)
void setPath(String pathText)
static boolean isCaseOpen()
static DataResultTopComponent createInstance(String title)
static void initInstance(String pathText, Node givenNode, int totalMatches, DataResultTopComponent newDataResult)
void setNode(Node selectedNode)