Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » custom close dialog for an editor
custom close dialog for an editor [message #253915] Fri, 18 June 2004 14:48 Go to next message
Dan Winterstein is currently offline Dan WintersteinFriend
Messages: 33
Registered: July 2009
Member
How can you control the close cycle for an editor?

I have an editor (a text editor if that's relevant) that, due to it's
effects on other resources, needs to confirm closure with the user even
if it isn't dirty. I cannot work out how to interrupt and control the
closing of the editor.

TextEditor.close() doesn't seem to get called at all.
TextEditor.dispose() is called too late in the close cycle

Perhaps I need to change WorkbenchPage.closeEditor(), but I don't know
how to subclass WorkbenchPage (i.e. where to slot the subclass in).

Thanks,
- Daniel

-----------------------------------------------
To see a World in a Grain of Sand
And a Heaven in a Wild Flower,
Hold Infinity in the palm of your hand
And Eternity in an hour.

Daniel Winterstein
2F2, 12 Lonsdale Terrace
Edinburgh, EH3 9HN
Re: custom close dialog for an editor [message #254260 is a reply to message #253915] Mon, 21 June 2004 14:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nick_edgar._no.spam.please_.ca.ibm.com

Sorry, there is currently no lifecycle for allowing editors to do this, and
WorkbenchPage cannot be subclassed.
Please file an enhancement request against Platform-UI, and provide details
about your scenario.
https://bugs.eclipse.org/bugs/enter_bug.cgi

Nick

"Daniel" <danielw@dai.ed.ac.uk> wrote in message
news:cauvbt$ft4$1@eclipse.org...
>
> How can you control the close cycle for an editor?
>
> I have an editor (a text editor if that's relevant) that, due to it's
> effects on other resources, needs to confirm closure with the user even
> if it isn't dirty. I cannot work out how to interrupt and control the
> closing of the editor.
>
> TextEditor.close() doesn't seem to get called at all.
> TextEditor.dispose() is called too late in the close cycle
>
> Perhaps I need to change WorkbenchPage.closeEditor(), but I don't know
> how to subclass WorkbenchPage (i.e. where to slot the subclass in).
>
> Thanks,
> - Daniel
>
> -----------------------------------------------
> To see a World in a Grain of Sand
> And a Heaven in a Wild Flower,
> Hold Infinity in the palm of your hand
> And Eternity in an hour.
>
> Daniel Winterstein
> 2F2, 12 Lonsdale Terrace
> Edinburgh, EH3 9HN
>
Re: custom close dialog for an editor [message #254494 is a reply to message #253915] Tue, 22 June 2004 08:09 Go to previous message
Eclipse UserFriend
Originally posted by: naficbm.1net.gr

maybe
editor.getEditorPart.getWorkbenchWindow.addPageListener()
can help.

Daniel wrote:

>
> How can you control the close cycle for an editor?
>
> I have an editor (a text editor if that's relevant) that, due to it's
> effects on other resources, needs to confirm closure with the user even
> if it isn't dirty. I cannot work out how to interrupt and control the
> closing of the editor.
>
> TextEditor.close() doesn't seem to get called at all.
> TextEditor.dispose() is called too late in the close cycle
>
> Perhaps I need to change WorkbenchPage.closeEditor(), but I don't know
> how to subclass WorkbenchPage (i.e. where to slot the subclass in).
>
> Thanks,
> - Daniel
>
> -----------------------------------------------
> To see a World in a Grain of Sand
> And a Heaven in a Wild Flower,
> Hold Infinity in the palm of your hand
> And Eternity in an hour.
>
> Daniel Winterstein
> 2F2, 12 Lonsdale Terrace
> Edinburgh, EH3 9HN
>
Previous Topic:font displayed incorrectly
Next Topic:TreeItems
Goto Forum:
  


Current Time: Fri Apr 26 16:42:23 GMT 2024

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

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

Back to the top