Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to add one warning msg before close CTabItem/CTabFolder(before close one CTabItem,give user option to cancel it.)
How to add one warning msg before close CTabItem/CTabFolder [message #1771266] Wed, 23 August 2017 14:01 Go to next message
Gary Shi is currently offline Gary ShiFriend
Messages: 20
Registered: July 2013
Junior Member
I have one stand alone Java SWT application and CTabFolder and CTabItem items were used. When user try to close one CTabItem by click on "X" icon beside CTabItem title, I want to pop up one window and give user option to cancel this action. No idea how to do it. Don't know how to add listener to CTabItem. I can add one listener for CTabFolder and orverride close function, but I only can do some thing before closing. I can not cancel this action. Thanks. Gary

folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
	@Override
		public void close (CTabFolderEvent event) {
		    System.out.println(" Open popup window here, and do some thing");
                    System.out.println("can not cancel this action ?");
       }
}
Re: How to add one warning msg before close CTabItem/CTabFolder [message #1771267 is a reply to message #1771266] Wed, 23 August 2017 14:17 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Many SWT events have a special flag called "doit". Setting its value to false prevents further processing of the listener chain.
DId you try CTabFolderEvent.doit = false in your close method?
Re: How to add one warning msg before close CTabItem/CTabFolder [message #1771711 is a reply to message #1771267] Tue, 29 August 2017 19:10 Go to previous message
Gary Shi is currently offline Gary ShiFriend
Messages: 20
Registered: July 2013
Junior Member
Erdal Karaca, Thanks for your help. You are right. It solved my issue.
Previous Topic:How to make bottom of composite new "zero" point for GUI
Next Topic:adding wizardPages dynamically
Goto Forum:
  


Current Time: Thu Apr 25 17:07:26 GMT 2024

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

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

Back to the top