How to access view page data/object from CTabFolder event [message #1771186] |
Tue, 22 August 2017 17:45 |
Gary Shi Messages: 20 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
|
|
|
Powered by
FUDForum. Page generated in 0.03659 seconds