|
|
Re: How to set WindowCloseHandler [message #1691376 is a reply to message #1691372] |
Mon, 06 April 2015 18:20 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Hi,
I went ahead, filed the bug [1] and fixed it - as you note the fix is
very simple [2] and if you need that in 1.2.0 you can backport it
yourself or if you'd have support contract with BestSolution.at you
could request a back port and a new build.
Tom
[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=463984
[2]http://git.eclipse.org/c/efxclipse/org.eclipse.efxclipse.git/commit/?id=494e15e972076b974ce199767977ae327235dbf2
On 06.04.15 19:58, Tom Schindl wrote:
> Looks like we are not honoring this as of today - please file a bug so
> that we can fix this with 2.0.
>
> Unfortunately not even our lifecycle stuff is attached to windows
> (another "bug") so as of today I'm afraid the only option is to role
> your own WindowRenderer (by subclassing DefWindowRenderer) or another
> option is to provide custom window-rendering through FXML where you hook
> the close button?
>
> Tom
>
> On 06.04.15 12:21, Thomas Schäfer wrote:
>> Hi,
>> I've got a little problem with IWindowCloseHandler in my application.
>> Set up: efxclipse nightly, Windows 7, JDK8 Update40
>>
>> Scenario: After the user terminates my RCP application by clicking the
>> exit Button (default exit Button in the RCP 'main' Trimmed Window) the
>> user should be presented with a dialog if he really wants to exit the
>> application.
>> Therefore I used to add in my former SWT application an
>> IWindowCloseHandler like this:
>> @Inject
>> MApplication app;
>>
>> private void setApplicationExitDialog() {
>> MWindow window = (MWindow) modelService.find(MY_APP_WINDOW_ID, app);
>> window.getContext().set(IWindowCloseHandler.class, new
>> MyWindowCloseHandler());
>> }
>>
>> When I try this approach in efxclipse "MyWindowCloseHandler" never gets
>> invoked.
>>
>> public class WindowCloseHandler implements IWindowCloseHandler {
>>
>> private static final Logger LOGGER =
>> Logger.getLogger(WindowCloseHandler.class.getName());
>>
>> @Override
>> public boolean close(MWindow window) {
>> LOGGER.info("WindowCloseHandler");
>> return false;
>> }
>> }
>>
>> I would be glad for any advice how to realize a WindowCloseHandler or
>> something similar with efxclipse.
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05565 seconds