Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to get Argument from IApplication
How to get Argument from IApplication [message #332315] Fri, 17 October 2008 20:57
luluchu is currently offline luluchuFriend
Messages: 4
Registered: July 2009
Junior Member
I've created a new file extention adn trying to launch the application
through the file on desktop. I tried to do it with eclipse adding the
variable ${fileprompt} in my program arguments and select the file there
directly when I launch my eclipse plugin. This works when I tried to do
the following public class Application implements IApplication {

public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
Map args = context.getArguments();
String[] value =
(String[])args.get(context.APPLICATION_ARGS);
System.out.println("value " + value[0]);
return IApplication.EXIT_OK;
}
public void stop() {
// nothing to do
}
}

The value[0] will return the absolute path that I select from the file
picker.
However, when I tried to select teh file I wanted to open in my Desktop,
right click, Open with, select the application I wanted to launch with,
the applciation argument doesn't return me the absolute path.
I got the value of "-showLocation" instead. Any one run into this issue
before? Thanks in advance.
Previous Topic:Can a builder relate to another builder?
Next Topic:[p2] always contacting update-site when installing feature
Goto Forum:
  


Current Time: Sun Oct 06 12:05:06 GMT 2024

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

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

Back to the top