BeanNode does not have a constructor that allows a Lookup to be defined. e.g.
protected BeanNode(Object bean, Children children, Lookup lookup)
This prevents the pattern recommended in
Created attachment 32826 [details]
Implementation of the Lookup-accepting ctor.
I'm proposing to add BeanNode constructor accepting Lookup as one of its
parameters. I have attached proposed (nontrivial) implementation of the proposal
with tests covering both the new functionality and compatibility with previous
usage patterns (that were not covered so far).
I believe the proposal is noncontroversonal (hence the API_REVIEW_FAST keyword).
The only questions I see is:
1. Whether to make new ctor protected (as is the (bean, children) ctor) or
public (which would allow passing additional context w/o subclassing).
2. the order of lookups in the proxy.
Please review carefully as keeping real compatibility was not as trivial as one
Javadoc for new ctor needs a different summary line.
@since org.openide.nodes 6.9
Perhaps it would be better to leave the Lookup alone if passed explicitly. I
don't see a reason to forcibly add the bean to it. IMHO if I pass a Lookup I
expect it to be used as is.
OK, I was affraid that some code in/around BeanNode expects the cookie to be
present, but it seems this is not the case. Without the forced InstanceCookie,
the patch will be quite simple.
Implemented as Jesse suggested.
*** Issue 85507 has been marked as a duplicate of this issue. ***