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)
69 "DataContentViewerArtifact.attrsTableHeader.type=Type",
70 "DataContentViewerArtifact.attrsTableHeader.value=Value",
71 "DataContentViewerArtifact.attrsTableHeader.sources=Source(s)",
72 "DataContentViewerArtifact.failedToGetSourcePath.message=Failed to get source file path from case database",
73 "DataContentViewerArtifact.failedToGetAttributes.message=Failed to get some or all attributes from case database"
77 private final static String ERROR_TEXT = NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.errorText");
79 private int currentPage = 1;
80 private final Object lock =
new Object();
82 SwingWorker<ViewUpdate, Void> currentTask;
83 private static final String[] COLUMN_HEADERS = {
84 Bundle.DataContentViewerArtifact_attrsTableHeader_type(),
85 Bundle.DataContentViewerArtifact_attrsTableHeader_value(),
86 Bundle.DataContentViewerArtifact_attrsTableHeader_sources()};
87 private static final int[] COLUMN_WIDTHS = {100, 800, 100};
88 private static final int CELL_BOTTOM_MARGIN = 5;
89 private static final int CELL_RIGHT_MARGIN = 1;
94 resultsTableScrollPane.setViewportView(resultsTable);
95 customizeComponents();
101 resultsTable =
new ETable();
102 resultsTable.setModel(
new javax.swing.table.DefaultTableModel() {
103 private static final long serialVersionUID = 1L;
105 public boolean isCellEditable(
int rowIndex,
int columnIndex) {
109 resultsTable.setCellSelectionEnabled(
true);
110 resultsTable.getTableHeader().setReorderingAllowed(
false);
111 resultsTable.setColumnHidingAllowed(
false);
112 resultsTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
113 resultsTable.getColumnModel().addColumnModelListener(
new TableColumnModelListener() {
116 public void columnAdded(TableColumnModelEvent e) {
120 public void columnRemoved(TableColumnModelEvent e) {
124 public void columnMoved(TableColumnModelEvent e) {
129 public void columnMarginChanged(ChangeEvent e) {
134 public void columnSelectionChanged(ListSelectionEvent e) {
137 resultsTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN);
145 int valueColIndex = -1;
146 for (
int col = 0; col < resultsTable.getColumnCount(); col++) {
147 if (resultsTable.getColumnName(col).equals(COLUMN_HEADERS[1])) {
151 if (valueColIndex != -1) {
152 for (
int row = 0; row < resultsTable.getRowCount(); row++) {
153 Component comp = resultsTable.prepareRenderer(
154 resultsTable.getCellRenderer(row, valueColIndex), row, valueColIndex);
156 if (comp instanceof JTextArea) {
157 final JTextArea tc = (JTextArea) comp;
158 final View rootView = tc.getUI().getRootView(tc);
159 java.awt.Insets i = tc.getInsets();
160 rootView.setSize(resultsTable.getColumnModel().getColumn(valueColIndex)
161 .getWidth() - (i.left + i.right +CELL_RIGHT_MARGIN),
163 rowHeight = (int) rootView.getPreferredSpan(View.Y_AXIS);
165 rowHeight = comp.getPreferredSize().height;
168 resultsTable.setRowHeight(row, rowHeight + CELL_BOTTOM_MARGIN);
178 Enumeration<TableColumn> columns = resultsTable.getColumnModel().getColumns();
179 while (columns.hasMoreElements()) {
180 TableColumn col = columns.nextElement();
181 if (col.getHeaderValue().equals(COLUMN_HEADERS[0])) {
182 col.setPreferredWidth(COLUMN_WIDTHS[0]);
183 }
else if (col.getHeaderValue().equals(COLUMN_HEADERS[1])) {
184 col.setPreferredWidth(COLUMN_WIDTHS[1]);
185 }
else if (col.getHeaderValue().equals(COLUMN_HEADERS[2])) {
186 col.setPreferredWidth(COLUMN_WIDTHS[2]);
196 @SuppressWarnings(
"unchecked")
198 private
void initComponents() {
200 rightClickMenu =
new javax.swing.JPopupMenu();
201 copyMenuItem =
new javax.swing.JMenuItem();
202 selectAllMenuItem =
new javax.swing.JMenuItem();
203 jScrollPane1 =
new javax.swing.JScrollPane();
204 jPanel1 =
new javax.swing.JPanel();
205 totalPageLabel =
new javax.swing.JLabel();
206 ofLabel =
new javax.swing.JLabel();
207 currentPageLabel =
new javax.swing.JLabel();
208 pageLabel =
new javax.swing.JLabel();
209 nextPageButton =
new javax.swing.JButton();
210 pageLabel2 =
new javax.swing.JLabel();
211 prevPageButton =
new javax.swing.JButton();
212 artifactLabel =
new javax.swing.JLabel();
213 resultsTableScrollPane =
new javax.swing.JScrollPane();
215 copyMenuItem.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.copyMenuItem.text"));
216 rightClickMenu.add(copyMenuItem);
218 selectAllMenuItem.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.selectAllMenuItem.text"));
219 rightClickMenu.add(selectAllMenuItem);
221 setPreferredSize(
new java.awt.Dimension(100, 58));
223 jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
224 jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
226 jPanel1.setPreferredSize(
new java.awt.Dimension(620, 58));
228 totalPageLabel.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.totalPageLabel.text"));
232 currentPageLabel.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.currentPageLabel.text"));
233 currentPageLabel.setMaximumSize(
new java.awt.Dimension(18, 14));
234 currentPageLabel.setMinimumSize(
new java.awt.Dimension(18, 14));
235 currentPageLabel.setPreferredSize(
new java.awt.Dimension(18, 14));
239 nextPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png")));
240 nextPageButton.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.nextPageButton.text"));
241 nextPageButton.setBorderPainted(
false);
242 nextPageButton.setContentAreaFilled(
false);
243 nextPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png")));
244 nextPageButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
245 nextPageButton.setPreferredSize(
new java.awt.Dimension(23, 23));
246 nextPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png")));
247 nextPageButton.addActionListener(
new java.awt.event.ActionListener() {
248 public void actionPerformed(java.awt.event.ActionEvent evt) {
249 nextPageButtonActionPerformed(evt);
254 pageLabel2.setMaximumSize(
new java.awt.Dimension(29, 14));
255 pageLabel2.setMinimumSize(
new java.awt.Dimension(29, 14));
257 prevPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back.png")));
258 prevPageButton.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.prevPageButton.text"));
259 prevPageButton.setBorderPainted(
false);
260 prevPageButton.setContentAreaFilled(
false);
261 prevPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png")));
262 prevPageButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
263 prevPageButton.setPreferredSize(
new java.awt.Dimension(23, 23));
264 prevPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png")));
265 prevPageButton.addActionListener(
new java.awt.event.ActionListener() {
266 public void actionPerformed(java.awt.event.ActionEvent evt) {
267 prevPageButtonActionPerformed(evt);
271 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
272 jPanel1.setLayout(jPanel1Layout);
273 jPanel1Layout.setHorizontalGroup(
274 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
275 .addGroup(jPanel1Layout.createSequentialGroup()
277 .addComponent(pageLabel)
278 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
279 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
280 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
281 .addComponent(ofLabel)
282 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
283 .addComponent(totalPageLabel)
285 .addComponent(pageLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
286 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
287 .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
289 .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
290 .addContainerGap(383, Short.MAX_VALUE))
291 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
292 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
293 .addContainerGap(280, Short.MAX_VALUE)
294 .addComponent(artifactLabel)
295 .addContainerGap(84, Short.MAX_VALUE)))
297 jPanel1Layout.setVerticalGroup(
298 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
299 .addGroup(jPanel1Layout.createSequentialGroup()
300 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
301 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
302 .addComponent(pageLabel)
303 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
304 .addComponent(ofLabel)
305 .addComponent(totalPageLabel))
306 .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
307 .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
308 .addComponent(pageLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
309 .addContainerGap(35, Short.MAX_VALUE))
310 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
311 .addGroup(jPanel1Layout.createSequentialGroup()
312 .addComponent(artifactLabel)
313 .addGap(0, 58, Short.MAX_VALUE)))
316 jScrollPane1.setViewportView(jPanel1);
318 resultsTableScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
319 resultsTableScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
320 resultsTableScrollPane.setPreferredSize(
new java.awt.Dimension(620, 34));
322 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
323 this.setLayout(layout);
324 layout.setHorizontalGroup(
325 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
326 .addComponent(jScrollPane1)
327 .addComponent(resultsTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
329 layout.setVerticalGroup(
330 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
331 .addGroup(layout.createSequentialGroup()
332 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
333 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
334 .addComponent(resultsTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
339 currentPage = currentPage + 1;
340 currentPageLabel.setText(Integer.toString(currentPage));
341 artifactLabel.setText(artifactTableContents.get(currentPage - 1).getArtifactDisplayName());
346 currentPage = currentPage - 1;
347 currentPageLabel.setText(Integer.toString(currentPage));
348 artifactLabel.setText(artifactTableContents.get(currentPage - 1).getArtifactDisplayName());
371 resultsTable.setComponentPopupMenu(rightClickMenu);
372 ActionListener actList =
new ActionListener() {
374 public void actionPerformed(ActionEvent e) {
375 JMenuItem jmi = (JMenuItem) e.getSource();
376 if (jmi.equals(copyMenuItem)) {
377 StringBuilder selectedText =
new StringBuilder(512);
378 for (
int row : resultsTable.getSelectedRows()) {
379 for (
int col : resultsTable.getSelectedColumns()) {
380 selectedText.append((String) resultsTable.getValueAt(row, col));
381 selectedText.append(
"\t");
384 if (row != resultsTable.getSelectedRows()[resultsTable.getSelectedRows().length - 1]) {
385 selectedText.append(System.lineSeparator());
388 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
new StringSelection(selectedText.toString()), null);
389 }
else if (jmi.equals(selectAllMenuItem)) {
390 resultsTable.selectAll();
394 copyMenuItem.addActionListener(actList);
396 selectAllMenuItem.addActionListener(actList);
404 currentPageLabel.setText(
"");
405 artifactLabel.setText(
"");
406 totalPageLabel.setText(
"");
407 ((DefaultTableModel) resultsTable.getModel()).setRowCount(0);
408 prevPageButton.setEnabled(
false);
409 nextPageButton.setEnabled(
false);
415 if (currentNode == selectedNode) {
418 currentNode = selectedNode;
421 if (selectedNode == null) {
426 Lookup lookup = selectedNode.getLookup();
427 Content content = lookup.lookup(Content.class);
428 if (content == null) {
437 return NbBundle.getMessage(this.getClass(),
"DataContentViewerArtifact.title");
442 return NbBundle.getMessage(this.getClass(),
"DataContentViewerArtifact.toolTip");
466 for (Content content : node.getLookup().lookupAll(Content.class)) {
467 if ( (content != null) && (!(content instanceof BlackboardArtifact)) ){
469 return content.getAllArtifactsCount() > 0;
470 }
catch (TskException ex) {
471 logger.log(Level.SEVERE,
"Couldn't get count of BlackboardArtifacts for content", ex);
480 BlackboardArtifact artifact = node.getLookup().lookup(BlackboardArtifact.class);
484 if ((artifact == null)
485 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID())
486 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID())
487 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID())) {
500 private final SimpleDateFormat dateFormatter =
new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
501 private String[][] rowData = null;
506 artifactDisplayName = artifact.getDisplayName();
507 this.content = content;
512 artifactDisplayName = errorMsg;
513 rowData =
new String[1][3];
514 rowData[0] =
new String[]{
"", errorMsg,
""};
522 private void addRows(BlackboardArtifact artifact) {
523 List<String[]> rowsToAdd =
new ArrayList<>();
528 for (BlackboardAttribute attr : artifact.getAttributes()) {
533 switch (attr.getAttributeType().getValueType()) {
540 value = attr.getDisplayString();
544 long epoch = attr.getValueLong();
545 value =
"0000-00-00 00:00:00";
546 if (null != content && 0 != epoch) {
548 value = dateFormatter.format(
new java.util.Date(epoch * 1000));
555 String sources = StringUtils.join(attr.getSources(),
", ");
556 rowsToAdd.add(
new String[]{attr.getAttributeType().getDisplayName(), value, sources});
563 if (null != content) {
564 path = content.getUniquePath();
566 }
catch (TskCoreException ex) {
567 logger.log(Level.SEVERE, String.format(
"Error getting source content path for artifact (artifact_id=%d, obj_id=%d)", artifact.getArtifactID(), artifact.getObjectID()), ex);
568 path = Bundle.DataContentViewerArtifact_failedToGetSourcePath_message();
570 rowsToAdd.add(
new String[]{
"Source File Path", path,
""});
574 rowsToAdd.add(
new String[]{
"Artifact ID", Long.toString(artifact.getArtifactID()),
""});
575 }
catch (TskCoreException ex) {
576 rowsToAdd.add(
new String[]{
"", Bundle.DataContentViewerArtifact_failedToGetAttributes_message(),
""});
578 rowData = rowsToAdd.toArray(
new String[0][0]);
584 String getArtifactDisplayName() {
585 return artifactDisplayName;
600 this.currentPage = currentPage;
601 this.numberOfPages = numberOfPages;
602 this.tableContents = contents;
605 ViewUpdate(
int numberOfPages,
int currentPage, String errorMsg) {
606 this.currentPage = currentPage;
607 this.numberOfPages = numberOfPages;
620 this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
622 nextPageButton.setEnabled(viewUpdate.currentPage < viewUpdate.numberOfPages);
623 prevPageButton.setEnabled(viewUpdate.currentPage > 1);
624 currentPage = viewUpdate.currentPage;
625 totalPageLabel.setText(Integer.toString(viewUpdate.numberOfPages));
626 currentPageLabel.setText(Integer.toString(currentPage));
627 artifactLabel.setText(viewUpdate.tableContents.getArtifactDisplayName());
628 DefaultTableModel tModel = ((DefaultTableModel) resultsTable.getModel());
629 tModel.setDataVector(viewUpdate.tableContents.
getRows(), COLUMN_HEADERS);
632 resultsTable.clearSelection();
634 this.setCursor(null);
643 private synchronized void startNewTask(SwingWorker<ViewUpdate, Void> task) {
644 String[][] waitRow =
new String[1][3];
645 waitRow[0] =
new String[]{
"", WAIT_TEXT,
""};
646 DefaultTableModel tModel = ((DefaultTableModel) resultsTable.getModel());
647 tModel.setDataVector(waitRow, COLUMN_HEADERS);
650 resultsTable.clearSelection();
652 if (currentTask != null) {
655 currentTask.cancel(
false);
660 currentTask.execute();
670 synchronized (lock) {
671 this.artifactTableContents = artifactList;
681 synchronized (lock) {
682 return artifactTableContents;
696 this.selectedNode = selectedNode;
703 Lookup lookup = selectedNode.getLookup();
706 ArrayList<BlackboardArtifact> artifacts =
new ArrayList<>();
707 Collection<? extends Content> contents = lookup.lookupAll(Content.class);
708 if (contents.isEmpty()) {
709 return new ViewUpdate(getArtifactContents().size(), currentPage, ERROR_TEXT);
711 Content underlyingContent = null;
712 for (Content content : contents) {
713 if ( (content != null) && (!(content instanceof BlackboardArtifact)) ) {
717 artifacts = content.getAllArtifacts();
718 underlyingContent = content;
720 }
catch (TskException ex) {
721 logger.log(Level.SEVERE,
"Couldn't get artifacts", ex);
722 return new ViewUpdate(getArtifactContents().size(), currentPage, ERROR_TEXT);
732 ArrayList<ResultsTableArtifact> artifactContents =
new ArrayList<>();
733 for (BlackboardArtifact artifact : artifacts) {
740 BlackboardArtifact artifact = lookup.lookup(BlackboardArtifact.class);
741 if (artifact != null) {
742 index = artifacts.indexOf(artifact);
748 for (BlackboardAttribute attr : artifact.getAttributes()) {
749 if (attr.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
750 long assocArtifactId = attr.getValueLong();
751 int assocArtifactIndex = -1;
752 for (BlackboardArtifact art : artifacts) {
753 if (assocArtifactId == art.getArtifactID()) {
754 assocArtifactIndex = artifacts.indexOf(art);
758 if (assocArtifactIndex >= 0) {
759 index = assocArtifactIndex;
764 }
catch (TskCoreException ex) {
765 logger.log(Level.WARNING,
"Couldn't get associated artifact to display in Content Viewer.", ex);
776 ViewUpdate viewUpdate =
new ViewUpdate(artifactContents.size(), index + 1, artifactContents.get(index));
784 setArtifactContents(artifactContents);
791 if (!isCancelled()) {
794 if (viewUpdate != null) {
795 updateView(viewUpdate);
797 }
catch (InterruptedException | ExecutionException ex) {
798 logger.log(Level.WARNING,
"Artifact display task unexpectedly interrupted or failed", ex);
814 this.pageIndex = pageIndex;
821 List<ResultsTableArtifact> artifactContents = getArtifactContents();
829 return new ViewUpdate(artifactContents.size(), pageIndex, artifactContent);
834 if (!isCancelled()) {
837 if (viewUpdate != null) {
838 updateView(viewUpdate);
840 }
catch (InterruptedException | ExecutionException ex) {
841 logger.log(Level.WARNING,
"Artifact display task unexpectedly interrupted or failed", ex);
854 javax.swing.JTextArea jtex =
new javax.swing.JTextArea();
855 if (value instanceof String) {
856 jtex.setText((String) value);
857 jtex.setLineWrap(
true);
858 jtex.setWrapStyleWord(
false);
862 jtex.setBackground(javax.swing.UIManager.getColor(
"Table.selectionBackground"));
864 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