How to forestall the window closing [message #922580] |
Tue, 25 September 2012 02:17  |
Eclipse User |
|
|
|
I need (I think not only I am) to handle a moment when the main window (or application) can be closed and to cancel this attempt if it is necessary. In eclipse 3.x it was the method
boolean preWindowShellClose()
in WorkbenchWindowAdvisor class. It was enough convenient.
For parts there are URI classes with life cycle methods with annotations such as @PostConstruct. I hoped that similar classes should be for application and windows too. But it is not provided for.
Some articles recommends to use IWindowCloseHandler added to window context. But it is ununderstandable when it is possible to add this interface. In every case when the application starts, the window context is equal to null.
In result I have added this interface in the @PostConstruct method of URI class of one of parts. But I think it is not competent way.
Do you know the correct solution for such cases?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.11845 seconds