|
org.openide.nodes 7.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openide.nodes.CookieSet
public final class CookieSet
Support class for storing cookies and retriving them by representation class. Provides simple notifications about changes in cookies.
Nested Class Summary | |
---|---|
static interface |
CookieSet.Before
Allows to update content of the cookie set just before a query for a given class is made. |
static interface |
CookieSet.Factory
Factory for creating cookies of given Class |
Constructor Summary | |
---|---|
CookieSet()
Default constructor. |
Method Summary | ||
---|---|---|
void |
add(Class<? extends Node.Cookie>[] cookieClass,
CookieSet.Factory factory)
Registers a Factory for given cookie classes |
|
void |
add(Class<? extends Node.Cookie> cookieClass,
CookieSet.Factory factory)
Registers a Factory for given cookie class |
|
void |
add(Node.Cookie cookie)
Add a new cookie to the set. |
|
void |
addChangeListener(ChangeListener l)
Add a listener to changes in the cookie set. |
|
|
assign(Class<? extends T> clazz,
T... instances)
Removes all instances of clazz from the set and replaces them with newly provided instance(s). |
|
static CookieSet |
createGeneric(CookieSet.Before before)
Factory method to create new, general purpose cookie set. |
|
|
getCookie(Class<T> clazz)
Get a cookie. |
|
Lookup |
getLookup()
The lookup associated with this cookie set. |
|
void |
remove(Class<? extends Node.Cookie>[] cookieClass,
CookieSet.Factory factory)
Unregisters a Factory for given cookie classes |
|
void |
remove(Class<? extends Node.Cookie> cookieClass,
CookieSet.Factory factory)
Unregisters a Factory for given cookie class |
|
void |
remove(Node.Cookie cookie)
Remove a cookie from the set. |
|
void |
removeChangeListener(ChangeListener l)
Remove a listener to changes in the cookie set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CookieSet()
Method Detail |
---|
public static CookieSet createGeneric(CookieSet.Before before)
general purposemeans that it is possible to store any object, into the cookie set and then obtain it using
getLookup()
and queries on the returned Lookup
. The before object can
be passed in if one wants to do a lazy initialization of the CookieSet
content.
before
- the interface to support lazy initialization
Node.Cookie
but also
any plain old java objectassign(java.lang.Class extends T>, T...)
public Lookup getLookup()
getLookup
in interface Lookup.Provider
public void add(Node.Cookie cookie)
Cookies inserted earlier are given preference during lookup, in case a supplied representation class matches more than one cookie in the set.
cookie
- cookie to addpublic void remove(Node.Cookie cookie)
cookie
- the cookie to removepublic <T extends Node.Cookie> T getCookie(Class<T> clazz)
clazz
- the representation class
null
if there is nonepublic void addChangeListener(ChangeListener l)
l
- the listener to addpublic void removeChangeListener(ChangeListener l)
l
- the listener to removepublic void add(Class<? extends Node.Cookie> cookieClass, CookieSet.Factory factory)
public void add(Class<? extends Node.Cookie>[] cookieClass, CookieSet.Factory factory)
public void remove(Class<? extends Node.Cookie> cookieClass, CookieSet.Factory factory)
public void remove(Class<? extends Node.Cookie>[] cookieClass, CookieSet.Factory factory)
public <T> void assign(Class<? extends T> clazz, T... instances)
clazz
- the root clazz for cookies to removeinstances
- the one or more instances to put into the lookup
|
org.openide.nodes 7.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |