Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » After save, editor still thinks it's dirty
After save, editor still thinks it's dirty [message #299465] Fri, 17 February 2006 08:51 Go to next message
Eclipse UserFriend
I have a form editor, and in the doSave method, i do the work necessary to
save my model, and then call the editorDirtyStateChanged method.

However, the * never disappears from the editor title tab, and when I
attempt to close the editor, it asks if I want to save the changes. Am I
missing a step to clearing the dirty state?
Re: After save, editor still thinks it's dirty [message #299466 is a reply to message #299465] Fri, 17 February 2006 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.bettsockentraeger.de

Did you overwrite isDirty?

Shawn L. Pecze wrote:
> I have a form editor, and in the doSave method, i do the work necessary to
> save my model, and then call the editorDirtyStateChanged method.
>
> However, the * never disappears from the editor title tab, and when I
> attempt to close the editor, it asks if I want to save the changes. Am I
> missing a step to clearing the dirty state?
>
>
Re: After save, editor still thinks it's dirty [message #299467 is a reply to message #299466] Fri, 17 February 2006 09:18 Go to previous messageGo to next message
Eclipse UserFriend
I thought that calling editorDirtyStateChanged did that for me.

"Stefan Langer" <eclipse@bettsockentraeger.de> wrote in message
news:dt4kmc$hru$1@utils.eclipse.org...
> Did you overwrite isDirty?
>
> Shawn L. Pecze wrote:
>> I have a form editor, and in the doSave method, i do the work necessary
>> to save my model, and then call the editorDirtyStateChanged method.
>>
>> However, the * never disappears from the editor title tab, and when I
>> attempt to close the editor, it asks if I want to save the changes. Am I
>> missing a step to clearing the dirty state?
Re: After save, editor still thinks it's dirty [message #299469 is a reply to message #299465] Fri, 17 February 2006 09:53 Go to previous messageGo to next message
Eclipse UserFriend
I figured it out. I realized that I wasn't calling doSave on each of the
FormPages in my editor.

Once I did that, the dirtystate was updated properly.

However, I did notice one problem.

I used the protected variable pages (which is a Vector that holds the pages
added to the editor) to loop through and call doSave on each page. The
vector reports that there are 5 elements, however, there are only 4. Thus,
I would get a null pointer exception on the last element. I assume this is
a base java bug, but not sure.


"Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
news:dt4kdv$heu$1@utils.eclipse.org...
>I have a form editor, and in the doSave method, i do the work necessary to
>save my model, and then call the editorDirtyStateChanged method.
>
> However, the * never disappears from the editor title tab, and when I
> attempt to close the editor, it asks if I want to save the changes. Am I
> missing a step to clearing the dirty state?
>
Re: After save, editor still thinks it's dirty [message #299470 is a reply to message #299469] Fri, 17 February 2006 09:58 Go to previous message
Eclipse UserFriend
I had a similar problem. I solved it by calling:

firePropertyChange(PROP_DIRTY);

this normally results in a call to your editors 'isDirty()' method. If it
returns false, the * goes away.

Regards,
Thomas Hallgren

Shawn L. Pecze wrote:
> I figured it out. I realized that I wasn't calling doSave on each of the
> FormPages in my editor.
>
> Once I did that, the dirtystate was updated properly.
>
> However, I did notice one problem.
>
> I used the protected variable pages (which is a Vector that holds the pages
> added to the editor) to loop through and call doSave on each page. The
> vector reports that there are 5 elements, however, there are only 4. Thus,
> I would get a null pointer exception on the last element. I assume this is
> a base java bug, but not sure.
>
>
> "Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
> news:dt4kdv$heu$1@utils.eclipse.org...
>> I have a form editor, and in the doSave method, i do the work necessary to
>> save my model, and then call the editorDirtyStateChanged method.
>>
>> However, the * never disappears from the editor title tab, and when I
>> attempt to close the editor, it asks if I want to save the changes. Am I
>> missing a step to clearing the dirty state?
>>
>
>
Previous Topic:Popup menu not shown for Modelling Perspective
Next Topic:where to start from for beginner of Eclipse
Goto Forum:
  


Current Time: Sun May 11 07:01:44 EDT 2025

Powered by FUDForum. Page generated in 0.03837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top