Skip to main content



      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 10:01 Go to next message
Eclipse UserFriend
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 10:17 Go to previous messageGo to next message
Eclipse UserFriend
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 15:10 Go to previous message
Eclipse UserFriend
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: Tue Jul 08 22:00:17 EDT 2025

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

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

Back to the top