Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » FX Application startup & threads
FX Application startup & threads [message #1386051] Fri, 13 June 2014 08:37 Go to next message
Sun Volland is currently offline Sun VollandFriend
Messages: 29
Registered: September 2010
Junior Member
Hi,

We noticed that all the E4 FX application startup (more precisely, the application model initialization) happens in the FX event thread : model assembling, processor & addons executions, etc.
During this process, we wanted to keep a login dialog visible and alive (i.e. showing a progress indicator), so we modified the E4Application.jfxStart() method to do all this in another thread, and finally just run the workbench.createAndRunUI() in the FX thread.

This works fine for us and has the following advantages :
- the FX thread can continue UI rendering during the startup phase (i.e. our login dialog can continue show progress information)
- In the case custom addons/processors are long to execute (e.g. requiring remote services, etc.), this allows to follow progress on a UI
- when closing the "progress UI" on the applicationRunning event, main UI shows up quasi instantly.

What changes is that (may not be exhaustive) addons, processors and lifecycle methods @processRemovals and @processAdditions do no more run on the UI thread, but we guess this is not really a problem as no rendering operation should performed there.

As said this works fine for us, does one see any problem this could lead to, or use cases this could break ?
If not, couldn't this be an enhancement ?

Our modified E4Application.jfxStart() method below :

	@Override
	protected void jfxStart(IApplicationContext applicationContext, Application jfxApplication, Stage primaryStage) {
		Runnable startRunnable = new Runnable() {
            @Override
            public void run() {
                workbench = createE4Workbench(applicationContext, jfxApplication, primaryStage);
                if (workbench != null) {
                    instanceLocation = (Location) workbench.getContext().get(E4Workbench.INSTANCE_LOCATION);

                    try {
                        if (!checkInstanceLocation(instanceLocation)) {
                            return;
                        }

                        workbenchContext = workbench.getContext();

                        // Create and run the UI (if any)
                        UISynchronize uiSync = workbench.getContext().get(UISynchronize.class);
                        uiSync.syncExec(new Runnable() {
                            @Override
                            public void run() {
                                workbench.createAndRunUI(workbench.getApplication());
                            }
                        });

                    } finally {
                        applicationContext.applicationRunning();
                    }
                }
            }
        };
        Thread t = new Thread(startRunnable);
        t.start();
	}



Sun
Re: FX Application startup & threads [message #1386056 is a reply to message #1386051] Fri, 13 June 2014 09:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Sounds reasonable - file a bug and if possible provide a gerrit-review
and we can merge that in.

Maybe we should add the possibility for developers to define how the
start up process should be handled?

The only change i would make is to call
"applicationContext.applicationRunning(); " in the UI-Thread. The reason
for that is that people who use the Eclipse-Splash (only win32 users can
do that today!) need this method to be called on the launcher thread or
the splash will not close.

Tom

On 13.06.14 10:37, Sun Volland wrote:
> Hi,
>
> We noticed that all the E4 FX application startup (more precisely, the
> application model initialization) happens in the FX event thread : model
> assembling, processor & addons executions, etc.
> During this process, we wanted to keep a login dialog visible and alive
> (i.e. showing a progress indicator), so we modified the
> E4Application.jfxStart() method to do all this in another thread, and
> finally just run the workbench.createAndRunUI() in the FX thread.
>
> This works fine for us and has the following advantages :
> - the FX thread can continue UI rendering during the startup phase (i.e.
> our login dialog can continue show progress information)
> - In the case custom addons/processors are long to execute (e.g.
> requiring remote services, etc.), this allows to follow progress on a UI
> - when closing the "progress UI" on the applicationRunning event, main
> UI shows up quasi instantly.
>
> What changes is that (may not be exhaustive) addons, processors and
> lifecycle methods @processRemovals and @processAdditions do no more run
> on the UI thread, but we guess this is not really a problem as no
> rendering operation should performed there.
>
> As said this works fine for us, does one see any problem this could lead
> to, or use cases this could break ? If not, couldn't this be an
> enhancement ?
>
> Our modified E4Application.jfxStart() method below :
>
>
> @Override
> protected void jfxStart(IApplicationContext applicationContext,
> Application jfxApplication, Stage primaryStage) {
> Runnable startRunnable = new Runnable() {
> @Override
> public void run() {
> workbench = createE4Workbench(applicationContext,
> jfxApplication, primaryStage);
> if (workbench != null) {
> instanceLocation = (Location)
> workbench.getContext().get(E4Workbench.INSTANCE_LOCATION);
>
> try {
> if (!checkInstanceLocation(instanceLocation)) {
> return;
> }
>
> workbenchContext = workbench.getContext();
>
> // Create and run the UI (if any)
> UISynchronize uiSync =
> workbench.getContext().get(UISynchronize.class);
> uiSync.syncExec(new Runnable() {
> @Override
> public void run() {
>
> workbench.createAndRunUI(workbench.getApplication());
> }
> });
>
> } finally {
> applicationContext.applicationRunning();
> }
> }
> }
> };
> Thread t = new Thread(startRunnable);
> t.start();
> }
>
>
>
> Sun
>
Re: FX Application startup & threads [message #1386343 is a reply to message #1386056] Mon, 16 June 2014 18:54 Go to previous messageGo to next message
Sun Volland is currently offline Sun VollandFriend
Messages: 29
Registered: September 2010
Junior Member
Opened Bug 437541
Re: FX Application startup & threads [message #1386390 is a reply to message #1386343] Tue, 17 June 2014 10:08 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Great Idea Smile. This would solve a problem I've been thinking about. What I would like to achieve is:
- Optionally show a login window and wait for the user to enter his credentials
- After a successfull login: close the login window and display a loading screen with updateable information
- close the loadings screen when the application is up

I've been playing around with this and I'm having some strange issues I can't quite place. For a quick test I started with "-createWorkbenchOnNonUIThread" and did the following:

private LoginData loginData;
	
@PostContextCreate
Boolean postContextCreate(ILoginService loginService, UISynchronize sync) {
	sync.syncExec(new Runnable() {
		@Override
		public void run() {
			loginData = loginService.login();
		}
	});
	
	if (loginData != null) {
		... open loading screen using Platform.runLater ...
		... start initialization of data ...
		
		return true;
	}
	return false;
}

This works perfectly, when loginService.login() does not open a stage (which is the case when the credetials have been saved and an automatic login is possible).

In the other case the login stage is opened and the user can enter his information. After the successfull login the application crashes with
Exception in thread "Thread-7" java.lang.NullPointerException
	at org.eclipse.fx.ui.di.internal.LoggerSupplier.get(LoggerSupplier.java:41)
	at org.eclipse.e4.core.internal.di.InjectorImpl.resolveArgs(InjectorImpl.java:456)
	at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:397)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:109)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.fx.ui.workbench.base.AbstractE4Application.loadApplicationModel(AbstractE4Application.java:304)
	at org.eclipse.fx.ui.workbench.base.AbstractE4Application.createE4Workbench(AbstractE4Application.java:193)
	at org.eclipse.fx.ui.workbench.fx.E4Application.initE4Workbench(E4Application.java:246)
	at org.eclipse.fx.ui.workbench.fx.E4Application$1.run(E4Application.java:132)
	at java.lang.Thread.run(Thread.java:745)

When I set a breakpoint on
if (data != null)
and start in debug mode the breakpoint is never reached but I don't see any exception either.

Any ideas on whats goin wrong? Am I misusing the UISnchronizer?
Any pointers are very welcome Smile
Re: FX Application startup & threads [message #1386394 is a reply to message #1386390] Tue, 17 June 2014 10:20 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
After posting this, I think I came up with the answer myself: UISynchronize.syncExec will internally use Platform.runLater, so the code is scheduled to be executed after the initialization of the application, which has already shut down since there was nothing to do.
Re: FX Application startup & threads [message #1386399 is a reply to message #1386394] Tue, 17 June 2014 10:32 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Would it make sense to call @PostContextCreate on the ui thread?
I did a quick test and it resolves my issue.
What do you think?
Re: FX Application startup & threads [message #1386400 is a reply to message #1386399] Tue, 17 June 2014 10:33 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes - it is the normal place to show UI so it should be called on the
UI-Thread!

Tom

On 17.06.14 12:32, Christoph Keimel wrote:
> Would it make sense to call @PostContextCreate on the ui thread? I did a
> quick test and it resolves my issue. What do you think?
Re: FX Application startup & threads [message #1386406 is a reply to message #1386400] Tue, 17 June 2014 11:07 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
I opened a bug and will propose a fix shortly:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=437584
Re: FX Application startup & threads [message #1386411 is a reply to message #1386400] Tue, 17 June 2014 11:31 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Generally speaking I'd like to have a possibility when stuff is invoked
via CIF.invoke to mark that the method has to called on the UI-Thread in
a syny/async fashion.

I dream of something like this:

@Execute
@UISync
public String bla() {
}

and

@Execute
@UIAsync
public Future<String> bla() {
}

Tom

On 17.06.14 12:33, Tom Schindl wrote:
> Yes - it is the normal place to show UI so it should be called on the
> UI-Thread!
>
> Tom
>
> On 17.06.14 12:32, Christoph Keimel wrote:
>> Would it make sense to call @PostContextCreate on the ui thread? I did a
>> quick test and it resolves my issue. What do you think?
>
Re: FX Application startup &amp;amp; threads [message #1386420 is a reply to message #1386411] Tue, 17 June 2014 12:52 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
That would be realy nice Smile
Re: FX Application startup &amp; threads [message #1386451 is a reply to message #1386390] Tue, 17 June 2014 16:02 Go to previous messageGo to next message
Sun Volland is currently offline Sun VollandFriend
Messages: 29
Registered: September 2010
Junior Member
Christoph Keimel wrote on Tue, 17 June 2014 06:08
What I would like to achieve is:
- Optionally show a login window and wait for the user to enter his credentials
- After a successfull login: close the login window and display a loading screen with updateable information
- close the loadings screen when the application is up


That's what we are doing, but we solved the postcontextcreate problem by setting a lock that blocks the non-ui thread in postcontextcreate after showing the login dialog. Once the login dialog confirms authentication, we unlock.
This enables us to keep the same dialog open, unlock the startup thread on authentication and continue showing progress information in the same dialog (no need to open another loading dialog)

I'm not sure if this is still doable (meaning keeping the same dialog open) with postContextCreate directly called on the UI-thread

Re: FX Application startup &amp;amp; threads [message #1386454 is a reply to message #1386451] Tue, 17 June 2014 16:14 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I merged the change from christoph - give it a spin if it allows you to
do what you want - i think opening UI in the postcontext-create is a
very common use case - if this does not suite you need to i think we
need to have more options:
* runAllOnUIThread
* runModelLoadingExtraThread == @PostContextCreate is run on UI-Thread
* runAllOnExtraThread

Tom

On 17.06.14 18:02, Sun Volland wrote:
> Christoph Keimel wrote on Tue, 17 June 2014 06:08
>> What I would like to achieve is:
>> - Optionally show a login window and wait for the user to enter his
>> credentials
>> - After a successfull login: close the login window and display a
>> loading screen with updateable information
>> - close the loadings screen when the application is up
>
>
> That's what we are doing, but we solved the postcontextcreate problem by
> setting a lock that blocks the non-ui thread in postcontextcreate after
> showing the login dialog. Once the login dialog confirms authentication,
> we unlock.
> This enables us to keep the same dialog open, unlock the startup thread
> on authentication and continue showing progress information in the same
> dialog (no need to open another loading dialog)
>
> I'm not sure if this is still doable (meaning keeping the same dialog
> open) with postContextCreate directly called on the UI-thread
>
>
Re: FX Application startup &amp;amp; threads [message #1386456 is a reply to message #1386454] Tue, 17 June 2014 16:22 Go to previous messageGo to next message
Sun Volland is currently offline Sun VollandFriend
Messages: 29
Registered: September 2010
Junior Member
I'll look at this in detail tomorrow, but I guess the 3 options would be useful.

Sun.
Re: FX Application startup &amp;amp;amp; threads [message #1386537 is a reply to message #1386456] Wed, 18 June 2014 07:56 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I don't think that we need this. If I get you right you want the following:

Stage s;
boolean loginState;

@PostContextCreate
boolean bla(IEventBroker broker) {
s = new Stage();
borker.subscribe("....", this::hide)
// ...
s.open(); // note this is NONE blocking
// block until e.g. login is done
// show splash with informations in the stage
return loginState;
}

public void hide() {
s.close();
}

Now to make this block stuff as easy as possible I've added a new method
to UISynchronize so that you can make the above code:

@PostContextCreate
boolean bla(IEventBroker broker, UISynchronize sync) {
BlockCondition<Boolean> c = new BlockCondition<>();
s = new Stage();
borker.subscribe("....", this::hide)
// ...

s.open(); // note this is NONE blocking
loginState = sync.block(c);

// show splash with informations in the stage
return loginState;
}

On 17.06.14 18:22, Sun Volland wrote:
> I'll look at this in detail tomorrow, but I guess the 3 options would be
> useful.
>
> Sun.
Re: FX Application startup &amp;amp;amp; threads [message #1386550 is a reply to message #1386537] Wed, 18 June 2014 08:45 Go to previous messageGo to next message
Sun Volland is currently offline Sun VollandFriend
Messages: 29
Registered: September 2010
Junior Member
This is effectively what I want to do, but If I'm right
loginState = sync.block(c); 

is still called on the UI thread, and will freeze the login dialog, or do I miss something ?
Re: FX Application startup &amp;amp;amp;amp; threads [message #1386553 is a reply to message #1386550] Wed, 18 June 2014 08:55 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
no it will not freeze - it enters an inner event loop similar to what
you have in swt with

while(<condition>) { if( !d.readAndDispatch() ) { d.sleep() } ) }

So you stop the programm execution but your UI still runs on and process
events ;-)

Tom

On 18.06.14 10:45, Sun Volland wrote:
> This is effectively what I want to do, but If I'm right
> loginState = sync.block(c);
> is still called on the UI thread, and will freeze the login dialog, or
> do I miss something ?
Re: FX Application startup &amp;amp;amp;amp; threads [message #1386555 is a reply to message #1386553] Wed, 18 June 2014 09:07 Go to previous messageGo to next message
Sun Volland is currently offline Sun VollandFriend
Messages: 29
Registered: September 2010
Junior Member
great feature Smile

Is it already pushed somewhere ?

Thanks,
Sun
Re: FX Application startup &amp;amp;amp;amp;amp; threads [message #1386560 is a reply to message #1386555] Wed, 18 June 2014 09:23 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes its in master with https://bugs.eclipse.org/bugs/show_bug.cgi?id=437642

Tom

On 18.06.14 11:07, Sun Volland wrote:
> great feature :)
>
> Is it already pushed somewhere ?
>
> Thanks,
> Sun
Re: FX Application startup &amp;amp; threads [message #1386563 is a reply to message #1386411] Wed, 18 June 2014 09:27 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Tom,

I had a look at extending CIF the way you proposed below, because that would also elegantly solve this issue. I was thinking about extending the IInjector with the proposed functionality. This seems to be rather difficult at the moment, since the IInjector used in CIF is implemented as a Singleton.

final private static IInjector injector = InjectorFactory.getDefault();

I created a proposal to publish IInjector as an OSGi service upstream:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=437657

This would enable us to create an extended service, no? Or am I missing something in my train of thought?

Smile,
Christoph

Thomas Schindl wrote on Tue, 17 June 2014 13:31
Generally speaking I'd like to have a possibility when stuff is invoked
via CIF.invoke to mark that the method has to called on the UI-Thread in
a syny/async fashion.

I dream of something like this:

@Execute
@UISync
public String bla() {
}

and

@Execute
@UIAsync
public Future<String> bla() {
}

Tom
Re: FX Application startup &amp;amp;amp; threads [message #1386572 is a reply to message #1386563] Wed, 18 June 2014 09:54 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I think the solution must be different - I'm not sure we could get that
from upstream but we could implement it on our ScopedObjectFactory
ourselves for now.

The really important code is at - InjectorImpl.invokeUsingClass() we
could copy that code to our own factory and read the meta informations
about invocation.

I'll try to prototype this later on to see if it is possible, maybe we
could convince upstream that they modify their code a bit so that adding
a method

public MethodRequestor invokeUsingClass(Object userObject, Class<?>
currentClass, Class<? extends Annotation> qualifier, Object
defaultValue, PrimaryObjectSupplier objectSupplier,
PrimaryObjectSupplier tempSupplier, boolean throwUnresolved) {
// ...
}

so that we don't have to duplicate stuff - naturally we are with that
outside the API scope and I don't know if we have access to all APIs we
need without residing to reflection.

Tom

On 18.06.14 11:27, Christoph Keimel wrote:
> Hi Tom,
>
> I had a look at extending CIF the way you proposed below, because that
> would also elegantly solve this issue. I was thinking about extending
> the IInjector with the proposed functionality. This seems to be rather
> difficult at the moment, since the IInjector used in CIF is implemented
> as a Singleton.
>
> final private static IInjector injector = InjectorFactory.getDefault();
> I created a proposal to publish IInjector as an OSGi service upstream:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=437657
>
> This would enable us to create an extended service, no? Or am I missing
> something in my train of thought?
>
> Smile,
> Christoph
>
> Thomas Schindl wrote on Tue, 17 June 2014 13:31
>> Generally speaking I'd like to have a possibility when stuff is invoked
>> via CIF.invoke to mark that the method has to called on the UI-Thread in
>> a syny/async fashion.
>>
>> I dream of something like this:
>>
>> @Execute
>> @UISync
>> public String bla() {
>> }
>>
>> and
>>
>> @Execute
>> @UIAsync
>> public Future<String> bla() {
>> }
>>
>> Tom
>
Re: FX Application startup &amp;amp;amp; threads [message #1693749 is a reply to message #1386572] Tue, 28 April 2015 06:31 Go to previous messageGo to next message
Bastien Bart is currently offline Bastien BartFriend
Messages: 21
Registered: May 2014
Junior Member
No Message Body
Re: FX Application startup &amp;amp;amp; threads [message #1693750 is a reply to message #1386572] Tue, 28 April 2015 06:32 Go to previous messageGo to next message
Bastien Bart is currently offline Bastien BartFriend
Messages: 21
Registered: May 2014
Junior Member
The class "BlockCondition" has been removed? Cant fint it anymore in org.eclipse.fx.ui.services.sync.UISynchronize
Re: FX Application startup &amp;amp;amp;amp; threads [message #1693761 is a reply to message #1693750] Tue, 28 April 2015 08:23 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Yes - but I'm missing the context why this harms you.

Tom

On 28.04.15 08:32, Bastien Bart wrote:
> The class "BlockCondition" has been removed? Cant fint it anymore in
> org.eclipse.fx.ui.services.sync.UISynchronize
Re: FX Application startup &amp;amp;amp;amp; threads [message #1693763 is a reply to message #1693761] Tue, 28 April 2015 08:53 Go to previous messageGo to next message
Bastien Bart is currently offline Bastien BartFriend
Messages: 21
Registered: May 2014
Junior Member
I used it to handle my login stage

@PostContextCreate
boolean login(IEventBroker broker, UISynchronize sync, IEclipseContext pEclipseContext) {
boolean loginState;

BlockCondition<Boolean> blockCondition = new BlockCondition<>();
splashService = new LoginStage();

splashService.open(pEclipseContext);

splashService.loggedProperty().addListener(change -> {
if(splashService.isLogged()) {
blockCondition.release(true);
}
} );
loginState = sync.block(blockCondition);

broker.subscribe(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE, event -> splashService.close());
broker.subscribe(ConstantsUi.UIEvents.START_STEP, event -> {
if(event.containsProperty("org.eclipse.e4.data")) {
splashService.setMessage((String) event.getProperty("org.eclipse.e4.data"));
}
} );
// return true;
splashService.open(eclipseContext);
}

There is an other way?

Thanks a lot

[Updated on: Tue, 28 April 2015 08:55]

Report message to a moderator

Re: FX Application startup &amp;amp;amp;amp;amp; threads [message #1693774 is a reply to message #1693763] Tue, 28 April 2015 10:02 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
------8<------
splashService = new LoginStage();
splashService.loggedProperty().addListener(change -> {
if(splashService.isLogged()) {
splashService.close();
}
} );

splashService.showAndWait();
------8<------

Maybe we should allow to return a Future<LifecycleRV> as well in future?
Blocking APIs should be used as less as possible in modern applications.

The reason we removed BlockCondition is that we had to use internal APIs
of JavaFX to make it work and since the next release is 2.0 where we can
break APIs we decided to break it now and not wait for JDK9 to break the
API because we won't be able to access internal APIs with the new module
system.

Tom

On 28.04.15 10:53, Bastien Bart wrote:
> I used it to handle my login stage
>
> @PostContextCreate
> boolean login(IEventBroker broker, UISynchronize sync,
> IEclipseContext pEclipseContext) {
> boolean loginState;
>
> BlockCondition<Boolean> blockCondition = new BlockCondition<>();
> SplashServiceImpl stage = new SplashServiceImpl();
> splashService = new LoginStage();
>
> splashService.open(pEclipseContext);
>
> splashService.loggedProperty().addListener(change -> {
> if(splashService.isLogged()) {
> blockCondition.release(true);
> }
> } );
> loginState = sync.block(blockCondition);
>
> broker.subscribe(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE, event
> -> splashService.close());
> broker.subscribe(ConstantsUi.UIEvents.START_STEP, event -> {
> if(event.containsProperty("org.eclipse.e4.data")) {
> splashService.setMessage((String)
> event.getProperty("org.eclipse.e4.data"));
> }
> } );
> // return true;
> splashService.open(eclipseContext);
> }
>
> There is an other way?
>
> Thanks a lot
Re: FX Application startup &amp;amp;amp;amp;amp; threads [message #1693799 is a reply to message #1693774] Tue, 28 April 2015 11:52 Go to previous messageGo to next message
Bastien Bart is currently offline Bastien BartFriend
Messages: 21
Registered: May 2014
Junior Member
I launch my app with -createWorkbenchOnNonUIThread argument.

I want to block the loading of the workbench while my user is not logged (OK with your solution)
But I want my login stage stays opened during the loading of the workbench. And that's not possible with the showAndWait method

1) Show login stage and block workbench launching
2) the user connects
3) The workbench launchs but the stage is still visible and shows launchings messages
4) Workbench loading done -> close the login stage

There is a way to get this?

I think i'm not the only one who'd like a solution...
Thanks a lot for your help
Re: FX Application startup &amp;amp;amp;amp;amp;amp; threads [message #1694138 is a reply to message #1693799] Thu, 30 April 2015 20:27 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 28.04.15 13:52, Bastien Bart wrote:
> I launch my app with -createWorkbenchOnNonUIThread argument.
>
> I want to block the loading of the workbench while my user is not logged
> (OK with your solution)
> But I want my login stage stays opened during the loading of the
> workbench. And that's not possible with the showAndWait method
>
> 1) Show login stage and block workbench launching
> 2) the user connects
> 3) The workbench launchs but the stage is still visible and shows
> launchings messages
> 4) Workbench loading done -> close the login stage
>
> There is a way to get this?
>

Only with the internal API that has been used by the block
implementation - so you need to call

Toolkit.getToolkit().enterNestedEventLoop(...);
Toolkit.getToolkit().exitNestedEventLoop(...);

yourself

> I think i'm not the only one who'd like a solution...
> Thanks a lot for your help
>

Tom
Previous Topic:How to avoid overlay in Part sash container on resizing the window?
Next Topic:org.eclipse.e4.core.di.annotations no longer available in nightly build ?
Goto Forum:
  


Current Time: Wed Feb 05 09:50:47 GMT 2025

Powered by FUDForum. Page generated in 0.07008 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top