samples/extensibleicon/src/org/apidesign/extensibleicon/CatQuery.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:58:08 +0200
changeset 153 b5cbb797ec0a
parent 132 3bc4c54f4bcc
child 154 0fd5e9c500b9
permissions -rw-r--r--
up to line 2000
jtulach@89
     1
package org.apidesign.extensibleicon;
jtulach@89
     2
jtulach@89
     3
import org.openide.util.Lookup;
jtulach@89
     4
jtulach@89
     5
// BEGIN: ext.CatQuery
jtulach@89
     6
public class CatQuery {
jtulach@89
     7
    private CatQuery() { }
jtulach@89
     8
    
jtulach@89
     9
    public static boolean isCat(ExtIcon icon) {
jtulach@153
    10
        for (CatQueryImplementation impl : Lookup.getDefault().lookupAll(CatQueryImplementation.class)) {
jtulach@89
    11
            Boolean res = impl.isCat(icon);
jtulach@89
    12
            if (res != null) {
jtulach@89
    13
                return res;
jtulach@89
    14
            }
jtulach@89
    15
        }
jtulach@89
    16
jtulach@153
    17
        for (CatQueryImplementation impl : icon.getLookup().lookupAll(CatQueryImplementation.class)) {
jtulach@89
    18
            Boolean res = impl.isCat(icon);
jtulach@89
    19
            if (res != null) {
jtulach@89
    20
                return res;
jtulach@89
    21
            }
jtulach@89
    22
        }
jtulach@89
    23
        
jtulach@89
    24
        return false;
jtulach@89
    25
    }
jtulach@89
    26
}
jtulach@89
    27
// END: ext.CatQuery