Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to access view page data/object from CTabFolder event(Need to save view page data when user click CTabItem close icon)
How to access view page data/object from CTabFolder event [message #1771186] Tue, 22 August 2017 17:45
Gary Shi is currently offline Gary ShiFriend
Messages: 21
Registered: July 2013
Junior Member
I have one stand alone Java SWT application and CTabFolder/CTabItem items were used. There are many classes in this application and here are 2 classes for my explanation: Class 1 is main class and CTabFolder/CTabItem were in this classes. Class 2 is view class and it extends ViewPart implements ISaveablePart. Class 2 was instanced for creating one CTabItem. When user want to close one CTabItem, how to access view class data (Class 2) and need to save data before closing CTabItem from CTabFolder/CTabItem event/(listener).
In another word, when user click close icon/button, I can catch this event in Class 1, but how to get/access Class 2 object and data and save these data ?
I can catch this event in below coding:
Thanks. Gary

folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
	@Override
		public void close (CTabFolderEvent event) {
		    System.out.println(" Open popup window, and do some thing");
                    System.out.println("can not access ViewPart  (Class 2) object/data and save them");
       }
}	

[Updated on: Tue, 22 August 2017 21:11]

Report message to a moderator

Previous Topic:Can one have the button label below the button icon?
Next Topic:How to implement close function for CTabItem
Goto Forum:
  


Current Time: Wed Dec 13 11:27:32 GMT 2017

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

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