Autopsy  4.18.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
InstanceCountNodeTreeExpansionListener.java
Go to the documentation of this file.
1 /*
2  *
3  * Autopsy Forensic Browser
4  *
5  * Copyright 2018 Basis Technology Corp.
6  * Contact: carrier <at> sleuthkit <dot> org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 package org.sleuthkit.autopsy.commonpropertiessearch;
21 
22 import javax.swing.event.TreeExpansionEvent;
23 import javax.swing.event.TreeExpansionListener;
24 import org.openide.explorer.view.Visualizer;
25 import org.openide.nodes.Node;
28 
33 final class InstanceCountNodeTreeExpansionListener implements TreeExpansionListener {
34 
35  @Override
36  public synchronized void treeCollapsed(final TreeExpansionEvent event) {
37  }
38 
39  @Override
40  public synchronized void treeExpanded(final TreeExpansionEvent event) {
41  final Node eventNode = Visualizer.findNode(event.getPath().getLastPathComponent());
42  if (eventNode instanceof TableFilterNode) {
43  final TableFilterNode tableFilterNode = (TableFilterNode) eventNode;
44  final DataResultFilterNode dataResultFilterNode = tableFilterNode.getLookup().lookup(DataResultFilterNode.class);
45  if (dataResultFilterNode != null) {
46  final InstanceCountNode instanceCountNode = dataResultFilterNode.getLookup().lookup(InstanceCountNode.class);
47  if (instanceCountNode != null) {
48  instanceCountNode.createChildren();
49  }
50  final InstanceDataSourceNode instanceDataSourceNode = dataResultFilterNode.getLookup().lookup(InstanceDataSourceNode.class);
51  if (instanceDataSourceNode != null) {
52  instanceDataSourceNode.createChildren();
53  }
54  }
55  }
56  }
57 
58 }

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