Question

I have experience some year with NetBeans RCP. The most amazing thing is Lookup (org.netbeans.lookup) it is Alpha and Omega of whole NetBeans inter-module communication system. Now I am searching analogy in Eclipse RCP platform. Is It databinding? Or what?

Thank you for your advices, Jirka

Thank to Daniil

to discussion:

  • static lookup

Yes, if we talk about "static" lookup. This lookup contents "instances" of implementations of service provider (Actions, Windows, etc). I think, that it is analogy with Eclipse RCP extension points YES (thank you).

  • action global lookup

In NetBeans RCP all TopComponents (analogy to View or Editor EClips) have own Lookup. There are all selected (node) or added programmatically objects. When some TC is focused, these objects from this lookup are in actionGlobaCotext. Any other TC may have listener to "exist any objects of this CLASS" - this is goal of inter-module (in UI) communication.

But in Eclipse: Is it based on Listeners and IEditorInput? Or databiding in UI.

  • user lookup

In this view, all object may have own lookup Map<Class<T>,List<? extends T>> ... this is base of "multi-inheritens in java".

But in Eclipse: I dont know. (Of course, I can use org.netbeans.lookup in Eclipse from NB platform)

thank for discussion, Jirka

Was it helpful?

Solution

Can you clarify a bit the use-cases for the lookups?

Looks like most of those cases should be handled by IAdaptable. If you need to "cast" the adaptable object to some interface/class you call "adaptable.getAdapter(MyClass.class)" - and either the object itself or the factory contributed through the extension point will instantiate the adapter to a proper type (if possible). This way your action can try to "cast" selected object (be it editor or file element) to some interface and call its methods.

OTHER TIPS

If I correctly understood what Netbeans RCP Lookup is, than in Eclipse RCP it is extension points

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top