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.SwingWorker;
36 import javax.swing.event.ChangeEvent;
37 import javax.swing.event.ListSelectionEvent;
38 import javax.swing.event.TableColumnModelEvent;
39 import javax.swing.table.DefaultTableModel;
40 import javax.swing.table.TableColumn;
41 import javax.swing.event.TableColumnModelListener;
42 import javax.swing.text.JTextComponent;
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 = 3)
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;
93 resultsTableScrollPane.setViewportView(resultsTable);
94 customizeComponents();
100 resultsTable =
new ETable();
101 resultsTable.setModel(
new javax.swing.table.DefaultTableModel() {
102 private static final long serialVersionUID = 1L;
104 public boolean isCellEditable(
int rowIndex,
int columnIndex) {
108 resultsTable.setCellSelectionEnabled(
true);
109 resultsTable.getTableHeader().setReorderingAllowed(
false);
110 resultsTable.setColumnHidingAllowed(
false);
111 resultsTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
112 resultsTable.getColumnModel().addColumnModelListener(
new TableColumnModelListener() {
115 public void columnAdded(TableColumnModelEvent e) {
119 public void columnRemoved(TableColumnModelEvent e) {
123 public void columnMoved(TableColumnModelEvent e) {
128 public void columnMarginChanged(ChangeEvent e) {
133 public void columnSelectionChanged(ListSelectionEvent e) {
136 resultsTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_NEXT_COLUMN);
144 int valueColIndex = -1;
145 for (
int col = 0; col < resultsTable.getColumnCount(); col++) {
146 if (resultsTable.getColumnName(col).equals(COLUMN_HEADERS[1])) {
150 if (valueColIndex != -1) {
151 for (
int row = 0; row < resultsTable.getRowCount(); row++) {
152 Component comp = resultsTable.prepareRenderer(
153 resultsTable.getCellRenderer(row, valueColIndex), row, valueColIndex);
155 if (comp instanceof JTextComponent) {
156 final JTextComponent tc = (JTextComponent) comp;
157 final View rootView = tc.getUI().getRootView(tc);
158 java.awt.Insets i = tc.getInsets(null);
159 rootView.setSize(resultsTable.getColumnModel().getColumn(valueColIndex)
160 .getPreferredWidth() - i.left - i.right,
162 rowHeight = (int) rootView.getPreferredSpan(View.Y_AXIS);
164 rowHeight = comp.getPreferredSize().height;
167 resultsTable.setRowHeight(row, rowHeight + CELL_BOTTOM_MARGIN);
177 Enumeration<TableColumn> columns = resultsTable.getColumnModel().getColumns();
178 while (columns.hasMoreElements()) {
179 TableColumn col = columns.nextElement();
180 if (col.getHeaderValue().equals(COLUMN_HEADERS[0])) {
181 col.setPreferredWidth(COLUMN_WIDTHS[0]);
182 }
else if (col.getHeaderValue().equals(COLUMN_HEADERS[1])) {
183 col.setPreferredWidth(COLUMN_WIDTHS[1]);
184 }
else if (col.getHeaderValue().equals(COLUMN_HEADERS[2])) {
185 col.setPreferredWidth(COLUMN_WIDTHS[2]);
195 @SuppressWarnings(
"unchecked")
197 private
void initComponents() {
199 rightClickMenu =
new javax.swing.JPopupMenu();
200 copyMenuItem =
new javax.swing.JMenuItem();
201 selectAllMenuItem =
new javax.swing.JMenuItem();
202 jPanel1 =
new javax.swing.JPanel();
203 totalPageLabel =
new javax.swing.JLabel();
204 ofLabel =
new javax.swing.JLabel();
205 currentPageLabel =
new javax.swing.JLabel();
206 pageLabel =
new javax.swing.JLabel();
207 nextPageButton =
new javax.swing.JButton();
208 pageLabel2 =
new javax.swing.JLabel();
209 prevPageButton =
new javax.swing.JButton();
210 resultsTableScrollPane =
new javax.swing.JScrollPane();
211 artifactLabel =
new javax.swing.JLabel();
213 copyMenuItem.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.copyMenuItem.text"));
214 rightClickMenu.add(copyMenuItem);
216 selectAllMenuItem.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.selectAllMenuItem.text"));
217 rightClickMenu.add(selectAllMenuItem);
219 setPreferredSize(
new java.awt.Dimension(622, 58));
221 jPanel1.setPreferredSize(
new java.awt.Dimension(620, 58));
223 totalPageLabel.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.totalPageLabel.text"));
227 currentPageLabel.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.currentPageLabel.text"));
228 currentPageLabel.setMaximumSize(
new java.awt.Dimension(18, 14));
229 currentPageLabel.setMinimumSize(
new java.awt.Dimension(18, 14));
230 currentPageLabel.setPreferredSize(
new java.awt.Dimension(18, 14));
233 pageLabel.setMaximumSize(
new java.awt.Dimension(33, 14));
234 pageLabel.setMinimumSize(
new java.awt.Dimension(33, 14));
235 pageLabel.setPreferredSize(
new java.awt.Dimension(33, 14));
237 nextPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png")));
238 nextPageButton.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.nextPageButton.text"));
239 nextPageButton.setBorderPainted(
false);
240 nextPageButton.setContentAreaFilled(
false);
241 nextPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png")));
242 nextPageButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
243 nextPageButton.setPreferredSize(
new java.awt.Dimension(23, 23));
244 nextPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png")));
245 nextPageButton.addActionListener(
new java.awt.event.ActionListener() {
246 public void actionPerformed(java.awt.event.ActionEvent evt) {
247 nextPageButtonActionPerformed(evt);
252 pageLabel2.setMaximumSize(
new java.awt.Dimension(29, 14));
253 pageLabel2.setMinimumSize(
new java.awt.Dimension(29, 14));
254 pageLabel2.setPreferredSize(
new java.awt.Dimension(29, 14));
256 prevPageButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back.png")));
257 prevPageButton.setText(
org.openide.util.NbBundle.getMessage(
DataContentViewerArtifact.class,
"DataContentViewerArtifact.prevPageButton.text"));
258 prevPageButton.setBorderPainted(
false);
259 prevPageButton.setContentAreaFilled(
false);
260 prevPageButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png")));
261 prevPageButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
262 prevPageButton.setPreferredSize(
new java.awt.Dimension(23, 23));
263 prevPageButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png")));
264 prevPageButton.addActionListener(
new java.awt.event.ActionListener() {
265 public void actionPerformed(java.awt.event.ActionEvent evt) {
266 prevPageButtonActionPerformed(evt);
270 resultsTableScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
271 resultsTableScrollPane.setPreferredSize(
new java.awt.Dimension(620, 34));
273 javax.swing.GroupLayout jPanel1Layout =
new javax.swing.GroupLayout(jPanel1);
274 jPanel1.setLayout(jPanel1Layout);
275 jPanel1Layout.setHorizontalGroup(
276 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
277 .addGroup(jPanel1Layout.createSequentialGroup()
279 .addComponent(pageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
280 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
281 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
282 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
283 .addComponent(ofLabel)
284 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
285 .addComponent(totalPageLabel)
287 .addComponent(pageLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
288 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
289 .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
291 .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
292 .addContainerGap(366, Short.MAX_VALUE))
293 .addComponent(resultsTableScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
294 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
295 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
296 .addContainerGap(280, Short.MAX_VALUE)
297 .addComponent(artifactLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE)
298 .addContainerGap(84, Short.MAX_VALUE)))
300 jPanel1Layout.setVerticalGroup(
301 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
302 .addGroup(jPanel1Layout.createSequentialGroup()
303 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
304 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
305 .addComponent(pageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
306 .addComponent(currentPageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
307 .addComponent(ofLabel)
308 .addComponent(totalPageLabel))
309 .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
310 .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
311 .addComponent(pageLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
312 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
313 .addComponent(resultsTableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)
315 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
316 .addGroup(jPanel1Layout.createSequentialGroup()
317 .addComponent(artifactLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
318 .addGap(0, 401, Short.MAX_VALUE)))
321 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
322 this.setLayout(layout);
323 layout.setHorizontalGroup(
324 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
325 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 622, Short.MAX_VALUE)
327 layout.setVerticalGroup(
328 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
329 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
334 currentPage = currentPage + 1;
335 currentPageLabel.setText(Integer.toString(currentPage));
336 artifactLabel.setText(artifactTableContents.get(currentPage - 1).getArtifactDisplayName());
341 currentPage = currentPage - 1;
342 currentPageLabel.setText(Integer.toString(currentPage));
343 artifactLabel.setText(artifactTableContents.get(currentPage - 1).getArtifactDisplayName());
365 resultsTable.setComponentPopupMenu(rightClickMenu);
366 ActionListener actList =
new ActionListener() {
368 public void actionPerformed(ActionEvent e) {
369 JMenuItem jmi = (JMenuItem) e.getSource();
370 if (jmi.equals(copyMenuItem)) {
371 StringBuilder selectedText =
new StringBuilder(512);
372 for (
int row : resultsTable.getSelectedRows()) {
373 for (
int col : resultsTable.getSelectedColumns()) {
374 selectedText.append((String) resultsTable.getValueAt(row, col));
375 selectedText.append(
"\t");
378 if (row != resultsTable.getSelectedRows()[resultsTable.getSelectedRows().length - 1]) {
379 selectedText.append(System.lineSeparator());
382 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
new StringSelection(selectedText.toString()), null);
383 }
else if (jmi.equals(selectAllMenuItem)) {
384 resultsTable.selectAll();
388 copyMenuItem.addActionListener(actList);
390 selectAllMenuItem.addActionListener(actList);
398 currentPageLabel.setText(
"");
399 artifactLabel.setText(
"");
400 totalPageLabel.setText(
"");
401 ((DefaultTableModel) resultsTable.getModel()).setRowCount(0);
402 prevPageButton.setEnabled(
false);
403 nextPageButton.setEnabled(
false);
409 if (currentNode == selectedNode) {
412 currentNode = selectedNode;
415 if (selectedNode == null) {
420 Lookup lookup = selectedNode.getLookup();
421 Content content = lookup.lookup(Content.class);
422 if (content == null) {
431 return NbBundle.getMessage(this.getClass(),
"DataContentViewerArtifact.title");
436 return NbBundle.getMessage(this.getClass(),
"DataContentViewerArtifact.toolTip");
460 for (Content content : node.getLookup().lookupAll(Content.class)) {
461 if ( (content != null) && (!(content instanceof BlackboardArtifact)) ){
463 return content.getAllArtifactsCount() > 0;
464 }
catch (TskException ex) {
465 logger.log(Level.SEVERE,
"Couldn't get count of BlackboardArtifacts for content", ex);
474 BlackboardArtifact artifact = node.getLookup().lookup(BlackboardArtifact.class);
478 if ((artifact == null)
479 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID())
480 || (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID())) {
493 private final SimpleDateFormat dateFormatter =
new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
494 private String[][] rowData = null;
499 artifactDisplayName = artifact.getDisplayName();
500 this.content = content;
505 artifactDisplayName = errorMsg;
506 rowData =
new String[1][3];
507 rowData[0] =
new String[]{
"", errorMsg,
""};
515 private void addRows(BlackboardArtifact artifact) {
516 List<String[]> rowsToAdd =
new ArrayList<>();
521 for (BlackboardAttribute attr : artifact.getAttributes()) {
526 switch (attr.getAttributeType().getValueType()) {
533 value = attr.getDisplayString();
537 long epoch = attr.getValueLong();
538 value =
"0000-00-00 00:00:00";
539 if (null != content && 0 != epoch) {
541 value = dateFormatter.format(
new java.util.Date(epoch * 1000));
548 String sources = StringUtils.join(attr.getSources(),
", ");
549 rowsToAdd.add(
new String[]{attr.getAttributeType().getDisplayName(), value, sources});
556 if (null != content) {
557 path = content.getUniquePath();
559 }
catch (TskCoreException ex) {
560 logger.log(Level.SEVERE, String.format(
"Error getting source content path for artifact (artifact_id=%d, obj_id=%d)", artifact.getArtifactID(), artifact.getObjectID()), ex);
561 path = Bundle.DataContentViewerArtifact_failedToGetSourcePath_message();
563 rowsToAdd.add(
new String[]{
"Source File Path", path,
""});
567 rowsToAdd.add(
new String[]{
"Artifact ID", Long.toString(artifact.getArtifactID()),
""});
568 }
catch (TskCoreException ex) {
569 rowsToAdd.add(
new String[]{
"", Bundle.DataContentViewerArtifact_failedToGetAttributes_message(),
""});
571 rowData = rowsToAdd.toArray(
new String[0][0]);
577 String getArtifactDisplayName() {
578 return artifactDisplayName;
593 this.currentPage = currentPage;
594 this.numberOfPages = numberOfPages;
595 this.tableContents = contents;
598 ViewUpdate(
int numberOfPages,
int currentPage, String errorMsg) {
599 this.currentPage = currentPage;
600 this.numberOfPages = numberOfPages;
613 this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
615 nextPageButton.setEnabled(viewUpdate.currentPage < viewUpdate.numberOfPages);
616 prevPageButton.setEnabled(viewUpdate.currentPage > 1);
617 currentPage = viewUpdate.currentPage;
618 totalPageLabel.setText(Integer.toString(viewUpdate.numberOfPages));
619 currentPageLabel.setText(Integer.toString(currentPage));
620 artifactLabel.setText(viewUpdate.tableContents.getArtifactDisplayName());
621 DefaultTableModel tModel = ((DefaultTableModel) resultsTable.getModel());
622 tModel.setDataVector(viewUpdate.tableContents.
getRows(), COLUMN_HEADERS);
625 resultsTable.clearSelection();
627 this.setCursor(null);
636 private synchronized void startNewTask(SwingWorker<ViewUpdate, Void> task) {
637 String[][] waitRow =
new String[1][3];
638 waitRow[0] =
new String[]{
"", WAIT_TEXT,
""};
639 DefaultTableModel tModel = ((DefaultTableModel) resultsTable.getModel());
640 tModel.setDataVector(waitRow, COLUMN_HEADERS);
643 resultsTable.clearSelection();
645 if (currentTask != null) {
648 currentTask.cancel(
false);
653 currentTask.execute();
663 synchronized (lock) {
664 this.artifactTableContents = artifactList;
674 synchronized (lock) {
675 return artifactTableContents;
689 this.selectedNode = selectedNode;
696 Lookup lookup = selectedNode.getLookup();
699 ArrayList<BlackboardArtifact> artifacts =
new ArrayList<>();
700 Collection<? extends Content> contents = lookup.lookupAll(Content.class);
701 if (contents.isEmpty()) {
702 return new ViewUpdate(getArtifactContents().size(), currentPage, ERROR_TEXT);
704 Content underlyingContent = null;
705 for (Content content : contents) {
706 if ( (content != null) && (!(content instanceof BlackboardArtifact)) ) {
710 artifacts = content.getAllArtifacts();
711 underlyingContent = content;
713 }
catch (TskException ex) {
714 logger.log(Level.SEVERE,
"Couldn't get artifacts", ex);
715 return new ViewUpdate(getArtifactContents().size(), currentPage, ERROR_TEXT);
725 ArrayList<ResultsTableArtifact> artifactContents =
new ArrayList<>();
726 for (BlackboardArtifact artifact : artifacts) {
733 BlackboardArtifact artifact = lookup.lookup(BlackboardArtifact.class);
734 if (artifact != null) {
735 index = artifacts.indexOf(artifact);
741 for (BlackboardAttribute attr : artifact.getAttributes()) {
742 if (attr.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) {
743 long assocArtifactId = attr.getValueLong();
744 int assocArtifactIndex = -1;
745 for (BlackboardArtifact art : artifacts) {
746 if (assocArtifactId == art.getArtifactID()) {
747 assocArtifactIndex = artifacts.indexOf(art);
751 if (assocArtifactIndex >= 0) {
752 index = assocArtifactIndex;
757 }
catch (TskCoreException ex) {
758 logger.log(Level.WARNING,
"Couldn't get associated artifact to display in Content Viewer.", ex);
769 ViewUpdate viewUpdate =
new ViewUpdate(artifactContents.size(), index + 1, artifactContents.get(index));
777 setArtifactContents(artifactContents);
784 if (!isCancelled()) {
787 if (viewUpdate != null) {
788 updateView(viewUpdate);
790 }
catch (InterruptedException | ExecutionException ex) {
791 logger.log(Level.WARNING,
"Artifact display task unexpectedly interrupted or failed", ex);
807 this.pageIndex = pageIndex;
814 List<ResultsTableArtifact> artifactContents = getArtifactContents();
822 return new ViewUpdate(artifactContents.size(), pageIndex, artifactContent);
827 if (!isCancelled()) {
830 if (viewUpdate != null) {
831 updateView(viewUpdate);
833 }
catch (InterruptedException | ExecutionException ex) {
834 logger.log(Level.WARNING,
"Artifact display task unexpectedly interrupted or failed", ex);
847 javax.swing.JTextArea jtex =
new javax.swing.JTextArea();
848 if (value instanceof String) {
849 jtex.setText((String) value);
850 jtex.setLineWrap(
true);
851 jtex.setWrapStyleWord(
true);
855 jtex.setBackground(javax.swing.UIManager.getColor(
"Table.selectionBackground"));
857 jtex.setBackground(javax.swing.UIManager.getColor(
"Table.background"));
javax.swing.JPopupMenu rightClickMenu
void prevPageButtonActionPerformed(java.awt.event.ActionEvent evt)
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)
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)
static TimeZone getTimeZone(Content c)
ViewUpdate doInBackground()
boolean isSupported(Node node)
void addRows(BlackboardArtifact artifact)
int isPreferred(Node node)
void customizeComponents()
javax.swing.JLabel currentPageLabel