Restarting RCP application [message #1172353] |
Tue, 05 November 2013 16:54  |
Eclipse User |
|
|
|
Hi all,
perhaps it sounds a bit odd, but want to restart my application before
it gets visible.
Short explanation: I work on a product where the user can select the
working directory at first startup. This is achieved through a
LifecycleManager (@PostContextCreate), where I raise up a popup dialog.
The dialog is displayed correctly, but now I don't know how to restart
the workbench, since it isn't available. What I have is an
IApplicationContext and a Display. I know that IWorkbench now has a
restart() method, but I can't get an object for it. How can I do this?
Thanks in advance,
Ralf.
|
|
|
Re: Restarting RCP application [message #1173157 is a reply to message #1172353] |
Wed, 06 November 2013 05:23   |
Eclipse User |
|
|
|
Look at the implementation of IWorkbench#restart and do the same, in the
end we are setting some equinox stuff ;-)
Tom
On 05.11.13 22:54, Ralf Heydenreich wrote:
> Hi all,
> perhaps it sounds a bit odd, but want to restart my application before
> it gets visible.
> Short explanation: I work on a product where the user can select the
> working directory at first startup. This is achieved through a
> LifecycleManager (@PostContextCreate), where I raise up a popup dialog.
> The dialog is displayed correctly, but now I don't know how to restart
> the workbench, since it isn't available. What I have is an
> IApplicationContext and a Display. I know that IWorkbench now has a
> restart() method, but I can't get an object for it. How can I do this?
>
> Thanks in advance,
> Ralf.
>
|
|
|
|
Re: Restarting RCP application [message #1173327 is a reply to message #1173297] |
Wed, 06 November 2013 07:45  |
Eclipse User |
|
|
|
Hi,
I see the problem is that what you'd like is to have the
@PostContextCreate return a value. I don't see how you can achieve what
you want in 4.3 without rolling your own E4Application :-(
I think you should file a bugzilla requesting that:
@PostContextCreate returns a int which if not 0 is interpreted as the
return value for IApplication#start
Tom
On 06.11.13 13:23, Ralf Heydenreich wrote:
> Hi Tom,
> I thought about it. But if I look into E4Workbench (which is the only
> class that implements IWorkbench I found) I found the following:
>
>
> public boolean restart() {
> this.restart = true;
> return close();
> }
>
>
> and later
>
>
> public boolean close() {
> if (renderer != null) {
> renderer.stop();
> }
> if (uiEventPublisher != null && appModel != null) {
> ((Notifier) appModel).eAdapters().remove(uiEventPublisher);
> uiEventPublisher = null;
> }
> if (osgiRegistration != null) {
> osgiRegistration.unregister();
> osgiRegistration = null;
> }
> return true;
> }
>
>
> But in my application (or in the dialog which I've open) I can't access
> fields like osgiRegistration or (perhaps the most important) restart.
> But this is essential for restarting (at least I think that). Can you
> give me please some further hints about this?
>
> Ralf.
|
|
|
Powered by
FUDForum. Page generated in 0.11198 seconds