Autopsy  4.21.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.openide.nodes.Sheet;
25 import org.openide.util.NbBundle;
26 import org.sleuthkit.datamodel.UnsupportedContent;
27 import org.sleuthkit.datamodel.Tag;
28 
32 public class UnsupportedContentNode extends AbstractContentNode<UnsupportedContent> {
33 
38  @NbBundle.Messages({
39  "UnsupportedContentNode.displayName=Unsupported Content",})
40  public UnsupportedContentNode(UnsupportedContent unsupportedContent) {
41  super(unsupportedContent);
42 
43  // set name, display name, and icon
44  this.setDisplayName(Bundle.UnsupportedContentNode_displayName());
45 
46  this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon.png"); //NON-NLS
47  }
48 
56  @Override
57  public Action[] getActions(boolean popup) {
58  List<Action> actionsList = new ArrayList<>();
59 
60  for (Action a : super.getActions(true)) {
61  actionsList.add(a);
62  }
63 
64  return actionsList.toArray(new Action[actionsList.size()]);
65 
66  }
67 
68  @NbBundle.Messages({
69  "UnsupportedContentNode.createSheet.name.name=Name",
70  "UnsupportedContentNode.createSheet.name.displayName=Name",
71  "UnsupportedContentNode.createSheet.name.desc=no description",})
72  @Override
73  protected Sheet createSheet() {
74  Sheet sheet = super.createSheet();
75  Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
76  if (sheetSet == null) {
77  sheetSet = Sheet.createPropertiesSet();
78  sheet.put(sheetSet);
79  }
80 
81  sheetSet.put(new NodeProperty<>(Bundle.UnsupportedContentNode_createSheet_name_name(),
82  Bundle.UnsupportedContentNode_createSheet_name_displayName(),
83  Bundle.UnsupportedContentNode_createSheet_name_desc(),
84  this.getDisplayName()));
85 
86  return sheet;
87  }
88 
89  @Override
90  public <T> T accept(ContentNodeVisitor<T> visitor) {
91  return visitor.visit(this);
92  }
93 
94  @Override
95  public boolean isLeafTypeNode() {
96  return false;
97  }
98 
99  @Override
100  public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
101  return visitor.visit(this);
102  }
103 
104  @Override
105  public String getItemType() {
106  return getClass().getName();
107  }
108 
116  @Override
117  protected List<Tag> getAllTagsFromDatabase() {
118  return new ArrayList<>();
119  }
120 
121 }
UnsupportedContentNode(UnsupportedContent unsupportedContent)

Copyright © 2012-2022 Basis Technology. Generated on: Tue Feb 6 2024
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.