|
org.openide.util 7.18.1 1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openide.util.lookup.AbstractLookup.Content
org.openide.util.lookup.InstanceContent
public final class InstanceContent
A special content implementation that can be passed to AbstractLookup and provides methods for registration of instances and lazy instances.
InstanceContent ic = new InstanceContent ();
AbstractLookup al = new AbstractLookup (ic);
ic.add (new Object ());
ic.add (new Dimension (...));
Dimension theDim = (Dimension)al.lookup (Dimension.class);
| Nested Class Summary | |
|---|---|
static interface |
InstanceContent.Convertor<T,R>
Convertor postpones an instantiation of an object. |
| Constructor Summary | |
|---|---|
InstanceContent()
Create a new, empty content. |
|
InstanceContent(Executor notifyIn)
Creates a content associated with an executor to handle dispatch of changes. |
|
| Method Summary | ||
|---|---|---|
void |
add(Object inst)
The method to add instance to the lookup with. |
|
|
add(T inst,
InstanceContent.Convertor<T,R> conv)
The method to add instance to the lookup with. |
|
void |
remove(Object inst)
Remove instance. |
|
|
remove(T inst,
InstanceContent.Convertor<T,R> conv)
Remove instance added with a convertor. |
|
|
set(Collection<T> col,
InstanceContent.Convertor<T,R> conv)
Changes all pairs in the lookup to new values. |
|
| Methods inherited from class org.openide.util.lookup.AbstractLookup.Content |
|---|
addPair, removePair, setPairs |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InstanceContent()
public InstanceContent(Executor notifyIn)
notifyIn - the executor to notify changes in| Method Detail |
|---|
public final void add(Object inst)
inst - instance
public final <T,R> void add(T inst,
InstanceContent.Convertor<T,R> conv)
inst - instanceconv - convertor which postponing an instantiation,
if conv==null then the instance is registered directly.public final void remove(Object inst)
inst - instance
public final <T,R> void remove(T inst,
InstanceContent.Convertor<T,R> conv)
inst - instanceconv - convertor, if conv==null it is same like
remove(Object)
public final <T,R> void set(Collection<T> col,
InstanceContent.Convertor<T,R> conv)
col - the collection of (Item) objectsconv - the convertor to use or null
|
org.openide.util 7.18.1 1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||