Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Reading Command Line Parameters in RCP App
Reading Command Line Parameters in RCP App [message #637240] Thu, 04 November 2010 16:58 Go to next message
Herb Miller is currently offline Herb MillerFriend
Messages: 23
Registered: February 2010
Junior Member
I tried searching the forum, but most of the command line topics were on starting eclipse.

I have an RCP app that works well. One of my views needs to access the command line parameters given to the RCP application when it is started.

In this particular case, I need to turn some logging on or off based on a command line parameter.

How can a view in my RCP app access the command line parameters that are provided when the app is launched?

Thanks,
Herb Miller

Re: Reading Command Line Parameters in RCP App [message #637266 is a reply to message #637240] Thu, 04 November 2010 18:37 Go to previous messageGo to next message
Heiko Ahlig is currently offline Heiko AhligFriend
Messages: 62
Registered: July 2009
Member
Hi,
inside your RCP app, you should simply get your commandine and
applications args with:
Platform.getApplicationArgs()
and
Platform.getCommandLineArgs()

Greetings

Heiko


Am 04.11.2010 17:58, schrieb Herb Miller:
> I tried searching the forum, but most of the command line topics were on
> starting eclipse.
>
> I have an RCP app that works well. One of my views needs to access the
> command line parameters given to the RCP application when it is started.
>
> In this particular case, I need to turn some logging on or off based on
> a command line parameter.
>
> How can a view in my RCP app access the command line parameters that are
> provided when the app is launched?
>
> Thanks,
> Herb Miller
>
>
Re: Reading Command Line Parameters in RCP App [message #637402 is a reply to message #637240] Fri, 05 November 2010 11:50 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In addition, they're available in your application start(*) method:

args = (String[]) applicationContext.getArguments().get(
IApplicationContext.APPLICATION_ARGS);

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Reading Command Line Parameters in RCP App [message #637463 is a reply to message #637402] Fri, 05 November 2010 16:00 Go to previous message
Herb Miller is currently offline Herb MillerFriend
Messages: 23
Registered: February 2010
Junior Member
Thanks for both answers. I will give them a try.
Herb
Previous Topic:Anyone know how to get icons for common file types?
Next Topic:export of RCP app stops before completion
Goto Forum:
  


Current Time: Fri Apr 19 12:36:35 GMT 2024

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

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

Back to the top