How can I implement 'not save and not close the part' behavior when dirty part will be closed? [message #1172938] |
Wed, 06 November 2013 07:06 |
Ken DevL. Messages: 2 Registered: November 2013 Location: Tokyo, Japan. |
Junior Member |
|
|
Hello,
I have a Part which have MDirtyable field and @Persist method.
I want to implement the similar behavior as ISaveablePart2#promptToSaveOnClose() is returning an CANCEL.
That is, When a Part will be closed,
1) First, prompt to user to select save, do not save or cancel.
2) If cancel is selected, quit @Persist method and not close this Part.
Actually, validate unsaved data before to prompt to user. And if validate is failed, I want to quit @Persist method and do not want to close the Part.
For that reason, I cannot use the default ISaveHandler#promptToSave(MPart) which is set to WindowContext(IEclipseContext).
Does anyone have an idea to solve this?
Thanks,
Ken
|
|
|
Re: How can I implement 'not save and not close the part' behavior when dirty part will be closed? [message #1194975 is a reply to message #1172938] |
Mon, 18 November 2013 19:50 |
Jonas Helming Messages: 699 Registered: July 2009 |
Senior Member |
|
|
Have you tried to replace the default SaveHandler?
Am 06.11.2013 15:14, schrieb Ken DevL.:
> Hello,
>
> I have a Part which have MDirtyable field and @Persist method.
>
> I want to implement the similar behavior as
> ISaveablePart2#promptToSaveOnClose() is returning an CANCEL.
>
> That is, When a Part will be closed,
> 1) First, prompt to user to select save, do not save or cancel.
> 2) If cancel is selected, quit @Persist method and not close this Part.
>
> Actually, validate unsaved data before to prompt to user. And if
> validate is failed, I want to quit @Persist method and do not want to
> close the Part.
>
> For that reason, I cannot use the default
> ISaveHandler#promptToSave(MPart) which is set to
> WindowContext(IEclipseContext).
>
>
> Does anyone have an idea to solve this?
>
> Thanks,
> Ken
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05714 seconds