Hi RCP developers,
I want to iplement postWindowClose()
in my ECLIPSE RCP application.
Before coding this method, I just did a small test to see if when I close my application, the method is called, so I did that :
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
public class MainWindowControl extends WorkbenchWindowAdvisor{
public MainWindowControl(IWorkbenchWindowConfigurer configurer) {
super(configurer);
// TODO Auto-generated constructor stub
}
@Override
public void postWindowClose() {
// TODO Auto-generated method stub
super.postWindowClose();
System.out.println("close");
}
}
I am expecting to see : close
in ECLIPSE console, but it's still blank after closing the application.
All the required plugins are added , and I have no error while launching or closing the application.
So, AM I missing something ?
The reasons why to implemets this method are :
- Msg box :
Are you sure you want to close the application
- Kill all the running threads, my application upload files and even when I close the application running uploads continues. I want to abort them when closing the application.
Edit :
My life cycle class :
package upload.center.util;
import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate;
import org.eclipse.e4.ui.workbench.lifecycle.PreSave;
public class WindowLifeCycle {
@PostContextCreate
public void postContextCreate()
{
// TODO start up code here
System.out.println("open");
}
@PreSave
public void preSave()
{
// TODO add shutdown code here
System.out.println("close");
}
}
My plugin.xml :
<product ....
<property
name="windowLifeCycle"
value="bundleclass://UploadCenter.Source/upload.center.util.WindowLifeCycle">
</property>
...</product>
I hope that I am clear enough.
Ismail