19 package org.sleuthkit.autopsy.contentviewers.artifactviewers;
21 import java.awt.Component;
22 import java.awt.Dimension;
23 import java.awt.GridBagConstraints;
24 import java.awt.GridBagLayout;
25 import java.awt.Insets;
26 import java.awt.Toolkit;
27 import java.awt.datatransfer.StringSelection;
28 import java.awt.event.ActionEvent;
29 import java.awt.event.ActionListener;
30 import java.util.ArrayList;
31 import java.util.Arrays;
32 import java.util.HashMap;
33 import java.util.List;
35 import java.util.Optional;
36 import java.util.logging.Level;
37 import javax.swing.JLabel;
38 import javax.swing.JMenuItem;
39 import javax.swing.JPopupMenu;
40 import javax.swing.JTextPane;
41 import javax.swing.SwingUtilities;
42 import javax.swing.border.EmptyBorder;
43 import org.apache.commons.lang.StringUtils;
44 import org.openide.util.NbBundle;
45 import org.openide.util.lookup.ServiceProvider;
61 @ServiceProvider(service = ArtifactContentViewer.class)
64 private static final long serialVersionUID = 1L;
67 private final static int MAX_COLS = 4;
68 private final static Insets ZERO_INSETS =
new java.awt.Insets(0, 0, 0, 0);
70 private final static Insets FIRST_HEADER_INSETS = ZERO_INSETS;
75 private final static double GLUE_WEIGHT_X = 1.0;
76 private final static double TEXT_WEIGHT_X = 0.0;
77 private final static int LABEL_COLUMN = 0;
78 private final static int VALUE_COLUMN = 1;
79 private final static int VALUE_WIDTH = 2;
80 private final static int LABEL_WIDTH = 1;
81 private static final Integer[] DEFAULT_ORDERING =
new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getTypeID(),
82 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
83 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
84 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
85 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_REFERRER.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID(),
86 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_VALUE.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT.getTypeID(),
87 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID(),
88 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_HEADERS.getTypeID()};
89 private static final List<Integer> TYPES_WITH_DATE_SECTION = Arrays.asList(
new Integer[]{BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()});
90 private final GridBagLayout gridBagLayout =
new GridBagLayout();
91 private final GridBagConstraints gridBagConstraints =
new GridBagConstraints();
92 private final Map<Integer, Integer[]> orderingMap =
new HashMap<>();
93 private final javax.swing.JPanel detailsPanel =
new javax.swing.JPanel();
102 gridBagConstraints.anchor = GridBagConstraints.FIRST_LINE_START;
103 detailsPanel.setLayout(gridBagLayout);
112 orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID(),
new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getTypeID(),
113 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE.getTypeID(),
114 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
115 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
116 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
117 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
118 orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID(),
new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
119 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
120 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
121 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
122 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_HEADERS.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(),
123 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
124 orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID(),
new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
125 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
126 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
127 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
128 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(),
129 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
130 orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID(),
new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT.getTypeID(),
131 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
132 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
133 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
134 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
135 orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID(),
new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE.getTypeID(),
136 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_USER_NAME.getTypeID(),
137 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(),
138 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID(),
139 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
140 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_REFERRER.getTypeID(),
141 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
142 orderingMap.put(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID(),
new Integer[]{BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(),
143 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL.getTypeID(),
144 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getTypeID(),
145 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_VALUE.getTypeID(),
146 BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID()});
150 @NbBundle.Messages({
"GeneralPurposeArtifactViewer.unknown.text=Unknown"})
154 if (artifact != null) {
155 String dataSourceName = Bundle.GeneralPurposeArtifactViewer_unknown_text();
156 String hostName = Bundle.GeneralPurposeArtifactViewer_unknown_text();
157 String sourceFileName = Bundle.GeneralPurposeArtifactViewer_unknown_text();
158 Map<Integer, List<BlackboardAttribute>> attributeMap =
new HashMap<>();
161 for (BlackboardAttribute bba : artifact.getAttributes()) {
162 List<BlackboardAttribute> attrList = attributeMap.get(bba.getAttributeType().getTypeID());
163 if (attrList == null) {
164 attrList =
new ArrayList<>();
167 attributeMap.put(bba.getAttributeType().getTypeID(), attrList);
169 dataSourceName = artifact.getDataSource().getName();
172 .map(h -> h.getName())
175 sourceFileName = artifact.getParent().getUniquePath();
177 logger.log(Level.WARNING,
"Unable to get attributes for artifact " + artifact.getArtifactID(), ex);
179 updateView(artifact, attributeMap, dataSourceName, hostName, sourceFileName);
181 detailsScrollPane.setViewportView(detailsPanel);
182 detailsScrollPane.revalidate();
190 private
void resetComponent() {
192 detailsPanel.removeAll();
193 detailsPanel.setLayout(gridBagLayout);
194 detailsPanel.revalidate();
195 gridBagConstraints.gridy = 0;
196 gridBagConstraints.gridx = LABEL_COLUMN;
197 gridBagConstraints.weighty = 0.0;
198 gridBagConstraints.weightx = TEXT_WEIGHT_X;
199 gridBagConstraints.fill = GridBagConstraints.NONE;
200 gridBagConstraints.insets = ZERO_INSETS;
206 return (artifact != null)
207 && (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID()
208 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()
209 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()
210 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID()
211 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()
212 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID()
213 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_ACCOUNT_TYPE.getTypeID()
214 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_ADDRESS.getTypeID()
215 || artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_AUTOFILL.getTypeID());
218 @NbBundle.Messages({
"GeneralPurposeArtifactViewer.details.attrHeader=Details",
219 "GeneralPurposeArtifactViewer.details.sourceHeader=Source",
220 "GeneralPurposeArtifactViewer.details.dataSource=Data Source",
221 "GeneralPurposeArtifactViewer_details_host=Host",
222 "GeneralPurposeArtifactViewer.details.file=File",
223 "GeneralPurposeArtifactViewer.details.datesHeader=Dates"})
229 @SuppressWarnings(
"unchecked")
233 detailsScrollPane =
new javax.swing.JScrollPane();
235 detailsScrollPane.setPreferredSize(
new java.awt.Dimension(300, 0));
237 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
238 this.setLayout(layout);
239 layout.setHorizontalGroup(
240 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
241 .addComponent(detailsScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
243 layout.setVerticalGroup(
244 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
245 .addGroup(layout.createSequentialGroup()
246 .addComponent(detailsScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
262 @NbBundle.Messages({
"GeneralPurposeArtifactViewer.dates.created=Created",
263 "GeneralPurposeArtifactViewer.dates.start=Start",
264 "GeneralPurposeArtifactViewer.dates.end=End",
265 "GeneralPurposeArtifactViewer.dates.time=Time",
266 "GeneralPurposeArtifactViewer.term.label=Term",
267 "GeneralPurposeArtifactViewer.details.otherHeader=Other",
268 "GeneralPurposeArtifactViewer.noFile.text= (no longer exists)"})
270 private void updateView(BlackboardArtifact artifact, Map<Integer, List<BlackboardAttribute>> attributeMap, String dataSourceName, String hostName, String sourceFilePath) {
271 final Integer artifactTypeId = artifact.getArtifactTypeID();
272 if (!(artifactTypeId < 1 || artifactTypeId >= Integer.MAX_VALUE)) {
273 JTextPane firstTextPane = addDetailsHeader(artifactTypeId);
274 Integer[] orderingArray = orderingMap.get(artifactTypeId);
275 if (orderingArray == null) {
276 orderingArray = DEFAULT_ORDERING;
278 for (Integer attrId : orderingArray) {
279 List<BlackboardAttribute> attrList = attributeMap.remove(attrId);
280 if (attrList != null) {
281 for (BlackboardAttribute bba : attrList) {
282 if (bba.getAttributeType().getTypeName().startsWith(
"TSK_DATETIME")) {
283 if (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()) {
288 }
else if (bba.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT.getTypeID() && artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()) {
289 addNameValueRow(Bundle.GeneralPurposeArtifactViewer_term_label(), bba.getDisplayString());
290 }
else if (bba.getAttributeType().getTypeID() == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID()) {
291 String displayString = bba.getDisplayString();
292 if (!attributeMap.containsKey(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID())) {
293 displayString += Bundle.GeneralPurposeArtifactViewer_noFile_text();
295 addNameValueRow(bba.getAttributeType().getDisplayName(), displayString);
297 addNameValueRow(bba.getAttributeType().getDisplayName(), bba.getDisplayString());
302 if (TYPES_WITH_DATE_SECTION.contains(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID())) {
303 boolean headerAdded =
false;
304 headerAdded = addDates(Bundle.GeneralPurposeArtifactViewer_dates_created(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID()), headerAdded);
305 headerAdded = addDates(Bundle.GeneralPurposeArtifactViewer_dates_start(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START.getTypeID()), headerAdded);
306 headerAdded = addDates(Bundle.GeneralPurposeArtifactViewer_dates_end(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_END.getTypeID()), headerAdded);
307 addDates(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getDisplayName(), attributeMap.remove(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID()), headerAdded);
309 if (!attributeMap.keySet().isEmpty()) {
310 addHeader(Bundle.GeneralPurposeArtifactViewer_details_otherHeader());
311 for (
int key : attributeMap.keySet()) {
312 for (BlackboardAttribute bba : attributeMap.get(key)) {
313 if (bba.getAttributeType().getTypeName().startsWith(
"TSK_DATETIME")) {
316 addNameValueRow(bba.getAttributeType().getDisplayName(), bba.getDisplayString());
321 addHeader(Bundle.GeneralPurposeArtifactViewer_details_sourceHeader());
322 addNameValueRow(Bundle.GeneralPurposeArtifactViewer_details_host(), StringUtils.defaultString(hostName));
323 addNameValueRow(Bundle.GeneralPurposeArtifactViewer_details_dataSource(), dataSourceName);
324 addNameValueRow(Bundle.GeneralPurposeArtifactViewer_details_file(), sourceFilePath);
327 if (firstTextPane != null) {
328 firstTextPane.setCaretPosition(0);
331 detailsPanel.revalidate();
344 private boolean addDates(String label, List<BlackboardAttribute> attrList,
boolean headerExists) {
345 boolean headerAdded = headerExists;
346 if (attrList != null) {
348 addHeader(Bundle.GeneralPurposeArtifactViewer_details_datesHeader());
351 String labelToUse = label;
352 for (BlackboardAttribute bba : attrList) {
353 if (StringUtils.isBlank(label)) {
354 labelToUse = bba.getAttributeType().getDisplayName();
356 addNameValueRow(labelToUse, bba.getDisplayString());
367 @NbBundle.Messages({
"GeneralPurposeArtifactViewer.details.bookmarkHeader=Bookmark Details",
368 "GeneralPurposeArtifactViewer.details.historyHeader=Visit Details",
369 "GeneralPurposeArtifactViewer.details.downloadHeader=Downloaded File",
370 "GeneralPurposeArtifactViewer.details.searchHeader=Web Search",
371 "GeneralPurposeArtifactViewer.details.cachedHeader=Cached File",
372 "GeneralPurposeArtifactViewer.details.cookieHeader=Cookie Details",})
375 if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID()) {
376 header = Bundle.GeneralPurposeArtifactViewer_details_historyHeader();
377 }
else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID()) {
378 header = Bundle.GeneralPurposeArtifactViewer_details_bookmarkHeader();
379 }
else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_CACHE.getTypeID()) {
380 header = Bundle.GeneralPurposeArtifactViewer_details_cachedHeader();
381 }
else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()) {
382 header = Bundle.GeneralPurposeArtifactViewer_details_cookieHeader();
383 }
else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()) {
384 header = Bundle.GeneralPurposeArtifactViewer_details_downloadHeader();
385 }
else if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()) {
386 header = Bundle.GeneralPurposeArtifactViewer_details_searchHeader();
388 header = Bundle.GeneralPurposeArtifactViewer_details_attrHeader();
390 return addHeader(header);
401 private JTextPane addHeader(String headerString) {
403 javax.swing.JTextPane headingLabel =
new javax.swing.JTextPane();
404 headingLabel.setOpaque(
false);
405 headingLabel.setFocusable(
false);
406 headingLabel.setEditable(
false);
409 gridBagConstraints.insets = (gridBagConstraints.gridy == 0)
410 ? FIRST_HEADER_INSETS
413 gridBagConstraints.gridy++;
414 gridBagConstraints.gridx = LABEL_COLUMN;;
416 gridBagConstraints.gridwidth = MAX_COLS;
418 headingLabel.setText(headerString);
421 headingLabel.setMargin(ZERO_INSETS);
423 addToPanel(headingLabel);
425 gridBagConstraints.gridwidth = LABEL_WIDTH;
428 gridBagConstraints.insets = ZERO_INSETS;
440 addKeyAtCol(keyString);
441 return addValueAtCol(valueString);
450 gridBagConstraints.gridx = MAX_COLS;
451 gridBagConstraints.weightx = GLUE_WEIGHT_X;
452 gridBagConstraints.fill = GridBagConstraints.BOTH;
453 javax.swing.Box.Filler horizontalFiller =
new javax.swing.Box.Filler(
new Dimension(0, 0),
new Dimension(0, 0),
new Dimension(32767, 0));
455 addToPanel(horizontalFiller);
457 gridBagConstraints.fill = GridBagConstraints.NONE;
458 gridBagConstraints.weightx = TEXT_WEIGHT_X;
466 gridBagConstraints.weighty = 1.0;
467 gridBagConstraints.fill = GridBagConstraints.VERTICAL;
468 javax.swing.Box.Filler vertFiller =
new javax.swing.Box.Filler(
new Dimension(0, 0),
new Dimension(0, 0),
new Dimension(0, 32767));
470 addToPanel(vertFiller);
482 javax.swing.JLabel keyLabel =
new javax.swing.JLabel();
483 keyLabel.setFocusable(
false);
484 gridBagConstraints.gridy++;
485 gridBagConstraints.insets = KEY_COLUMN_INSETS;
486 gridBagConstraints.gridx = LABEL_COLUMN;
487 gridBagConstraints.gridwidth = LABEL_WIDTH;
489 keyLabel.setText(keyString +
": ");
491 addToPanel(keyLabel);
496 detailsPanel.add(comp, gridBagConstraints);
497 detailsPanel.revalidate();
509 JTextPane valueField =
new JTextPane();
510 valueField.setFocusable(
false);
511 valueField.setEditable(
false);
512 valueField.setOpaque(
false);
513 valueField.setMargin(ZERO_INSETS);
514 gridBagConstraints.gridx = VALUE_COLUMN;
515 gridBagConstraints.insets = VALUE_COLUMN_INSETS;
516 GridBagConstraints cloneConstraints = (GridBagConstraints) gridBagConstraints.clone();
518 cloneConstraints.gridwidth = VALUE_WIDTH;
519 cloneConstraints.fill = GridBagConstraints.BOTH;
521 valueField.setText(valueString);
523 valueField.addMouseListener(
new java.awt.event.MouseAdapter() {
525 public void mouseClicked(java.awt.event.MouseEvent evt) {
526 valueLabelMouseClicked(evt, valueField);
530 detailsPanel.add(valueField, cloneConstraints);
545 "GeneralPurposeArtifactViewer_menuitem_copy=Copy"
548 if (SwingUtilities.isRightMouseButton(evt)) {
549 JPopupMenu popup =
new JPopupMenu();
550 JMenuItem copyMenu =
new JMenuItem(Bundle.CommunicationArtifactViewerHelper_menuitem_copy());
551 copyMenu.addActionListener(
new ActionListener() {
553 public void actionPerformed(ActionEvent e) {
554 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
new StringSelection(valueLabel.getText()), null);
558 popup.show(valueLabel, evt.getX(), evt.getY());
void setArtifact(BlackboardArtifact artifact)
void updateView(BlackboardArtifact artifact, Map< Integer, List< BlackboardAttribute >> attributeMap, String dataSourceName, String hostName, String sourceFilePath)
static Integer getLineSpacing()
JTextPane addNameValueRow(String keyString, String valueString)
static String getFormattedTime(long epochTime)
void addToPanel(Component comp)
static Insets getPanelInsets()
void valueLabelMouseClicked(java.awt.event.MouseEvent evt, JTextPane valueLabel)
static Integer getSectionIndent()
boolean addDates(String label, List< BlackboardAttribute > attrList, boolean headerExists)
JTextPane addValueAtCol(String valueString)
boolean isSupported(BlackboardArtifact artifact)
static Font getHeaderFont()
javax.swing.JScrollPane detailsScrollPane
SleuthkitCase getSleuthkitCase()
JTextPane addDetailsHeader(int artifactTypeId)
static int getColumnSpacing()
static Integer getSectionSpacing()
synchronized static Logger getLogger(String name)
JLabel addKeyAtCol(String keyString)
static Case getCurrentCaseThrows()