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
     1 package org.apidesign.extensibleicon;
     2 
     3 import org.openide.util.Lookup;
     4 
     5 // BEGIN: ext.CatQuery
     6 public class CatQuery {
     7     private CatQuery() { }
     8     
     9     public static boolean isCat(ExtIcon icon) {
    10         for (CatQueryImplementation impl : Lookup.getDefault().lookupAll(CatQueryImplementation.class)) {
    11             Boolean res = impl.isCat(icon);
    12             if (res != null) {
    13                 return res;
    14             }
    15         }
    16 
    17         for (CatQueryImplementation impl : icon.getLookup().lookupAll(CatQueryImplementation.class)) {
    18             Boolean res = impl.isCat(icon);
    19             if (res != null) {
    20                 return res;
    21             }
    22         }
    23         
    24         return false;
    25     }
    26 }
    27 // END: ext.CatQuery