Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.nodes 6.7.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.nodes
Class CookieSet

    java.lang.Object
      org.openide.nodes.CookieSet

    public final class CookieSet

extends Object

Support class for storing cookies and retriving them by representation class. Provides simple notifications about changes in cookies.

Nested Class Summary
`static interface` | `CookieSet.Factory` Factory for creating cookies of given Class

Constructor Summary
`CookieSet()` Default constructor.

Method Summary
`void` | `add(Class[] cookieClass, CookieSet.Factory factory)` Registers a Factory for given cookie classes
`void` | `add(Class 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.
`Node.Cookie` | `getCookie(Class clazz)` Get a cookie.
`void` | `remove(Class[] cookieClass, CookieSet.Factory factory)` Unregisters a Factory for given cookie classes
`void` | `remove(Class 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

### CookieSet

    public CookieSet()

  Default constructor.

Method Detail

### add

    public void add(Node.Cookie cookie)

  Add a new cookie to the set. If a cookie of the same actual (not representation!) class is already there, it is replaced.

  Cookies inserted earlier are given preference during lookup, in case a supplied representation class matches more than one cookie in the set.

  Parameters:
    `cookie` - cookie to add

### remove

    public void remove(Node.Cookie cookie)

  Remove a cookie from the set.

  Parameters:
    `cookie` - the cookie to remove

### getCookie

    public Node.Cookie getCookie(Class clazz)

  Get a cookie.

  Parameters:
    `clazz` - the representation class
  Returns:
    a cookie assignable to the representation class, or `null` if there is none

### addChangeListener

    public void addChangeListener(ChangeListener l)

  Add a listener to changes in the cookie set.

  Parameters:
    `l` - the listener to add

### removeChangeListener

    public void removeChangeListener(ChangeListener l)

  Remove a listener to changes in the cookie set.

  Parameters:
    `l` - the listener to remove

### add

    public void add(Class cookieClass,
                    CookieSet.Factory factory)

  Registers a Factory for given cookie class

### add

    public void add(Class[] cookieClass,
                    CookieSet.Factory factory)

  Registers a Factory for given cookie classes

### remove

    public void remove(Class cookieClass,
                       CookieSet.Factory factory)

  Unregisters a Factory for given cookie class

  Since:
    2.6

### remove

    public void remove(Class[] cookieClass,
                       CookieSet.Factory factory)

  Unregisters a Factory for given cookie classes

  Since:
    2.6

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.nodes 6.7.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.