added a loading node for use when child nodes are still being loaded

This commit is contained in:
Brian Sweeney 2018-04-11 17:46:12 -06:00
parent e9c8e47147
commit a1d3db93f5
4 changed files with 62 additions and 1 deletions

View File

@ -112,5 +112,6 @@ public class CommonFileChildNode extends FileNode {
public String toString() {
return displayString;
}
}
}
}

View File

@ -0,0 +1,48 @@
/*
*
* Autopsy Forensic Browser
*
* Copyright 2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.datamodel;
import org.openide.nodes.Children;
/**
* A dummy node used by the child factory to display while children are being
* generated
*/
public class CommonFileChildNodeLoading extends DisplayableItemNode {
public CommonFileChildNodeLoading(Children children) {
super(children);
}
@Override
public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
return visitor.visit(this);
}
@Override
public boolean isLeafTypeNode() {
return true;
}
@Override
public String getItemType() {
return getClass().getName();
}
}

View File

@ -140,6 +140,11 @@ public class CommonFileParentNode extends DisplayableItemNode {
list.addAll(this.descendants);
return true;
}
@Override
protected Node createWaitNode(){
return new CommonFileChildNodeLoading(Children.LEAF);
}
}
@NbBundle.Messages({

View File

@ -115,6 +115,8 @@ public interface DisplayableItemNodeVisitor<T> {
T visit (CommonFilesSearchNode cfsn);
T visit (CommonFileChildNode cfcn);
T visit (CommonFileChildNodeLoading cfcnl);
/*
* Tags
@ -199,6 +201,11 @@ public interface DisplayableItemNodeVisitor<T> {
return defaultVisit(cfsn);
}
@Override
public T visit(CommonFileChildNodeLoading cfcnl){
return defaultVisit(cfcnl);
}
@Override
public T visit(DirectoryNode dn) {
return defaultVisit(dn);