Autopsy  4.13.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 final boolean forceUseWrappedDisplayName;
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.forceUseWrappedDisplayName = false;
52  this.createChildren = createChildren;
53  }
54 
67  public TableFilterNode(Node node, boolean createChildren, String columnOrderKey) {
68  super(node, TableFilterChildren.createInstance(node, createChildren));
69  this.forceUseWrappedDisplayName = false;
70  this.createChildren = createChildren;
71  this.columnOrderKey = columnOrderKey;
72  }
73 
74  public TableFilterNode(Node node, int childLayerDepth){
75  super(node, TableFilterChildrenWithDescendants.createInstance(node, childLayerDepth), Lookups.proxy(node));
76  this.createChildren = true;
77  this.forceUseWrappedDisplayName = true;
78  }
79 
86  @Override
87  public String getDisplayName() {
88  if (this.forceUseWrappedDisplayName) {
89  return super.getDisplayName();
90  } else if (createChildren) {
91  return NbBundle.getMessage(this.getClass(), "TableFilterNode.displayName.text");
92  } else {
93  return super.getDisplayName();
94  }
95  }
96 
103  public void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo) {
104  /*
105  * Currently, child selection is only supported for nodes selected in
106  * the tree view and decorated with a DataResultFilterNode.
107  */
108  if (getOriginal() instanceof DataResultFilterNode) {
109  ((DataResultFilterNode) getOriginal()).setChildNodeSelectionInfo(selectedChildNodeInfo);
110  }
111  }
112 
121  /*
122  * Currently, child selection is only supported for nodes selected in
123  * the tree view and decorated with a DataResultFilterNode.
124  */
125  if (getOriginal() instanceof DataResultFilterNode) {
126  return ((DataResultFilterNode) getOriginal()).getChildNodeSelectionInfo();
127  } else {
128  return null;
129  }
130  }
131 
139  public String getColumnOrderKey() {
140  return columnOrderKey;
141  }
142 }
void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo)
TableFilterNode(Node node, boolean createChildren)
TableFilterNode(Node node, boolean createChildren, String columnOrderKey)

Copyright © 2012-2019 Basis Technology. Generated on: Tue Jan 7 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.