Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Reading Command Line Parameters in RCP App(I have a view that needs to access the command line args)
Reading Command Line Parameters in RCP App [message #637237] Thu, 04 November 2010 16:54 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 #637238 is a reply to message #637237] Thu, 04 November 2010 16:56 Go to previous messageGo to next message
Herb Miller is currently offline Herb MillerFriend
Messages: 23
Registered: February 2010
Junior Member
Sorry, I meant to post this to the RCP forum.
Herb Miller
Re: Reading Command Line Parameters in RCP App [message #637294 is a reply to message #637238] Thu, 04 November 2010 22:05 Go to previous messageGo to next message
Tomasz Zarna is currently offline Tomasz ZarnaFriend
Messages: 172
Registered: July 2009
Senior Member
I haven't done it personally but I think you should use org.eclipse.osgi.service.environment.EnvironmentInfo to access the command line parameters.
Re: Reading Command Line Parameters in RCP App [message #637401 is a reply to message #637237] Fri, 05 November 2010 11:48 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In your start method, they're available in:
args = (String[]) applicationContext.getArguments().get(
IApplicationContext.APPLICATION_ARGS);

You can also use: org.eclipse.core.runtime.Platform.getApplicationArgs()

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


Previous Topic:How to use GetListItems from Sharepoint
Next Topic:Eclipse Out Of Memory (jvm & ram memory size)
Goto Forum:
  


Current Time: Thu Apr 25 22:45:04 GMT 2024

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

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

Back to the top