Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Swing desktop execClosing problem
Swing desktop execClosing problem [message #1148675] Mon, 21 October 2013 13:16 Go to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 280
Registered: August 2011
Senior Member
Hi,

I want to give the user a warning before the application closes. This works fine if I implement the method Desktop.execClosing() and the user uses the menu File->Exit. If the user uses the close button from the title bar the application just closes without warning.

Is there a way to make the message also works when the user uses the close button?

Regards Bertin

Re: Swing desktop execClosing problem [message #1149689 is a reply to message #1148675] Tue, 22 October 2013 04:34 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 529
Registered: October 2011
Senior Member
Hi Bertin,

I have tried to open a message box in execClosing:

Swing::windowClosing

!ENTRY org.eclipse.scout.rt.client 2 0 2013-10-22 10:31:04.893
!MESSAGE org.eclipse.scout.rt.client.ui.messagebox.MessageBox.startMessageBox(MessageBox.java:419) there is no desktop or the desktop has not yet been opened in the ui, default answer is CANCEL

Swing::windowClosed


From what I can tell, execClosing is called, but Scout isn't capable to open a UI Component like a message box (see log). Can you confirm that you also see this Log entry.

I need to check how you can implement your use-case.
Re: Swing desktop execClosing problem [message #1149907 is a reply to message #1149689] Tue, 22 October 2013 07:50 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 280
Registered: August 2011
Senior Member
Hi Jeremie,

thats exactly whats happening here. I added the message thats in my console:

!MESSAGE org.eclipse.scout.rt.client.ui.messagebox.MessageBox.startMessageBox(MessageBox.java:419) there is no desktop or the desktop has not yet been opened in the ui, default answer is CANCEL
Re: Swing desktop execClosing problem [message #1150116 is a reply to message #1149907] Tue, 22 October 2013 10:51 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 529
Registered: October 2011
Senior Member
Hi Berin,

I have analyzed your problem:

The Exit menu does:
@Override
public void execAction() throws ProcessingException {
  ClientSyncJob.getCurrentSession(ClientSession.class).stopSession();
}


The Closing Box does:
(org.eclipse.scout.rt.client.ui.desktop.AbstractDesktop.P_UIFacade.fireDesktopClosingFromUI())
@Override
public void fireDesktopClosingFromUI() {
  setOpenedInternal(false);
  ClientSyncJob.getCurrentSession().stopSession();
}


From what I see: setOpenedInternal(false) is wrong (or it should be done after stopSession()).

If you take it one step further, it seems to me that the AbstractDesktop#isOpened() is for nothing.

In Swing we use the WindowConstants#DO_NOTHING_ON_CLOSE constant (seems correct to me). When we come from the UI, the Desktop is still available...

Can you open a bug?
In the bug, indicate if you need a backport on an older version of Scout (3.9 or 3.8).

If should be possible to hack a workarround with your own UI-Facade. Tell me if you want indication to do so.

I hope it helps.

[Updated on: Tue, 22 October 2013 10:51]

Report message to a moderator

Re: Swing desktop execClosing problem [message #1151205 is a reply to message #1150116] Wed, 23 October 2013 03:34 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 280
Registered: August 2011
Senior Member
Created a bug for it. See bug 420139
Re: Swing desktop execClosing problem [message #1151235 is a reply to message #1151205] Wed, 23 October 2013 03:56 Go to previous message
Matthias Zimmermann is currently offline Matthias Zimmermann
Messages: 72
Registered: February 2010
Member
Thanks for the bug Bertin. We will try to schedule this bug for the Kepler SR2 release and appreciate if you will verify the bugfix when it is fixed.

General Remark
We will try to fix bugs that are critical to our adopters up to a SR2 release. Depending on your options and priorities you can then ask for bug fixes via paid services for old Scout releases or upgrade your applications to a more recent Scout version.

Please remember that this practice is not specific to Eclipse Scout but reflects the definition of the community based maintenance (defined until the SR2) of Eclipse projects participating in the release train.
Previous Topic:Page size on IOS 7 too big
Next Topic:LoginDialog example
Goto Forum:
  


Current Time: Mon Apr 21 11:50:37 EDT 2014

Powered by FUDForum. Page generated in 0.12722 seconds