Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Re: Confirm view closing.
Re: Confirm view closing. [message #337057] Sat, 25 July 2009 08:31 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Forwarding to eclipse.platform.

> A user clicks the small x in a view to close that view. What's the
> correct way to intercept this, so that I can ask for a confirmation to
> close the view etc.

I should probably add that the view I'm talking about is provided by my
plug-in so I'm able to modify the view implementation itself should that
be neccessary.

Thanks again,
Felix
Re: Confirm view closing. [message #337087 is a reply to message #337057] Mon, 27 July 2009 14:45 Go to previous messageGo to next message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 110
Registered: July 2009
Senior Member
On Sat, 25 Jul 2009 10:31:02 +0200, Felix Dorner wrote:

> Forwarding to eclipse.platform.
>
>> A user clicks the small x in a view to close that view. What's the
>> correct way to intercept this, so that I can ask for a confirmation to
>> close the view etc.
>
> I should probably add that the view I'm talking about is provided by my
> plug-in so I'm able to modify the view implementation itself should that
> be neccessary.
>
> Thanks again,
> Felix

When you own the perspective you can mark a view as not closable. But
when your view is brought up in a perspective not owned by you then I'm
not aware of a way to tell Eclipse to mark it not closable.

It is possible to listen for part events like close by implementing
IPartListener and calling getPartService().addPartListener().
Re: Confirm view closing. [message #468102 is a reply to message #337057] Tue, 04 August 2009 07:35 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Felix Dorner wrote:
> Forwarding to eclipse.platform.
>
>> A user clicks the small x in a view to close that view. What's the
>> correct way to intercept this, so that I can ask for a confirmation
>> to close the view etc.
See org.eclipse.ui.ISaveablePart2.promptToSaveOnClose()

Dani
>
> I should probably add that the view I'm talking about is provided by
> my plug-in so I'm able to modify the view implementation itself should
> that be neccessary.
>
> Thanks again,
> Felix
Re: Confirm view closing. [message #468267 is a reply to message #468102] Tue, 04 August 2009 18:36 Go to previous message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 110
Registered: July 2009
Senior Member
On Tue, 04 Aug 2009 09:35:17 +0200, Daniel Megert wrote:

> Felix Dorner wrote:
>> Forwarding to eclipse.platform.
>>
>>> A user clicks the small x in a view to close that view. What's the
>>> correct way to intercept this, so that I can ask for a confirmation to
>>> close the view etc.
> See org.eclipse.ui.ISaveablePart2.promptToSaveOnClose()
>
> Dani

Good solution, thanks Dani.
Previous Topic:Viewpart vs. Editorpart, proxy Editorpart, common Eclipse design question
Next Topic:thread from ant build does not exit
Goto Forum:
  


Current Time: Sat Dec 21 13:52:43 GMT 2024

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

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

Back to the top