Hi,

I'm currently porting a plugin from Eclipse to NetBeans. So far, this
has been a quite pleasant experience, but now I am struggling with the
following:

My plugin can open various selections in a Web browser. So I implemented
a generic "Open in Web Browser" ActionListener requiring a java.net.URI
as context object in its constructor. This works great for those Nodes I
create myself; there, I simply construct the URI and add it to the
Node's lookup.

But how do I do this for Nodes I didn't implement myself, e.g., some of
the Nodes in the "Projects" tab? In Eclipse, I would register an
IAdapterFactory [1] that knows how to convert from, say, Project to URI.
Essentially, the lookup would contain a "virtual" URI whenever a Project
was present.

AFAICT, InstanceContent.Converter [2] looks similar, but requires
cooperation from the creator of the node in question. So what is the
NetBeans way of tackling this issue?

But maybe I am thinking about this the wrong way. So, any help is
greatly appreciated.

Best wishes,

Andreas

[1]
<https://help.eclipse.org/photon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_core_runtime_adapters.html>
[2]
<https://netbeans.apache.org/wiki/DevFaqNodeInjectingLookupContents.asciidoc>

-- 
Dr. Andreas Sewe | s...@cqse.eu | +49 152 56342856
CQSE GmbH | Lichtenbergstrasse 8 | 85748 Garching | www.cqse.eu
Amtsgericht Muenchen | HRB 177678 | GF: F. Deissenboeck, M. Feilkas

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to