Re: Instanciate a DataNode wihout DataObject to display some properties

Casqueiro Gilles <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <46731A37FFC5D047B3FAAD3558D349B75881D155@BMI-2K8-MS03.emea.bracco.priv>
Ok thanks, I successfully created a BeanNode with the appropriated createSheet method. This seems to work.

Sorry for the next stupid question but I am unable to publish the Node into the Global Lookup… I have a table in the TopComponent, I listen for row selection and then I would like to dynamically update the exposed Node. I tried this first:

lkp = new ProxyLookup(super.getLookup(), new AbstractLookup(ic)); // in the constructor

with:

@Override
public Lookup getLookup() {
    return lkp;
}

And then I use the InstanceContent ic to manage the content of the Lookup. Unfortunately the following the always return null:

Lookup.getDefault().lookup(MyBeanNode.class);

I also tried this:

ExplorerManager em = new ExplorerManager();
associateLookup(ExplorerUtils.createLookup(em, this.getActionMap()));

and then:

Node[] nodes = new Node[1];
nodes[0] = myBeanNode;
em.setSelectedNodes(nodes);

Also without success.

Publishing a Node in the Global Lookup should be very standard… Sorry for this stupid question.

Gilles
From: Tim Boudreau [mailto:[email protected]]
Sent: jeudi 28 janvier 2016 06:26
To: [email protected]
Subject: [platform-dev] Re: Instanciate a DataNode wihout DataObject to display some properties

BeanNode or just a subclass of AbstractNode.  DataNode is only useful for something that represents a file and you want to use, say the Save action or other file-related actions and want a lot of the plumbing for those built-in.

-Tim

On Wed, Jan 27, 2016 at 12:43 PM, Dmitriy Avtonomov <[email protected]<mailto:[email protected]>> wrote:
Maybe you're looking for BeanNode?

On Wed, Jan 27, 2016 at 12:23 PM, Casqueiro Gilles <[email protected]<mailto:[email protected]>> wrote:
Hello,

Is it possible to have a DataNode without any DataObject? If possible I would like to publish it in the Global Lookup and use its createSheet method to display some info in the Property window. I work with beans that don’t necessarily have any associated file on disk.

Not sure if this approach is correct.

Gilles



-----------------------------------------------------------------------

Le informazioni contenute in questo messaggio di posta elettronica e relativi allegati sono riservate e confidenziali e ne è vietata la diffusione in qualunque modo eseguita. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo e a darcene gentile comunicazione.

The information contained in this e-mail and any attachments is confidential and may also be privileged. If you are not the named recipient please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.

-----------------------------------------------------------------------




--
http://timboudreau.com


-----------------------------------------------------------------------

Le informazioni contenute in questo messaggio di posta elettronica e relativi allegati sono riservate e confidenziali e ne è vietata la diffusione in qualunque modo eseguita. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo e a darcene gentile comunicazione.

The information contained in this e-mail and any attachments is confidential and may also be privileged. If you are not the named recipient please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.

-----------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.