Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [ECP] Send command line arguments to an ECP application
[ECP] Send command line arguments to an ECP application [message #1723867] Thu, 18 February 2016 15:34 Go to next message
Teohari Simona is currently offline Teohari SimonaFriend
Messages: 40
Registered: September 2015
Member
Hi guys,

I have to send some command line arguments to my ECP e4 application in order to make some ECP projects visible in the tree view. Can you please tell me what should I read for this? I know that for transmitting the args there is a Platform.getApplicationArgs() but where do I read these args? Do I need to create a new Application class?

Thank you very much,
S.
Re: [ECP] Send command line arguments to an ECP application [message #1723965 is a reply to message #1723867] Fri, 19 February 2016 10:04 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

you will need to hook somehow into the application lifecycle. Maybe a
lifecycle manager or an addon.

Best regards

Jonas

Am 18.02.2016 um 16:34 schrieb Teohari Simona:
> Hi guys,
>
> I have to send some command line arguments to my ECP e4 application in
> order to make some ECP projects visible in the tree view. Can you
> please tell me what should I read for this? I know that for transmitting
> the args there is a Platform.getApplicationArgs() but where do I read
> these args? Do I need to create a new Application class?
>
> Thank you very much,
> S.


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: [ECP] Send command line arguments to an ECP application [message #1724329 is a reply to message #1723965] Tue, 23 February 2016 08:18 Go to previous messageGo to next message
Teohari Simona is currently offline Teohari SimonaFriend
Messages: 40
Registered: September 2015
Member
Hi,

But it is possible that I create the lifecycle hook inside a new plug-in project?
I don't want to create a new e4 application, your default ecp.application.e4 is enough for me.
I have created a new plugin project, added the below method and put the corresponding dependencies in the MANIFEST.MF.

package com.simona.e4;
import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate;

public class MyManager{
@PostContextCreate
void postContextCreate(IEclipseContext workbenchContext) {
System.out.println("I got here!");
}
}
In the plugin.xml of this plugin I wrote this:
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
application="org.eclipse.e4.ui.workbench.swt.E4Application"
name="my">
<property
name="lifeCycleURI"
value="bundleclass://com.simona.e4/com.simona.e4.MyManager">
</property>
</product>
</extension>

And my.product has the following content:
<product name="my" uid="myproduct" id="org.eclipse.emf.ecp.application.e4.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" ....>

The my.product is located inside the plugin.
Unfortunately this method is never called.
What am I missing?

Thank you,
S.
Re: [ECP] Send command line arguments to an ECP application [message #1724344 is a reply to message #1724329] Tue, 23 February 2016 09:44 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi Teohari,

have you followed this:
http://www.vogella.com/tutorials/Eclipse4LifeCycle/article.html
?

Best regards

Jonas

Am 23.02.2016 um 09:18 schrieb Teohari Simona:
> Hi,
>
> But it is possible that I create the lifecycle hook inside a new plug-in
> project? I don't want to create a new e4 application, your default
> ecp.application.e4 is enough for me.
> I have created a new plugin project, added the below method and put the
> corresponding dependencies in the MANIFEST.MF.
>
> package com.simona.e4;
> import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate;
>
> public class MyManager{
> @PostContextCreate
> void postContextCreate(IEclipseContext workbenchContext) {
> System.out.println("I got here!");
> }
> }
> In the plugin.xml of this plugin I wrote this:
> <extension
> id="product"
> point="org.eclipse.core.runtime.products">
> <product
> application="org.eclipse.e4.ui.workbench.swt.E4Application"
> name="my">
> <property
> name="lifeCycleURI"
> value="bundleclass://com.simona.e4/com.simona.e4.MyManager">
> </property>
> </product>
> </extension>
>
> And my.product has the following content:
> <product name="my" uid="myproduct"
> id="org.eclipse.emf.ecp.application.e4.product"
> application="org.eclipse.e4.ui.workbench.swt.E4Application" ....>
>
> The my.product is located inside the plugin.
> Unfortunately this method is never called.
> What am I missing?
>
> Thank you,
> S.
>


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: [ECP] Send command line arguments to an ECP application [message #1724348 is a reply to message #1724344] Tue, 23 February 2016 10:05 Go to previous messageGo to next message
Teohari Simona is currently offline Teohari SimonaFriend
Messages: 40
Registered: September 2015
Member
Hi,

Yes, I did. (chapter 2. Life cycle hook and a login screen)

Br,
S.
Re: [ECP] Send command line arguments to an ECP application [message #1724480 is a reply to message #1724348] Wed, 24 February 2016 08:01 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
The tutorial describes how to add a lifecycle manager to an existing
application.

It is hard to tell what is wrong without looking at your code in detail.
In any case, your question would be probably better placed in the
Eclipse 4 newsgroup, as it is unrelated to EMF.

Best regards

Jonas


Am 23.02.2016 um 11:05 schrieb Teohari Simona:
> Hi,
>
> Yes, I did. (chapter 2. Life cycle hook and a login screen)
>
> Br,
> S.
>


--
--

Jonas Helming

Get professional Eclipse developer support:

http://eclipsesource.com/en/services/developer-support/
Re: [ECP] Send command line arguments to an ECP application [message #1724485 is a reply to message #1724480] Wed, 24 February 2016 08:29 Go to previous message
Teohari Simona is currently offline Teohari SimonaFriend
Messages: 40
Registered: September 2015
Member
Hi Jonas,

Yes, you are right.

Thank you,
S.
Previous Topic:Resource from a non-physical file
Next Topic:[CDO] Audit support vs Delta support
Goto Forum:
  


Current Time: Sat Apr 20 11:51:14 GMT 2024

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

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

Back to the top