开发者

How to use Lookup listener and provider in Netbeans platform?

Hi

I have a problem with understanding the Lookup Api in netbeans Platform.

I want to have one module, scanning-api, where one final class will be and one interface to implement, and the application will scann pictures trough this module, and one or two modules, that will have dependency on this scanning-api module, and will implement all the functionality.

The implementation modules will scan pictures from scanner, and i want them to notify the one final class in scanning-api module about each finished开发者_如何转开发 scanning, so I can immediately show the documents to the user one-by-one through gui module, as soon as they are scanned.

The api module will not be extendet from TopComponent, because the user interaction is in other module, gui. I know about LookupListener and Lookup.Provider a bit, but I dont know which one to use and where. The scanned documents are transfered between modules using class ScannedDocumentObject in third module, called common.

can you explain me how to do this (on some simple example) or at least where to find info? (I googled but for lookup.provider there are not so many examples, and I dont understand whats the difference between lookup.getdefault or getLookup etc.) I think, i have to use LookupListener in the gui module, and somewhere I should implement the lookup.provider, but dunno where.


The API mutates slightly from release to release, so it's best to go to the source: the NetBeans Developer List. There is over a decade's worth of mailing list archives available for perusal. For the Lookup API, here is a good place to start.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜