SaveAsCapability: For Editor Mode Only

Trying to get SaveAsCapable to work for a Node, with Edvin Syse being very helpful on the dev mailing list. Also helpful was taking a look at the sources (and Javadoc) of the context-sensitive Action that is enabled when SaveAsCapable is present in the Lookup:

Hence, unless the Node is displayed in a TopComponent in "editor" mode, the SaveAsAction will never be enabled. That's a bit unfortunate. The assumption seems to have been that the SaveAsAction can only be relevant to documents. However, in this case, I'd like to use the "Save As" dialog for a changed Node. Once the explorer view rendering the Node is in a TopComponent in "editor" mode, everything is fine—by adding the SaveAsCapable to the Node at the time when the Node had changed, I am able to enable the SaveAsAction.

Maybe I should create an issue for making the SaveAsCapable relevant to other modes too. Or I will need to create my own Action that is sensitive to SaveAsCapable.


Hi Geertjan

I love your blog, it's extremely helpful, you should be given an award!

Is this still an issue? I'm starting to add save features to my application now and wondering about this.

Posted by Simon on April 07, 2014 at 01:19 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« November 2015