org.openide.util.lookup
Class ProxyLookup

java.lang.Object
  |
  +--org.openide.util.Lookup
        |
        +--org.openide.util.lookup.ProxyLookup

public class ProxyLookup
extends Lookup

Implementation of lookup that can delegate to others.

Since:
1.9

Inner classes inherited from class org.openide.util.Lookup
Lookup.Item, Lookup.Result, Lookup.Template
 
Fields inherited from class org.openide.util.Lookup
EMPTY
 
Constructor Summary
ProxyLookup(Lookup[] lookups)
          Create a proxy to some other lookups.
 
Method Summary
protected  void beforeLookup(Lookup.Template template)
          Notifies subclasses that a query is about to be processed.
protected  Lookup[] getLookups()
          Getter for the delegates.
 Object lookup(Class clazz)
          Look up an object matching a given interface.
 Lookup.Result lookup(Lookup.Template template)
          The general lookup method.
 Lookup.Item lookupItem(Lookup.Template template)
          Look up the first item matching a given template.
protected  void setLookups(Lookup[] lookups)
          Change the delegates.
 
Methods inherited from class org.openide.util.Lookup
getDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyLookup

public ProxyLookup(Lookup[] lookups)
Create a proxy to some other lookups.
Parameters:
lookups - the initial delegates
Method Detail

getLookups

protected final Lookup[] getLookups()
Getter for the delegates.
Returns:
the array of lookups we delegate to
Since:
1.19

setLookups

protected final void setLookups(Lookup[] lookups)
Change the delegates. To forbid anybody else then the creator of the lookup to change the delegates, this method is protected.
Parameters:
lookups - the new lookups to delegate to
Since:
1.19 protected

beforeLookup

protected void beforeLookup(Lookup.Template template)
Notifies subclasses that a query is about to be processed. Subclasses can update its state before the actual processing begins. It is allowed to call setLookups method to change/update the set of objects the proxy delegates to.
Parameters:
template - the template of the query
Since:
1.31

lookup

public final Object lookup(Class clazz)
Description copied from class: Lookup
Look up an object matching a given interface. This is the simplest method to use. If more than one object matches, one will be returned arbitrarily. The template class may be a class or interface; the instance is guaranteed to be assignable to it.
Overrides:
lookup in class Lookup
Following copied from class: org.openide.util.Lookup
Parameters:
clazz - class of the object we are searching for
Returns:
an object implementing the given class or null if no such implementation is found

lookupItem

public final Lookup.Item lookupItem(Lookup.Template template)
Description copied from class: Lookup
Look up the first item matching a given template. Includes not only the instance but other associated information.
Overrides:
lookupItem in class Lookup
Following copied from class: org.openide.util.Lookup
Parameters:
template - the template to check
Returns:
a matching item or null

lookup

public final Lookup.Result lookup(Lookup.Template template)
Description copied from class: Lookup
The general lookup method.
Overrides:
lookup in class Lookup
Following copied from class: org.openide.util.Lookup
Parameters:
template - a template describing the services to look for
Returns:
an object containing the results


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.