samples/extensibleicon/src/org/apidesign/extensibleicon/CatQuery.java
changeset 89 06f2e2a3d986
child 132 3bc4c54f4bcc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/extensibleicon/src/org/apidesign/extensibleicon/CatQuery.java	Sat Jun 14 09:53:51 2008 +0200
     1.3 @@ -0,0 +1,27 @@
     1.4 +package org.apidesign.extensibleicon;
     1.5 +
     1.6 +import org.openide.util.Lookup;
     1.7 +
     1.8 +// BEGIN: ext.CatQuery
     1.9 +public class CatQuery {
    1.10 +    private CatQuery() { }
    1.11 +    
    1.12 +    public static boolean isCat(ExtIcon icon) {
    1.13 +        for (CatQueryImplementation impl : Lookup.getDefault().lookupAll(CatQueryImplementation.class)) {
    1.14 +            Boolean res = impl.isCat(icon);
    1.15 +            if (res != null) {
    1.16 +                return res;
    1.17 +            }
    1.18 +        }
    1.19 +
    1.20 +        for (CatQueryImplementation impl : icon.getLookup().lookupAll(CatQueryImplementation.class)) {
    1.21 +            Boolean res = impl.isCat(icon);
    1.22 +            if (res != null) {
    1.23 +                return res;
    1.24 +            }
    1.25 +        }
    1.26 +        
    1.27 +        return false;
    1.28 +    }
    1.29 +}
    1.30 +// END: ext.CatQuery