Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to get Argument from IApplication
How to get Argument from IApplication [message #332315] Fri, 17 October 2008 16:57
Eclipse UserFriend
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: Wed May 07 22:37:25 EDT 2025

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

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

Back to the top