Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [E4 Incubator] Creating Display in E4EntryPointFactory
[E4 Incubator] Creating Display in E4EntryPointFactory [message #1319944] Mon, 28 April 2014 13:40 Go to next message
M. Herrmann is currently offline M. HerrmannFriend
Messages: 25
Registered: March 2010
Junior Member
Hi,

I am using the E4 incubator project and I'm quite happy so far.
Thanks for the great work.

I have just one problem:
before I open the main application window, I sometimes need to display dialogs and stuff.

If I do that before displaying the application window this exception is thrown:

org.eclipse.swt.SWTError: Not implemented [multiple displays]
	at org.eclipse.swt.SWT.error(SWT.java:3668)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:270)
	at org.eclipse.rap.e4.E4EntryPointFactory.createWorkbench(E4EntryPointFactory.java:61)



After diggin' into the code a little bit i found out why:
If I open a dialog before the application window a display is created (somewhere along the way of displaying the dialog).
Then, in the E4EntryPointFactory.java in the method createWorkbench another display is created instead of using the existing one.

This is the code in E4EntryPointFactory:

private int createWorkbench() {
   Display display = new Display();
   E4Application e4App = new E4Application();
   E4Workbench workbench = e4App.createE4Workbench(getApplicationContext(config), display);
.....
}


So the E4EntryPointFactory is ALWAYS creating a new display.

Should'nt this be something like this?:


private int createWorkbench() {
        Display display = Display.getCurrent();
        if (display == null) {
            display = new Display();
        }
...
}



Re: [E4 Incubator] Creating Display in E4EntryPointFactory [message #1320090 is a reply to message #1319944] Mon, 28 April 2014 15:32 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

In e4 you would typically do what you want using a lifecycle handler.
I'm not yet sure if we support that! Anyways please file a bugzilla and
CC me on the bug so that we can find a solution to your problem.

Tom

On 28.04.14 15:40, M. Herrmann wrote:
> Hi,
>
> I am using the E4 incubator project and I'm quite happy so far.
> Thanks for the great work.
>
> I have just one problem:
> before I open the main application window, I sometimes need to display
> dialogs and stuff.
>
> If I do that before displaying the application window this exception is
> thrown:
>
> org.eclipse.swt.SWTError: Not implemented [multiple displays]
> at org.eclipse.swt.SWT.error(SWT.java:3668)
> at org.eclipse.swt.widgets.Display.<init>(Display.java:270)
> at
> org.eclipse.rap.e4.E4EntryPointFactory.createWorkbench(E4EntryPointFactory.java:61)
>
>
>
> After diggin' into the code a little bit i found out why:
> If I open a dialog before the application window a display is created
> (somewhere along the way of displaying the dialog).
> Then, in the E4EntryPointFactory.java in the method createWorkbench
> another display is created instead of using the existing one.
>
> This is the code in E4EntryPointFactory:
>
> private int createWorkbench() {
> Display display = new Display();
> E4Application e4App = new E4Application();
> E4Workbench workbench =
> e4App.createE4Workbench(getApplicationContext(config), display);
> ....
> }
>
> So the E4EntryPointFactory is ALWAYS creating a new display.
>
> Should'nt this be something like this?:
>
>
> private int createWorkbench() {
> Display display = Display.getCurrent();
> if (display == null) {
> display = new Display();
> }
> ..
> }
>
>
>
Re: [E4 Incubator] Creating Display in E4EntryPointFactory [message #1343483 is a reply to message #1320090] Fri, 09 May 2014 10:02 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Lifecycle support was already added but to stop the start up process I
added the possibility to return a boolean from the @PostContextCreate.

Filed as https://bugs.eclipse.org/bugs/show_bug.cgi?id=434481 and fixed
with
http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.e4.git/commit/?id=e827a4415c2d09dc845dd984d77a2dfb79785ac2

You can take a look at the demo application to see this in action.

Tom

On 28.04.14 17:32, Tom Schindl wrote:
> Hi,
>
> In e4 you would typically do what you want using a lifecycle handler.
> I'm not yet sure if we support that! Anyways please file a bugzilla and
> CC me on the bug so that we can find a solution to your problem.
>
> Tom
>
> On 28.04.14 15:40, M. Herrmann wrote:
>> Hi,
>>
>> I am using the E4 incubator project and I'm quite happy so far.
>> Thanks for the great work.
>>
>> I have just one problem:
>> before I open the main application window, I sometimes need to display
>> dialogs and stuff.
>>
>> If I do that before displaying the application window this exception is
>> thrown:
>>
>> org.eclipse.swt.SWTError: Not implemented [multiple displays]
>> at org.eclipse.swt.SWT.error(SWT.java:3668)
>> at org.eclipse.swt.widgets.Display.<init>(Display.java:270)
>> at
>> org.eclipse.rap.e4.E4EntryPointFactory.createWorkbench(E4EntryPointFactory.java:61)
>>
>>
>>
>> After diggin' into the code a little bit i found out why:
>> If I open a dialog before the application window a display is created
>> (somewhere along the way of displaying the dialog).
>> Then, in the E4EntryPointFactory.java in the method createWorkbench
>> another display is created instead of using the existing one.
>>
>> This is the code in E4EntryPointFactory:
>>
>> private int createWorkbench() {
>> Display display = new Display();
>> E4Application e4App = new E4Application();
>> E4Workbench workbench =
>> e4App.createE4Workbench(getApplicationContext(config), display);
>> ....
>> }
>>
>> So the E4EntryPointFactory is ALWAYS creating a new display.
>>
>> Should'nt this be something like this?:
>>
>>
>> private int createWorkbench() {
>> Display display = Display.getCurrent();
>> if (display == null) {
>> display = new Display();
>> }
>> ..
>> }
>>
>>
>>
>
Previous Topic:E4 RAP Integration
Next Topic:FF29 does not open RAP application
Goto Forum:
  


Current Time: Tue Apr 16 11:19:20 GMT 2024

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

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

Back to the top