| A ProxyLookup that changes the last delegate lookup to not return instances
of Node.class depending on changes to the "activatedNodes" property. The
value of this is that the delegate lookup comes from a DataObject Node
delegate, which presumably provides cookies such as SaveCookie. But we
do not want the Node delegate to return instances of Node via its Lookup
(specifically the Node delegate itself).
Usage, from within a TopComponent constructor:
SourceCookieProxyLookup cpl = new SourceCookieProxyLookup(new Lookup[] {
lookup1,
lookup2,
// The Node delegate Lookup must be the last one in the list
// for the CookieProxyLookup to work properly.
delegate.getLookup(),
}, delegate);
associateLookup(cpl);
addPropertyChangeListener("activatedNodes", cpl);
author: Vitaly Bychkov author: Nathan Fiedler version: 1.0 |