[E4 Incubator] Creating Display in E4EntryPointFactory [message #1319944] |
Mon, 28 April 2014 09:40  |
Eclipse User |
|
|
|
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 06:02  |
Eclipse User |
|
|
|
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();
>> }
>> ..
>> }
>>
>>
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.38871 seconds