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  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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?
>>
>
>
|
|
|
Goto Forum:
Current Time: Sun May 11 07:01:44 EDT 2025
Powered by FUDForum. Page generated in 0.03837 seconds
|