Autopsy  4.19.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
EmptyNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2016 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.List;
22 import org.openide.nodes.AbstractNode;
23 import org.openide.nodes.ChildFactory;
24 import org.openide.nodes.Children;
25 import org.openide.nodes.Node;
26 
33 public final class EmptyNode extends AbstractNode {
34 
44  public EmptyNode(String displayedMessage) {
45  super(Children.create(new EmptyNodeChildren(displayedMessage), true));
46  }
47 
48  static class EmptyNodeChildren extends ChildFactory<String> {
49 
50  String displayedMessage;
51 
52  private EmptyNodeChildren(String displayedMessage) {
53  this.displayedMessage = displayedMessage;
54  }
55 
56  @Override
57  protected boolean createKeys(List<String> keys) {
58  keys.add(displayedMessage);
59  return true;
60  }
61 
62  @Override
63  protected Node createNodeForKey(String key) {
64  return new MessageNode(key);
65  }
66 
67  }
68 
73  static class MessageNode extends DisplayableItemNode {
74 
75  MessageNode(String name) {
76  super(Children.LEAF);
77  super.setName(name);
78  setName(name);
79  setDisplayName(name);
80  }
81 
82  @Override
83  public boolean isLeafTypeNode() {
84  return true;
85  }
86 
87  @Override
88  public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
89  return visitor.visit(this);
90  }
91 
92  @Override
93  public String getItemType() {
94  return getClass().getName();
95  }
96  }
97 }
EmptyNode(String displayedMessage)
Definition: EmptyNode.java:44

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