|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.util.Lookup org.openide.util.lookup.AbstractLookup
Implementation of the lookup from OpenAPIs that is based on the introduction of Item. This class should provide the default way of how to store (Class, Object) pairs in the lookups. It offers protected methods for subclasses to register the pairs.
Serializable since 3.27.
Nested Class Summary | |
static class |
AbstractLookup.Content
A class that can be used by the creator of the AbstractLookup to control its content. |
static class |
AbstractLookup.Pair
Extension to the default lookup item that offers additional information for the data structures use in AbstractLookup |
Nested classes inherited from class org.openide.util.Lookup |
Lookup.Item, Lookup.Provider, Lookup.Result, Lookup.Template |
Field Summary |
Fields inherited from class org.openide.util.Lookup |
EMPTY |
Constructor Summary | |
protected |
AbstractLookup()
Default constructor for subclasses that do not need to provide a content |
|
AbstractLookup(AbstractLookup.Content content)
Constructor to create this lookup and associate it with given Content. |
Method Summary | |
protected void |
addPair(AbstractLookup.Pair pair)
The method to add instance to the lookup with. |
protected void |
beforeLookup(Lookup.Template template)
Notifies subclasses that a query is about to be processed. |
protected void |
initialize()
Method for subclasses to initialize them selves. |
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 |
removePair(AbstractLookup.Pair pair)
Remove instance. |
protected void |
setPairs(Collection collection)
Changes all pairs in the lookup to new values. |
String |
toString()
|
Methods inherited from class org.openide.util.Lookup |
getDefault |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AbstractLookup(AbstractLookup.Content content)
content
- the content to assciate withprotected AbstractLookup()
Method Detail |
public String toString()
protected void initialize()
protected void beforeLookup(Lookup.Template template)
template
- the templateprotected final void addPair(AbstractLookup.Pair pair)
pair
- class/instance pairprotected final void removePair(AbstractLookup.Pair pair)
pair
- class/instance pairprotected final void setPairs(Collection collection)
collection
- the collection of (Pair) objectspublic final Object lookup(Class clazz)
Lookup
clazz
- class of the object we are searching for
null
if no such
implementation is foundpublic final Lookup.Item lookupItem(Lookup.Template template)
Lookup
lookupItem
in class Lookup
template
- the template to check
null
public final Lookup.Result lookup(Lookup.Template template)
Lookup
template
, request more info about
them in form of Lookup.Item
and attach a listener to
this be notified about changes. The general interface does not
specify whether subsequent calls with the same template produce new
instance of the Lookup.Result
or return shared instance. The
prefered behaviour however is to return shared one.
template
- a template describing the services to look for
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |