19 package org.sleuthkit.autopsy.corecomponents;
21 import java.beans.PropertyChangeEvent;
22 import java.util.ArrayList;
23 import java.util.List;
24 import java.util.logging.Level;
26 import javax.swing.JTabbedPane;
27 import org.openide.nodes.Node;
28 import org.openide.util.NbBundle;
29 import org.openide.windows.TopComponent;
30 import org.openide.windows.WindowManager;
55 private static ArrayList<DataContentTopComponent>
newWindowList =
new ArrayList<DataContentTopComponent>();
56 private static final String
PREFERRED_ID =
"DataContentTopComponent";
63 setToolTipText(TOOLTIP_TEXT);
68 add(dataContentPanel);
70 putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.valueOf(isDefault));
71 logger.log(Level.INFO,
"Created DataContentTopComponent instance: " +
this);
89 newWindowList.add(dctc);
102 setLayout(
new javax.swing.BoxLayout(
this, javax.swing.BoxLayout.Y_AXIS));
114 if (defaultInstance == null) {
125 TopComponent win = WindowManager.
getDefault().findTopComponent(PREFERRED_ID);
127 logger.warning(
"Cannot find " + PREFERRED_ID +
" component. It will not be located properly in the window system.");
131 return (DataContentTopComponent) win;
134 "There seem to be multiple components with the '" + PREFERRED_ID
135 +
"' ID. That is a potential source of errors and unexpected behavior.");
141 return TopComponent.PERSISTENCE_NEVER;
151 dataContentPanel.
setNode(null);
153 if (!this.isDefault) {
154 newWindowList.remove(
this);
160 if (this.isDefault) {
163 return this.getName();
169 dataContentPanel.
setNode(selectedNode);
static synchronized DataContentTopComponent getDefault()
void setNode(Node selectedNode)
JTabbedPane getTabPanels()
void setNode(Node selectedNode)
static final String DEFAULT_NAME
final DataContentPanel dataContentPanel
static DataContentTopComponent createUndocked(String filePath, Node givenNode)
DataContentTopComponent(boolean isDefault, String name)
static synchronized DataContentTopComponent findInstance()
JTabbedPane getTabPanels()
static final String PREFERRED_ID
static final String TOOLTIP_TEXT
static DataContentTopComponent defaultInstance
static List< DataContentTopComponent > getNewWindowList()
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static ArrayList< DataContentTopComponent > newWindowList
void propertyChange(PropertyChangeEvent evt)
static boolean isCaseOpen()