19 package org.sleuthkit.autopsy.corecomponents;
21 import java.awt.Component;
22 import java.awt.Cursor;
23 import java.awt.Toolkit;
24 import java.awt.event.ActionEvent;
25 import java.awt.event.ActionListener;
26 import java.awt.datatransfer.StringSelection;
27 import java.text.SimpleDateFormat;
28 import java.util.ArrayList;
29 import java.util.Collection;
30 import java.util.Enumeration;
31 import java.util.List;
32 import java.util.concurrent.ExecutionException;
33 import java.util.logging.Level;
34 import javax.swing.JMenuItem;
35 import javax.swing.JTextArea;
36 import javax.swing.SwingWorker;
37 import javax.swing.event.ChangeEvent;
38 import javax.swing.event.ListSelectionEvent;
39 import javax.swing.event.TableColumnModelEvent;
40 import javax.swing.table.DefaultTableModel;
41 import javax.swing.table.TableColumn;
42 import javax.swing.event.TableColumnModelListener;
43 import javax.swing.text.View;
44 import org.apache.commons.lang.StringUtils;
45 import org.openide.nodes.Node;
46 import org.openide.util.Lookup;
47 import org.openide.util.NbBundle;
48 import org.openide.util.lookup.ServiceProvider;
53 import org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
58 import org.netbeans.swing.etable.ETable;
65 @ServiceProvider(service = DataContentViewer.class, position = 7)
66 @SuppressWarnings(
"PMD.SingularField")
70 "DataContentViewerArtifact.attrsTableHeader.type=Type",
71 "DataContentViewerArtifact.attrsTableHeader.value=Value",
72 "DataContentViewerArtifact.attrsTableHeader.sources=Source(s)",
73 "DataContentViewerArtifact.failedToGetSourcePath.message=Failed to get source file path from case database",
74 "DataContentViewerArtifact.failedToGetAttributes.message=Failed to get some or all attributes from case database"
78 private final static String ERROR_TEXT = NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.errorText");
80 private int currentPage = 1;
81 private final Object lock =
new Object();
83 SwingWorker<ViewUpdate, Void> currentTask;
84 private static final String[] COLUMN_HEADERS = {
85 Bundle.DataContentViewerArtifact_attrsTableHeader_type(),
86 Bundle.DataContentViewerArtifact_attrsTableHeader_value(),
87 Bundle.DataContentViewerArtifact_attrsTableHeader_sources()};
88 private static final int[] COLUMN_WIDTHS = {100, 800, 100};
89 private static final int CELL_BOTTOM_MARGIN = 5;
90 private static final int CELL_RIGHT_MARGIN = 1;
95 resultsTableScrollPane.setViewportView(resultsTable);
96 customizeComponents();
102 resultsTable =
new ETable();
103 resultsTable.setModel(
new javax.swing.table.DefaultTableModel() {
104 private static final long serialVersionUID = 1L;
106 public boolean isCellEditable(
int rowIndex,
int columnIndex) {
110 resultsTable.setCellSelectionEnabled(
true);
111 resultsTable.getTableHeader().setReorderingAllowed(
false);
112 resultsTable.setColumnHidingAllowed(
false);
113 resultsTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
114 resultsTable.getColumnModel().addColumnModelListener(
new TableColumnModelListener() {
117 public void columnAdded(TableColumnModelEvent e) {
121 public void columnRemoved(TableColumnModelEvent e) {
125 public void columnMoved(TableColumnModelEvent e) {
130 public void columnMarginChanged(ChangeEvent e) {
135 public void columnSelectionChanged(ListSelectionEvent e) {
138 resultsTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN);
146 int valueColIndex = -1;
147 for (
int col = 0; col < resultsTable.getColumnCount(); col++) {
148 if (resultsTable.getColumnName(col).equals(COLUMN_HEADERS[1])) {
152 if (valueColIndex != -1) {
153 for (
int row = 0; row < resultsTable.getRowCount(); row++) {
154 Component comp = resultsTable.prepareRenderer(
155 resultsTable.getCellRenderer(row, valueColIndex), row, valueColIndex);
157 if (comp instanceof JTextArea) {
158 final JTextArea tc = (JTextArea) comp;
159 final View rootView = tc.getUI().getRootView(tc);
160 java.awt.Insets i = tc.getInsets();
161 rootView.setSize(resultsTable.getColumnModel().getColumn(valueColIndex)
162 .getWidth() - (i.left + i.right +CELL_RIGHT_MARGIN),
164 rowHeight = (int) rootView.getPreferredSpan(View.Y_AXIS);
166 rowHeight = comp.getPreferredSize().height;
169 resultsTable.setRowHeight(row, rowHeight + CELL_BOTTOM_MARGIN);
179 Enumeration<TableColumn> columns = resultsTable.getColumnModel().getColumns();
180 while (columns.hasMoreElements()) {
181 TableColumn col = columns.nextElement();
182 if (col.getHeaderValue().equals(COLUMN_HEADERS[0])) {
183 col.setPreferredWidth(COLUMN_WIDTHS[0]);
184 }
else if (col.getHeaderValue().equals(COLUMN_HEADERS[1])) {
185 col.setPreferredWidth(COLUMN_WIDTHS[1]);
186 }
else if (col.getHeaderValue().equals(COLUMN_HEADERS[2])) {
187 col.setPreferredWidth(COLUMN_WIDTHS[2]);
197 @SuppressWarnings(
"unchecked")
199 private
void initComponents() {
201 rightClickMenu =
new javax.swing.JPopupMenu();
202 copyMenuItem =
new javax.swing.JMenuItem();
203 selectAllMenuItem =
new javax.swing.JMenuItem();
204 jScrollPane1 =
new javax.swing.JScrollPane();
205 jPanel1 =
new javax.swing.JPanel();
206 totalPageLabel =
new javax.swing.JLabel();
207 ofLabel =
new javax.swing.JLabel();
208 currentPageLabel =
new javax.swing.JLabel();
209 pageLabel =
new javax.swing.JLabel();
210 nextPageButton =
new javax.swing.JButton();
211 pageLabel2 =
new javax.swing.JLabel();
212 prevPageButton =
new javax.swing.JButton();
213 artifactLabel =
new javax.swing.JLabel();
214 resultsTableScrollPane =
new javax.swing.JScrollPane();
216 copyMenuItem.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.copyMenuItem.text"));
217 rightClickMenu.add(copyMenuItem);
219 selectAllMenuItem.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.selectAllMenuItem.text"));
220 rightClickMenu.add(selectAllMenuItem);
222 setPreferredSize(
new java.awt.Dimension(100, 58));
224 jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
225 jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
227 jPanel1.setPreferredSize(
new java.awt.Dimension(620, 58));
229 totalPageLabel.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.totalPageLabel.text"));
233 currentPageLabel.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.currentPageLabel.text"));
234 currentPageLabel.setMaximumSize(
new java.awt.Dimension(18, 14));
235 currentPageLabel.setMinimumSize(
new java.awt.Dimension(18, 14));
236 currentPageLabel.setPreferredSize(
new java.awt.Dimension(18, 14));
240 nextPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png")));
241 nextPageButton.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.nextPageButton.text"));
242 nextPageButton.setBorderPainted(
false);
243 nextPageButton.setContentAreaFilled(
false);
244 nextPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png")));
245 nextPageButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
246 nextPageButton.setPreferredSize(
new java.awt.Dimension(23, 23));
247 nextPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png")));
248 nextPageButton.addActionListener(
new java.awt.event.ActionListener() {
249 public void actionPerformed(java.awt.event.ActionEvent evt) {
250 nextPageButtonActionPerformed(evt);
255 pageLabel2.setMaximumSize(
new java.awt.Dimension(29, 14));
256 pageLabel2.setMinimumSize(
new java.awt.Dimension(29, 14));
258 prevPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back.png")));
259 prevPageButton.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.prevPageButton.text"));
260 prevPageButton.setBorderPainted(
false);
261 prevPageButton.setContentAreaFilled(
false);
262 prevPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png")));
263 prevPageButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
264 prevPageButton.setPreferredSize(
new java.awt.Dimension(23, 23));
265 prevPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png")));
266 prevPageButton.addActionListener(
new java.awt.event.ActionListener() {
267 public void actionPerformed(java.awt.event.ActionEvent evt) {
268 prevPageButtonActionPerformed(evt);
272 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
273 jPanel1.setLayout(jPanel1Layout);
274 jPanel1Layout.setHorizontalGroup(
275 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
276 .addGroup(jPanel1Layout.createSequentialGroup()
278 .addComponent(pageLabel)
279 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
280 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
281 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
282 .addComponent(ofLabel)
283 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
284 .addComponent(totalPageLabel)
286 .addComponent(pageLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
287 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
288 .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
290 .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
291 .addContainerGap(383, Short.MAX_VALUE))
292 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
293 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
294 .addContainerGap(280, Short.MAX_VALUE)
295 .addComponent(artifactLabel)
296 .addContainerGap(84, Short.MAX_VALUE)))
298 jPanel1Layout.setVerticalGroup(
299 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
300 .addGroup(jPanel1Layout.createSequentialGroup()
301 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
302 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
303 .addComponent(pageLabel)
304 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
305 .addComponent(ofLabel)
306 .addComponent(totalPageLabel))
307 .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
308 .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
309 .addComponent(pageLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
310 .addContainerGap(35, Short.MAX_VALUE))
311 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
312 .addGroup(jPanel1Layout.createSequentialGroup()
313 .addComponent(artifactLabel)
314 .addGap(0, 58, Short.MAX_VALUE)))
317 jScrollPane1.setViewportView(jPanel1);
319 resultsTableScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
320 resultsTableScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
321 resultsTableScrollPane.setPreferredSize(
new java.awt.Dimension(620, 34));
323 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
324 this.setLayout(layout);
325 layout.setHorizontalGroup(
326 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
327 .addComponent(jScrollPane1)
328 .addComponent(resultsTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
330 layout.setVerticalGroup(
331 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
332 .addGroup(layout.createSequentialGroup()
333 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
334 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
335 .addComponent(resultsTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
340 currentPage = currentPage + 1;
341 currentPageLabel.setText(Integer.toString(currentPage));
342 artifactLabel.setText(artifactTableContents.get(currentPage - 1).getArtifactDisplayName());
347 currentPage = currentPage - 1;
348 currentPageLabel.setText(Integer.toString(currentPage));
349 artifactLabel.setText(artifactTableContents.get(currentPage - 1).getArtifactDisplayName());
372 resultsTable.setComponentPopupMenu(rightClickMenu);
373 ActionListener actList =
new ActionListener() {
375 public void actionPerformed(ActionEvent e) {
376 JMenuItem jmi = (JMenuItem) e.getSource();
377 if (jmi.equals(copyMenuItem)) {
378 StringBuilder selectedText =
new StringBuilder(512);
379 for (
int row : resultsTable.getSelectedRows()) {
380 for (
int col : resultsTable.getSelectedColumns()) {
381 selectedText.append((String) resultsTable.getValueAt(row, col));
382 selectedText.append(
"\t");
385 if (row != resultsTable.getSelectedRows()[resultsTable.getSelectedRows().length - 1]) {
386 selectedText.append(System.lineSeparator());
389 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
new StringSelection(selectedText.toString()), null);
390 }
else if (jmi.equals(selectAllMenuItem)) {
391 resultsTable.selectAll();
395 copyMenuItem.addActionListener(actList);
397 selectAllMenuItem.addActionListener(actList);
405 currentPageLabel.setText(
"");
406 artifactLabel.setText(
"");
407 totalPageLabel.setText(
"");
408 ((DefaultTableModel) resultsTable.getModel()).setRowCount(0);
409 prevPageButton.setEnabled(
false);
410 nextPageButton.setEnabled(
false);
416 if (currentNode == selectedNode) {
419 currentNode = selectedNode;
422 if (selectedNode == null) {
427 Lookup lookup = selectedNode.getLookup();
428 Content content = lookup.lookup(Content.class);
429 if (content == null) {
438 return NbBundle.getMessage(this.getClass(),
"DataContentViewerArtifact.title");
443 return NbBundle.getMessage(this.getClass(),
"DataContentViewerArtifact.toolTip");
467 for (Content content : node.getLookup().lookupAll(Content.class)) {
468 if ( (content != null) && (!(content instanceof BlackboardArtifact)) ){
470 return content.getAllArtifactsCount() > 0;
471 }
catch (TskException ex) {
472 logger.log(Level.SEVERE,
"Couldn't get count of BlackboardArtifacts for content", ex);
481 BlackboardArtifact artifact = node.getLookup().lookup(BlackboardArtifact.class);
485 if ((artifact == null)
486 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID())
487 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID())
488 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID())
489 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_OBJECT_DETECTED.getTypeID())
490 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID())) {
503 private final SimpleDateFormat dateFormatter =
new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
504 private String[][] rowData = null;
509 artifactDisplayName = artifact.getDisplayName();
510 this.content = content;
515 artifactDisplayName = errorMsg;
516 rowData =
new String[1][3];
517 rowData[0] =
new String[]{
"", errorMsg,
""};
525 private void addRows(BlackboardArtifact artifact) {
526 List<String[]> rowsToAdd =
new ArrayList<>();
531 for (BlackboardAttribute attr : artifact.getAttributes()) {
536 switch (attr.getAttributeType().getValueType()) {
543 value = attr.getDisplayString();
547 long epoch = attr.getValueLong();
548 value =
"0000-00-00 00:00:00";
549 if (null != content && 0 != epoch) {
551 value = dateFormatter.format(
new java.util.Date(epoch * 1000));
558 String sources = StringUtils.join(attr.getSources(),
", ");
559 rowsToAdd.add(
new String[]{attr.getAttributeType().getDisplayName(), value, sources});
566 if (null != content) {
567 path = content.getUniquePath();
569 }
catch (TskCoreException ex) {
570 logger.log(Level.SEVERE, String.format(
"Error getting source content path for artifact (artifact_id=%d, obj_id=%d)", artifact.getArtifactID(), artifact.getObjectID()), ex);
571 path = Bundle.DataContentViewerArtifact_failedToGetSourcePath_message();
573 rowsToAdd.add(
new String[]{
"Source File Path", path,
""});
577 rowsToAdd.add(
new String[]{
"Artifact ID", Long.toString(artifact.getArtifactID()),
""});
578 }
catch (TskCoreException ex) {
579 rowsToAdd.add(
new String[]{
"", Bundle.DataContentViewerArtifact_failedToGetAttributes_message(),
""});
581 rowData = rowsToAdd.toArray(
new String[0][0]);
587 String getArtifactDisplayName() {
588 return artifactDisplayName;
603 this.currentPage = currentPage;
604 this.numberOfPages = numberOfPages;
605 this.tableContents = contents;
608 ViewUpdate(
int numberOfPages,
int currentPage, String errorMsg) {
609 this.currentPage = currentPage;
610 this.numberOfPages = numberOfPages;
623 this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
625 nextPageButton.setEnabled(viewUpdate.currentPage < viewUpdate.numberOfPages);
626 prevPageButton.setEnabled(viewUpdate.currentPage > 1);
627 currentPage = viewUpdate.currentPage;
628 totalPageLabel.setText(Integer.toString(viewUpdate.numberOfPages));
629 currentPageLabel.setText(Integer.toString(currentPage));
630 artifactLabel.setText(viewUpdate.tableContents.getArtifactDisplayName());
631 DefaultTableModel tModel = ((DefaultTableModel) resultsTable.getModel());
632 tModel.setDataVector(viewUpdate.tableContents.
getRows(), COLUMN_HEADERS);
635 resultsTable.clearSelection();
637 this.setCursor(null);
646 private synchronized void startNewTask(SwingWorker<ViewUpdate, Void> task) {
647 String[][] waitRow =
new String[1][3];
648 waitRow[0] =
new String[]{
"", WAIT_TEXT,
""};
649 DefaultTableModel tModel = ((DefaultTableModel) resultsTable.getModel());
650 tModel.setDataVector(waitRow, COLUMN_HEADERS);
653 resultsTable.clearSelection();
655 if (currentTask != null) {
658 currentTask.cancel(
false);
663 currentTask.execute();
673 synchronized (lock) {
674 this.artifactTableContents = artifactList;
684 synchronized (lock) {
685 return artifactTableContents;
699 this.selectedNode = selectedNode;
706 Lookup lookup = selectedNode.getLookup();
709 ArrayList<BlackboardArtifact> artifacts =
new ArrayList<>();
710 Collection<? extends Content> contents = lookup.lookupAll(Content.class);
711 if (contents.isEmpty()) {
712 return new ViewUpdate(getArtifactContents().size(), currentPage, ERROR_TEXT);
714 Content underlyingContent = null;
715 for (Content content : contents) {
716 if ( (content != null) && (!(content instanceof BlackboardArtifact)) ) {
720 artifacts = content.getAllArtifacts();
721 underlyingContent = content;
723 }
catch (TskException ex) {
724 logger.log(Level.SEVERE,
"Couldn't get artifacts", ex);
725 return new ViewUpdate(getArtifactContents().size(), currentPage, ERROR_TEXT);
735 ArrayList<ResultsTableArtifact> artifactContents =
new ArrayList<>();
736 for (BlackboardArtifact artifact : artifacts) {
743 BlackboardArtifact artifact = lookup.lookup(BlackboardArtifact.class);
744 if (artifact != null) {
745 index = artifacts.indexOf(artifact);
751 for (BlackboardAttribute attr : artifact.getAttributes()) {
752 if (attr.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
753 long assocArtifactId = attr.getValueLong();
754 int assocArtifactIndex = -1;
755 for (BlackboardArtifact art : artifacts) {
756 if (assocArtifactId == art.getArtifactID()) {
757 assocArtifactIndex = artifacts.indexOf(art);
761 if (assocArtifactIndex >= 0) {
762 index = assocArtifactIndex;
767 }
catch (TskCoreException ex) {
768 logger.log(Level.WARNING,
"Couldn't get associated artifact to display in Content Viewer.", ex);
779 ViewUpdate viewUpdate =
new ViewUpdate(artifactContents.size(), index + 1, artifactContents.get(index));
787 setArtifactContents(artifactContents);
794 if (!isCancelled()) {
797 if (viewUpdate != null) {
798 updateView(viewUpdate);
800 }
catch (InterruptedException | ExecutionException ex) {
801 logger.log(Level.WARNING,
"Artifact display task unexpectedly interrupted or failed", ex);
817 this.pageIndex = pageIndex;
824 List<ResultsTableArtifact> artifactContents = getArtifactContents();
832 return new ViewUpdate(artifactContents.size(), pageIndex, artifactContent);
837 if (!isCancelled()) {
840 if (viewUpdate != null) {
841 updateView(viewUpdate);
843 }
catch (InterruptedException | ExecutionException ex) {
844 logger.log(Level.WARNING,
"Artifact display task unexpectedly interrupted or failed", ex);
857 javax.swing.JTextArea jtex =
new javax.swing.JTextArea();
858 if (value instanceof String) {
859 jtex.setText((String) value);
860 jtex.setLineWrap(
true);
861 jtex.setWrapStyleWord(
false);
865 jtex.setBackground(javax.swing.UIManager.getColor(
"Table.selectionBackground"));
867 jtex.setBackground(javax.swing.UIManager.getColor(
"Table.background"));
javax.swing.JPopupMenu rightClickMenu
void prevPageButtonActionPerformed(java.awt.event.ActionEvent evt)
javax.swing.JScrollPane jScrollPane1
javax.swing.JLabel pageLabel
synchronized void startNewTask(SwingWorker< ViewUpdate, Void > task)
javax.swing.JPanel jPanel1
javax.swing.JLabel artifactLabel
javax.swing.JButton nextPageButton
void setArtifactContents(List< ResultsTableArtifact > artifactList)
void nextPageButtonActionPerformed(java.awt.event.ActionEvent evt)
DataContentViewerArtifact()
List< ResultsTableArtifact > artifactTableContents
javax.swing.JScrollPane resultsTableScrollPane
ViewUpdate doInBackground()
void updateView(ViewUpdate viewUpdate)
static TimeZone getTimeZone(Content content)
List< ResultsTableArtifact > getArtifactContents()
void setNode(Node selectedNode)
javax.swing.JMenuItem copyMenuItem
javax.swing.JLabel totalPageLabel
javax.swing.JButton prevPageButton
final String artifactDisplayName
javax.swing.JMenuItem selectAllMenuItem
Component getTableCellRendererComponent(javax.swing.JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
javax.swing.JLabel pageLabel2
javax.swing.JLabel ofLabel
DataContentViewer createInstance()
synchronized static Logger getLogger(String name)
ViewUpdate doInBackground()
boolean isSupported(Node node)
void addRows(BlackboardArtifact artifact)
int isPreferred(Node node)
void customizeComponents()
javax.swing.JLabel currentPageLabel