Autopsy  4.6.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
TableFilterNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2017 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.corecomponents;
20 
21 import org.openide.nodes.FilterNode;
22 import org.openide.nodes.Node;
23 import org.openide.util.NbBundle;
24 import org.openide.util.lookup.Lookups;
27 
33 public class TableFilterNode extends FilterNode {
34 
35  private final boolean createChildren;
36  private boolean forceUseWrappedDisplayName = false;
37  private String columnOrderKey = "NONE";
38 
49  public TableFilterNode(Node node, boolean createChildren) {
50  super(node, TableFilterChildren.createInstance(node, createChildren), Lookups.proxy(node));
51  this.createChildren = createChildren;
52  }
53 
62  public TableFilterNode(Node node) {
63  super(node, TableFilterChildrenWithDescendants.createInstance(node, true), Lookups.proxy(node));
64  this.createChildren = true;
65  this.forceUseWrappedDisplayName = false;
66  }
67 
75  TableFilterNode(Node node, boolean createChildren, boolean forceUseWrappedDisplayName) {
76  super(node, TableFilterChildren.createInstance(node, createChildren), Lookups.proxy(node));
77  this.createChildren = createChildren;
78  this.forceUseWrappedDisplayName = forceUseWrappedDisplayName;
79  }
80 
93  public TableFilterNode(Node node, boolean createChildren, String columnOrderKey) {
94  super(node, TableFilterChildren.createInstance(node, createChildren));
95  this.createChildren = createChildren;
96  this.columnOrderKey = columnOrderKey;
97  }
98 
105  @Override
106  public String getDisplayName() {
107  if (this.forceUseWrappedDisplayName) {
108  return super.getDisplayName();
109  } else if (createChildren) {
110  return NbBundle.getMessage(this.getClass(), "TableFilterNode.displayName.text");
111  } else {
112  return super.getDisplayName();
113  }
114  }
115 
116  protected String getParentDisplayName() {
117  return super.getDisplayName();
118  }
119 
126  public void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo) {
127  /*
128  * Currently, child selection is only supported for nodes selected in
129  * the tree view and decorated with a DataResultFilterNode.
130  */
131  if (getOriginal() instanceof DataResultFilterNode) {
132  ((DataResultFilterNode) getOriginal()).setChildNodeSelectionInfo(selectedChildNodeInfo);
133  }
134  }
135 
144  /*
145  * Currently, child selection is only supported for nodes selected in
146  * the tree view and decorated with a DataResultFilterNode.
147  */
148  if (getOriginal() instanceof DataResultFilterNode) {
149  return ((DataResultFilterNode) getOriginal()).getChildNodeSelectionInfo();
150  } else {
151  return null;
152  }
153  }
154 
162  String getColumnOrderKey() {
163  return columnOrderKey;
164  }
165 
166 }
void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo)
TableFilterNode(Node node, boolean createChildren)
TableFilterNode(Node node, boolean createChildren, String columnOrderKey)

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.