1 19 20 package org.openidex.search; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 import org.openide.loaders.DataFolder; 25 import org.openide.loaders.DataObject; 26 import org.openide.nodes.Node; 27 28 32 final class Utils { 33 34 36 static SearchInfo getSearchInfo(Node node) { 37 38 SearchInfo info = (SearchInfo) 39 node.getLookup().lookup(SearchInfo.class); 40 if (info != null) { 41 return info; 42 } 43 44 45 Object container = node.getLookup().lookup(DataFolder.class); 46 if (container == null) { 47 return null; 48 } else { 49 return SearchInfoFactory.createSearchInfo( 50 ((DataFolder) container).getPrimaryFile(), 51 true, new FileObjectFilter[] { 53 SearchInfoFactory.VISIBILITY_FILTER }); 54 } 55 } 56 57 } 58 | Popular Tags |