I have trouble understanding this. Basically, this Lookup API is used to keep loosely coupled intermodule nature. So basically a service provider and consumer modules can each communicate with each other using the Lookup API correct ?
But what I don't understand is:
is Lookup like a bag full of which objects for that Class? Can someone give an easier analogy ?
So the dependencies is created, and you implement the LookupListener in the service consumer correct ? Obviously consumer has dependency on provider.
Then what is the implementation of LookupListener listening to ? It's own Lookup ? So if there is a map of another module's class, it will be stored as an object inside Lookup of the implementation of LookupListener ?
So lookup is kind of like a bag that can store another module's classes and it's methods ?
Is this the correct process of determining a selection ?
- in the TopComponent (view) you implement the Lookup Listener, and action Listener.
- you make a new object (from the other module)
associateLookup(Lookups.singleton(fff));
again, confusion with this line: what isassociateLookup()
exactly doing ?result = Utilities.actionsGlobalContext().lookupResult(Browser1.class);
what is this line doing ? what is result ? does it contain the Browser1 class (from other module) ?result.addLookupListener (this)
; Why would you add listener to result ? and what are we listening for and why on the TopComponent ?Done ?
And finally, to further my confusion , how does Node API come into pla7y ?