1 19 20 package org.netbeans.api.queries; 21 22 import javax.swing.event.ChangeListener ; 23 import org.netbeans.spi.queries.FileBuiltQueryImplementation; 24 import org.openide.filesystems.FileObject; 25 import org.openide.util.Lookup; 26 27 30 35 public final class FileBuiltQuery { 36 37 private static final Lookup.Result<FileBuiltQueryImplementation> implementations = 38 Lookup.getDefault().lookupResult(FileBuiltQueryImplementation.class); 39 40 private FileBuiltQuery() {} 41 42 71 public static Status getStatus(FileObject file) { 72 if (!file.isValid()) { 73 return null; 75 } 76 for (FileBuiltQueryImplementation fbqi : implementations.allInstances()) { 77 Status s = fbqi.getStatus(file); 78 if (s != null) { 79 return s; 80 } 81 } 82 return null; 83 } 84 85 90 public interface Status { 91 92 96 boolean isBuilt(); 97 98 102 void addChangeListener(ChangeListener l); 103 104 108 void removeChangeListener(ChangeListener l); 109 110 } 111 112 } 113 | Popular Tags |