Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
UnsupportedContentNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2021 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.datamodel;
20 
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.Action;
24 import org.apache.commons.lang3.tuple.Pair;
25 import org.openide.nodes.Sheet;
26 import org.openide.util.NbBundle;
30 import org.sleuthkit.datamodel.UnsupportedContent;
31 import org.sleuthkit.datamodel.Tag;
32 
36 public class UnsupportedContentNode extends AbstractContentNode<UnsupportedContent> {
37 
42  @NbBundle.Messages({
43  "UnsupportedContentNode.displayName=Unsupported Content",
44  })
45  public UnsupportedContentNode(UnsupportedContent unsupportedContent) {
46  super(unsupportedContent);
47 
48  // set name, display name, and icon
49  this.setDisplayName(Bundle.UnsupportedContentNode_displayName());
50 
51  this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon.png"); //NON-NLS
52  }
53 
61  @Override
62  public Action[] getActions(boolean popup) {
63  List<Action> actionsList = new ArrayList<>();
64 
65  for (Action a : super.getActions(true)) {
66  actionsList.add(a);
67  }
68 
69  return actionsList.toArray(new Action[actionsList.size()]);
70 
71  }
72 
73  @NbBundle.Messages({
74  "UnsupportedContentNode.createSheet.name.name=Name",
75  "UnsupportedContentNode.createSheet.name.displayName=Name",
76  "UnsupportedContentNode.createSheet.name.desc=no description",
77  })
78  @Override
79  protected Sheet createSheet() {
80  Sheet sheet = super.createSheet();
81  Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
82  if (sheetSet == null) {
83  sheetSet = Sheet.createPropertiesSet();
84  sheet.put(sheetSet);
85  }
86 
87  sheetSet.put(new NodeProperty<>(Bundle.UnsupportedContentNode_createSheet_name_name(),
88  Bundle.UnsupportedContentNode_createSheet_name_displayName(),
89  Bundle.UnsupportedContentNode_createSheet_name_desc(),
90  this.getDisplayName()));
91 
92  return sheet;
93  }
94 
95  @Override
96  public <T> T accept(ContentNodeVisitor<T> visitor) {
97  return visitor.visit(this);
98  }
99 
100  @Override
101  public boolean isLeafTypeNode() {
102  return false;
103  }
104 
105  @Override
106  public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
107  return visitor.visit(this);
108  }
109 
110  @Override
111  public String getItemType() {
112  return getClass().getName();
113  }
114 
122  @Override
123  protected List<Tag> getAllTagsFromDatabase() {
124  return new ArrayList<>();
125  }
126 
136  @Override
138  return null;
139  }
140 
151  @Override
154  }
155 
168  @Override
169  protected Pair<Long, String> getCountPropertyAndDescription(CorrelationAttributeInstance.Type attributeType, String attributeValue, String defaultDescription) {
170  return Pair.of(-1L, NO_DESCR);
171  }
172 }
UnsupportedContentNode(UnsupportedContent unsupportedContent)
DataResultViewerTable.HasCommentStatus getCommentProperty(List< Tag > tags, CorrelationAttributeInstance attribute)
Pair< Long, String > getCountPropertyAndDescription(CorrelationAttributeInstance.Type attributeType, String attributeValue, String defaultDescription)

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.