Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox Application Model Demo
Equinox Application Model Demo [message #109217] Thu, 08 May 2008 00:27 Go to next message
Saeid Zoonemat Kermani is currently offline Saeid Zoonemat KermaniFriend
Messages: 6
Registered: July 2009
Junior Member
Hello,

I am trying to develop an RCP application which is a front end that allows
launching other RCP apps. In other words some thing very similar to what
is described on http://wiki.eclipse.org/Equinox_Application_Model_Demo.

I have checked out the projects mentioned at the above URL and looked at
the code and have no problem running the demo code. The part that I have a
question on is whether it is possible to use the App Selector to launch an
RCP app as opposed to a SWT app.

I wrote a simple RCP app and added the
org.eclipse.core.runtime.applications extension to it and it is getting
picked up by App Selector. But the RCP application does not start due to
the following error:
org.eclipse.swt.SWTError: Not implemented [multiple displays]

This error is caused by PlatformUI.createDisplay() line in the plugin's
Application.start() method. Is there any way to create a new workbench and
display even though App Selector already has an active workbench and
display. I also tried closing the App Selector's workbench prior to
launching the new RCP app but that did not work either.

Any advice is greatly appreciated,

- Saeid
Re: Equinox Application Model Demo [message #109233 is a reply to message #109217] Thu, 08 May 2008 06:14 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Just a wild guess but from the error message I think you are creating a
display everytime you start an application and SWT doesn't support
multiple displays in one JVM. I think you could check with
Display#getCurrent() and only if it returns null create a new one.

Tom

Saeid Zoonemat Kemani schrieb:
> Hello,
>
> I am trying to develop an RCP application which is a front end that
> allows launching other RCP apps. In other words some thing very similar
> to what is described on
> http://wiki.eclipse.org/Equinox_Application_Model_Demo.
>
> I have checked out the projects mentioned at the above URL and looked at
> the code and have no problem running the demo code. The part that I have
> a question on is whether it is possible to use the App Selector to
> launch an RCP app as opposed to a SWT app.
>
> I wrote a simple RCP app and added the
> org.eclipse.core.runtime.applications extension to it and it is getting
> picked up by App Selector. But the RCP application does not start due to
> the following error:
> org.eclipse.swt.SWTError: Not implemented [multiple displays]
>
> This error is caused by PlatformUI.createDisplay() line in the plugin's
> Application.start() method. Is there any way to create a new workbench
> and display even though App Selector already has an active workbench and
> display. I also tried closing the App Selector's workbench prior to
> launching the new RCP app but that did not work either.
>
> Any advice is greatly appreciated,
>
> - Saeid
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Equinox Application Model Demo [message #109286 is a reply to message #109233] Thu, 08 May 2008 17:28 Go to previous messageGo to next message
Saeid Zoonemat Kermani is currently offline Saeid Zoonemat KermaniFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,

Thank you for the response but that does not work either.
Display.getCurrent() returns null but it still complains about multiple
displays.

Display.getDefault() does return a display ID but then an exception is
raised at the line:
int returnCode = PlatformUI.createAndRunWorkbench(display, new
ApplicationWorkbenchAdvisor());

The exception is:
java.lang.IllegalStateException: Workbench already exists and cannot be
created again.

Trying to close the workbench already opened using
PlatformUI.getWorkbench().cloe(), throws an illegal thread access
exception.

The question remains whether there is any way to launch a new workbench
from an existing one. It seems that there has to be a way to do this since
one can use the link "Launch an Eclipse application" from the overview tab
of the plugin.xml on the IDE itself.

I tried looking at the eclipse source code to see how that is done but I
could not find any thing immediately useful. It seems to refer to the
extension point org.eclipse.pde.ui.launchShortcuts. I need to look some
more to see if there is an API that can be used.

Another option may be to rewrite the App Selector to be a SWT app and not
an RCP app. That way, there should not be any existing workbenches to
complain about.

Any ideas or advice will be welcomed. Thanks,

- Saeid




Tom Schindl wrote:

> Hi,

> Just a wild guess but from the error message I think you are creating a
> display everytime you start an application and SWT doesn't support
> multiple displays in one JVM. I think you could check with
> Display#getCurrent() and only if it returns null create a new one.

> Tom

> Saeid Zoonemat Kemani schrieb:
>> Hello,
>>
>> I am trying to develop an RCP application which is a front end that
>> allows launching other RCP apps. In other words some thing very similar
>> to what is described on
>> http://wiki.eclipse.org/Equinox_Application_Model_Demo.
>>
>> I have checked out the projects mentioned at the above URL and looked at
>> the code and have no problem running the demo code. The part that I have
>> a question on is whether it is possible to use the App Selector to
>> launch an RCP app as opposed to a SWT app.
>>
>> I wrote a simple RCP app and added the
>> org.eclipse.core.runtime.applications extension to it and it is getting
>> picked up by App Selector. But the RCP application does not start due to
>> the following error:
>> org.eclipse.swt.SWTError: Not implemented [multiple displays]
>>
>> This error is caused by PlatformUI.createDisplay() line in the plugin's
>> Application.start() method. Is there any way to create a new workbench
>> and display even though App Selector already has an active workbench and
>> display. I also tried closing the App Selector's workbench prior to
>> launching the new RCP app but that did not work either.
>>
>> Any advice is greatly appreciated,
>>
>> - Saeid
>>
>>
Re: Equinox Application Model Demo [message #109299 is a reply to message #109286] Thu, 08 May 2008 17:33 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Ok. Yes this is a problem you can't run more than one workbench in one
OSGi/JVM-Env that's why e.g. the RAP people are patching all those libs.

When you click on the launch tab an extra process is spawned! Launching
multiple workbench instance is certainly a topic for E4 (The problem is
that the platform code uses Singletons and static variables all over the
place and so only one instance is possible :-(.

Tom

Saeid Zoonemat Kemani schrieb:
> Hi,
>
> Thank you for the response but that does not work either.
> Display.getCurrent() returns null but it still complains about multiple
> displays.
>
> Display.getDefault() does return a display ID but then an exception is
> raised at the line:
> int returnCode = PlatformUI.createAndRunWorkbench(display, new
> ApplicationWorkbenchAdvisor());
>
> The exception is:
> java.lang.IllegalStateException: Workbench already exists and cannot be
> created again.
>
> Trying to close the workbench already opened using
> PlatformUI.getWorkbench().cloe(), throws an illegal thread access
> exception.
>
> The question remains whether there is any way to launch a new workbench
> from an existing one. It seems that there has to be a way to do this
> since one can use the link "Launch an Eclipse application" from the
> overview tab of the plugin.xml on the IDE itself.
>
> I tried looking at the eclipse source code to see how that is done but I
> could not find any thing immediately useful. It seems to refer to the
> extension point org.eclipse.pde.ui.launchShortcuts. I need to look some
> more to see if there is an API that can be used.
>
> Another option may be to rewrite the App Selector to be a SWT app and
> not an RCP app. That way, there should not be any existing workbenches
> to complain about.
>
> Any ideas or advice will be welcomed. Thanks,
>
> - Saeid
>
>
>
>
> Tom Schindl wrote:
>
>> Hi,
>
>> Just a wild guess but from the error message I think you are creating
>> a display everytime you start an application and SWT doesn't support
>> multiple displays in one JVM. I think you could check with
>> Display#getCurrent() and only if it returns null create a new one.
>
>> Tom
>
>> Saeid Zoonemat Kemani schrieb:
>>> Hello,
>>>
>>> I am trying to develop an RCP application which is a front end that
>>> allows launching other RCP apps. In other words some thing very
>>> similar to what is described on
>>> http://wiki.eclipse.org/Equinox_Application_Model_Demo.
>>>
>>> I have checked out the projects mentioned at the above URL and looked
>>> at the code and have no problem running the demo code. The part that
>>> I have a question on is whether it is possible to use the App
>>> Selector to launch an RCP app as opposed to a SWT app.
>>>
>>> I wrote a simple RCP app and added the
>>> org.eclipse.core.runtime.applications extension to it and it is
>>> getting picked up by App Selector. But the RCP application does not
>>> start due to the following error:
>>> org.eclipse.swt.SWTError: Not implemented [multiple displays]
>>>
>>> This error is caused by PlatformUI.createDisplay() line in the
>>> plugin's Application.start() method. Is there any way to create a new
>>> workbench and display even though App Selector already has an active
>>> workbench and display. I also tried closing the App Selector's
>>> workbench prior to launching the new RCP app but that did not work
>>> either.
>>>
>>> Any advice is greatly appreciated,
>>>
>>> - Saeid
>>>
>>>
>
>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Equinox Application Model Demo [message #109324 is a reply to message #109299] Thu, 08 May 2008 18:55 Go to previous message
Saeid Zoonemat Kermani is currently offline Saeid Zoonemat KermaniFriend
Messages: 6
Registered: July 2009
Junior Member
Hello Again,

I was afraid of this... Unfortunately I cannot wait till E4 but spawning a
new process should not be a problem. I have looked around and have not
been able to find a good reference/tutorial except this one which is a
little old:
http://www.eclipse.org/articles/Article-Launch-Framework/lau nch.html

Any recommendations on a good reference. Thank you,

- Saeid



Tom Schindl wrote:

> Ok. Yes this is a problem you can't run more than one workbench in one
> OSGi/JVM-Env that's why e.g. the RAP people are patching all those libs.

> When you click on the launch tab an extra process is spawned! Launching
> multiple workbench instance is certainly a topic for E4 (The problem is
> that the platform code uses Singletons and static variables all over the
> place and so only one instance is possible :-(.

> Tom
Previous Topic:Activator to Servlet
Next Topic:incorrect URL from thread.getContextClassLoader().getResource()
Goto Forum:
  


Current Time: Thu Dec 26 22:05:07 GMT 2024

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

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

Back to the top