-
Notifications
You must be signed in to change notification settings - Fork 1
DevFaqLookupForDataNode
Any object you create can implement Lookup.Provider
. The simplest way to create a mutable lookup is by using InstanceContent
and AbstractLookup
. Simplified typical usage:
public SomeObject implements Lookup.Provider {
private InstanceContent content = new InstanceContent();
private final AbstractLookup lkp = new AbstractLookup(content);
public someMethod() {
ic.set (someCollection...);
}
public Lookup getLookup() {
return lkp;
}
}
This is how you create a lookup with dynamic content of your choosing. See also Tom Wheeler’s TodoListManager for an example of some code that illustrates how to do this.
If you are using ProxyLookup
to proxy another (or multiple) lookups, and you want to change the set of Lookups you are proxying on the fly, you will need to subclass ProxyLookup
and call the protected method [http://bits.netbeans.org/dev/javadoc/org-openide-util-lookup/org/openide/util/lookup/ProxyLookup.html#setLookups(org.openide.util.Lookup…) setLookups(Lookup… lookups)
].
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DevFaqLookupForDataNode , that was last modified by NetBeans user Jtulach on 2010-07-24T20:17:21Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-01-26, and needs to be reviewed.
Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF).
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
This wiki is an experiment pending Apache NetBeans Community approval.