Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
RecentFilesNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2014 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 org.openide.nodes.Children;
22 import org.openide.nodes.Sheet;
23 import org.openide.util.NbBundle;
24 import org.openide.util.lookup.Lookups;
25 import org.sleuthkit.datamodel.SleuthkitCase;
26 
30 public class RecentFilesNode extends DisplayableItemNode {
31 
32  private static final String NAME = NbBundle.getMessage(RecentFilesNode.class, "RecentFilesNode.name.text");
33  private SleuthkitCase skCase;
34 
35  RecentFilesNode(SleuthkitCase skCase) {
36  super(Children.create(new RecentFilesChildren(skCase), true), Lookups.singleton(NAME));
37  super.setName(NAME);
38  super.setDisplayName(NAME);
39  this.skCase = skCase;
40  this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/recent_files.png"); //NON-NLS
41  }
42 
43  @Override
44  public boolean isLeafTypeNode() {
45  return false;
46  }
47 
48  @Override
49  public <T> T accept(DisplayableItemNodeVisitor<T> v) {
50  return v.visit(this);
51  }
52 
53  @Override
54  protected Sheet createSheet() {
55  Sheet s = super.createSheet();
56  Sheet.Set ss = s.get(Sheet.PROPERTIES);
57  if (ss == null) {
58  ss = Sheet.createPropertiesSet();
59  s.put(ss);
60  }
61 
62  ss.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "RecentFilesNode.createSheet.name.name"),
63  NbBundle.getMessage(this.getClass(), "RecentFilesNode.createSheet.name.displayName"),
64  NbBundle.getMessage(this.getClass(), "RecentFilesNode.createSheet.name.desc"),
65  NAME));
66  return s;
67  }
68 
69  /*
70  * TODO (AUT-1849): Correct or remove peristent column reordering code
71  *
72  * Added to support this feature.
73  */
74 // @Override
75 // public String getItemType() {
76 // return "RecentFiles"; //NON-NLS
77 // }
78 }

Copyright © 2012-2016 Basis Technology. Generated on: Tue Oct 25 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.