samples/extensibleicon/src/org/apidesign/extensibleicon/CatQuery.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:56:12 +0200
changeset 132 3bc4c54f4bcc
parent 89 06f2e2a3d986
child 153 b5cbb797ec0a
permissions -rw-r--r--
Truncating all examples to 80 characters per line
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@132
    10
        for (CatQueryImplementation impl : 
jtulach@132
    11
            Lookup.getDefault().lookupAll(CatQueryImplementation.class)
jtulach@132
    12
        ) {
jtulach@89
    13
            Boolean res = impl.isCat(icon);
jtulach@89
    14
            if (res != null) {
jtulach@89
    15
                return res;
jtulach@89
    16
            }
jtulach@89
    17
        }
jtulach@89
    18
jtulach@132
    19
        for (CatQueryImplementation impl : 
jtulach@132
    20
            icon.getLookup().lookupAll(CatQueryImplementation.class)
jtulach@132
    21
        ) {
jtulach@89
    22
            Boolean res = impl.isCat(icon);
jtulach@89
    23
            if (res != null) {
jtulach@89
    24
                return res;
jtulach@89
    25
            }
jtulach@89
    26
        }
jtulach@89
    27
        
jtulach@89
    28
        return false;
jtulach@89
    29
    }
jtulach@89
    30
}
jtulach@89
    31
// END: ext.CatQuery