[platform-dev] Re: AbstractSavable unregister called in save()!

  • From: Jaroslav Tulach < >
  • To:
  • Cc: Animazoo < >
  • Subject: [platform-dev] Re: AbstractSavable unregister called in save()!
  • Date: Thu, 01 Nov 2012 10:13:22 +0100
  • Organization: Oracle

Dne St 31. října 2012 12:45:59, Animazoo napsal(a):
> Hi All,
> 
> I'm using Netbeans Platform 7.1.2 and I'm trying to figure out how to use
> the save functionality.
> 
> I've extended an AbstractSavable and have provided an implementation of the
> handleSave() method. However, I want to provide the user with a
> JFileChooser so that they can choose where to save the file. If the user
> selected Cancel on the JFileChooser then obviously nothing will get saved,
> but because unregister() is called in the save() method in AbstractSavable
> the Save All button gets deactivated even though nothing is saved!!
> 
> I tried to override the save() method in AbstractSavable but it's final!!
> How do I get around this?

When the save can't succeed one is supposed to throw IOException. That was 
the 
original plan.

In your case, the situation is more complicated. Have you considered 
implementing SaveAsCapable and using SaveAsAction instead?
-jt


[platform-dev] Re: AbstractSavable unregister called in save()!

Jaroslav Tulach 11/01/2012

Project Features

Project Links

About this Project

Platform was started in November 2009, is owned by Antonin Nebuzelsky, and has 138 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close