Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » multi-page form editor not dirtying
multi-page form editor not dirtying [message #416617] Sat, 19 March 2005 01:16 Go to next message
Anthony Perritano is currently offline Anthony PerritanoFriend
Messages: 32
Registered: July 2009
Member
hi,
I have a multi-page editor form with a page that is using master details
block pattern. In my details page that extends IDetailsPage it has a
bunch of text boxes with modify listners. when i type something one of
the text boxes i want the editor to become dirty with *.

in my DetailsPage have:

public void modifyText(ModifyEvent e) {

setDirty(true);
.....

public boolean isDirty() {
return isDirty;
}

public void setDirty(boolean state) {
this.isDirty = state;
mform.dirtyStateChanged();
}

mform is IManagedForm and evenually calls firePropertyChange(PROP_DIRTY);

this doesn't work. y?

how can i directly call firePropertyChange(PROP_DIRTY); from my
DetailPage in my Master/Detail block?

-Anthony Perritano
Re: multi-page form editor not dirtying [message #416814 is a reply to message #416617] Sun, 20 March 2005 06:35 Go to previous messageGo to next message
Muhammad Aamir is currently offline Muhammad AamirFriend
Messages: 48
Registered: July 2009
Member
Did you override the isEditor() method of the Page ? It should be override
and return true. Moreover, when you add page in your editor you should also
pass EditorInput object.

If you'll not do these things Page will be act as a non-editor page and
therefore no need to make it dirty or stale.

Hope this would help.
Muhammad Aamir
aamir_1975@yahoo.com

"Anthony Perritano" <aperritano@gmail.com> wrote in message
news:d1fuhl$ecs$1@www.eclipse.org...
> hi,
> I have a multi-page editor form with a page that is using master details
> block pattern. In my details page that extends IDetailsPage it has a
> bunch of text boxes with modify listners. when i type something one of
> the text boxes i want the editor to become dirty with *.
>
> in my DetailsPage have:
>
> public void modifyText(ModifyEvent e) {
>
> setDirty(true);
> ....
>
> public boolean isDirty() {
> return isDirty;
> }
>
> public void setDirty(boolean state) {
> this.isDirty = state;
> mform.dirtyStateChanged();
> }
>
> mform is IManagedForm and evenually calls firePropertyChange(PROP_DIRTY);
>
> this doesn't work. y?
>
> how can i directly call firePropertyChange(PROP_DIRTY); from my
> DetailPage in my Master/Detail block?
>
> -Anthony Perritano
Re: multi-page form editor not dirtying [message #418828 is a reply to message #416814] Wed, 30 March 2005 20:13 Go to previous message
Anthony Perritano is currently offline Anthony PerritanoFriend
Messages: 32
Registered: July 2009
Member
The Editor Structure that I have is

MultiPageEditor extends FormEditor
_ with a Page extends FormPage
_ which has a Block which extends MasterDetailsBlock
_ which contains a details page which implements IDetailsPage

when a change is made in my detailspage

it calls
mform.dirtyStateChanged();

like so:

> public boolean isDirty() {
>> return isDirty;
>> }
>>
>> public void setDirty(boolean state) {
>> this.isDirty = state;
>> mform.dirtyStateChanged();
>> }

The multiPageEditor class recieves the notification of the dirty only if
its isDirty method is like this

boolean isDirty() {
return super.isDirty()
}

so in my doSave, after saving

i do:

firePropertyChange(PROP_DIRTY);


if I take out the super.isDirty and replace it with my own dirty flag,
the editor never dirties. if i have super.isDirty, i can't use my own flag.

How can i fix this? Are any MultiPageEditor/Detailspages examples that
have saving and editor dirtying implemented? The one from the forms
programming guide is unimplemented

http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/pde-ui-h ome/working/EclipseForms/EclipseForms.html

thanks
Anthony Perritano









Muhammad Aamir wrote:
> Did you override the isEditor() method of the Page ? It should be override
> and return true. Moreover, when you add page in your editor you should also
> pass EditorInput object.
>
> If you'll not do these things Page will be act as a non-editor page and
> therefore no need to make it dirty or stale.
>
> Hope this would help.
> Muhammad Aamir
> aamir_1975@yahoo.com
>
> "Anthony Perritano" <aperritano@gmail.com> wrote in message
> news:d1fuhl$ecs$1@www.eclipse.org...
>
>>hi,
>>I have a multi-page editor form with a page that is using master details
>> block pattern. In my details page that extends IDetailsPage it has a
>>bunch of text boxes with modify listners. when i type something one of
>>the text boxes i want the editor to become dirty with *.
>>
>>in my DetailsPage have:
>>
>>public void modifyText(ModifyEvent e) {
>>
>> setDirty(true);
>>....
>>
>> public boolean isDirty() {
>> return isDirty;
>> }
>>
>> public void setDirty(boolean state) {
>> this.isDirty = state;
>> mform.dirtyStateChanged();
>> }
>>
>>mform is IManagedForm and evenually calls firePropertyChange(PROP_DIRTY);
>>
>>this doesn't work. y?
>>
>>how can i directly call firePropertyChange(PROP_DIRTY); from my
>>DetailPage in my Master/Detail block?
>>
>>-Anthony Perritano
>
>
>
Previous Topic:Forms title area question
Next Topic:And what if you actually do need org.eclipse.ui.ide
Goto Forum:
  


Current Time: Tue Apr 23 13:54:18 GMT 2024

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

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

Back to the top