- fix issue with files in ProjectAssets showing with "unfold triangle"

This commit is contained in:
Normen Hansen 2015-01-28 19:29:21 +01:00
parent 829971890b
commit 5917d699d6

View File

@ -48,12 +48,21 @@ public class AssetNode extends FilterNode {
private Node node;
public AssetNode(ProjectAssetManager manager, Node node) {
super(node, new AssetChildren(manager, node), createLookupProxy(manager, node));
super(node, isFile(node) ? Children.LEAF : new AssetChildren(manager, node), createLookupProxy(manager, node));
this.node = node;
enableDelegation(DELEGATE_GET_ACTIONS);
enableDelegation(DELEGATE_GET_CONTEXT_ACTIONS);
}
public static boolean isFile(Node node) {
DataObject obj = null;
obj = node.getLookup().lookup(DataObject.class);
if (obj != null) {
return !obj.getPrimaryFile().isFolder();
}
return false;
}
public static Lookup createLookupProxy(ProjectAssetManager manager, Node node) {
//TODO: This is causing the most silly exception for the most silly problem
// due to the most silly warning in netbeans platform