Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Disposal of CTabItem
Disposal of CTabItem [message #444632] Mon, 18 October 2004 13:36 Go to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
Hi

I want to make a functionality on tabitems like in Eclipse, that if you
close an "unsaved" tab, then the user will be asked if he wants to save or
not. Which listener do I use here? I tried with a DisposeListener, but then
the tab always gets disposed.

Any help I can get is appreciated.

/Henrik
Re: Disposal of CTabItem [message #444634 is a reply to message #444632] Mon, 18 October 2004 14:41 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Use CTabFolder.addCTabFolder2Listener:

public interface CTabFolder2Listener extends SWTEventListener {
/**
* Sent when the user clicks on the close button of an item in the
CTabFolder.
* The item being closed is specified in the event.item field.
* Setting the event.doit field to false will stop the CTabItem from closing.
* When the CTabItem is closed, it is disposed. The contents of the
* CTabItem (see CTabItem.setControl) will be made not visible when
* the CTabItem is closed.
*
* @param event an event indicating the item being closed
*/
public void close(CTabFolderEvent event);


"Henrik Skovgaard" <hsk@reklamedata.dk> wrote in message
news:cl0ghp$4qq$1@eclipse.org...
> Hi
>
> I want to make a functionality on tabitems like in Eclipse, that if you
> close an "unsaved" tab, then the user will be asked if he wants to save or
> not. Which listener do I use here? I tried with a DisposeListener, but
> then the tab always gets disposed.
>
> Any help I can get is appreciated.
>
> /Henrik
>
Re: Disposal of CTabItem [message #444649 is a reply to message #444634] Tue, 19 October 2004 09:04 Go to previous message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:cl0kbm$e0u$1@eclipse.org...
> Use CTabFolder.addCTabFolder2Listener:
>

Thanks for your help ! :-)

/Henrik
Previous Topic:MessageBox position
Next Topic:SWT / MVC and menu listeners
Goto Forum:
  


Current Time: Thu Mar 28 21:05:40 GMT 2024

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

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

Back to the top