Hi.
I'm developing an eclipse product and i need to associate a file extension to my editor.
I followed several examples (aniefer.blogspot.com/2010/05/opening-files-in-eclipse-from-command.html and
dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.equinox/incubator/demos/fileAssociation/org.eclipse.equinox.demo.file.association/?root=RT_Project) but it seems that the editor ever receives the SWT OpenDocument event.
As described in the fileAssociation example i created an eventListener class to process SWT.OpenDocument events and i added this in my Application class to the display before that the PlatformUI.createAndRunWorkbench() method gets called
public Object start(IApplicationContext context) throws Exception {
Object args = context.getArguments().get(IApplicationContext.APPLICATION_ARGS);
OpenDocumentEventProcessor eProc = new OpenDocumentEventProcessor();
Display display = PlatformUI.createDisplay();
display.addListener(SWT.OpenDocument, eProc);
try{
if(!handleWorkspace(display)){
System.exit(0);
return IApplication.EXIT_OK;
}
int returnCode = PlatformUI.createAndRunWorkbench(display, new XVRWorkbenchAdvisor(args, eProc));
In the product file i added the following program arguments:
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-name
XVR Studio Developer
If I use the same code in a new empty RCP project it works like a charm..
I can't figured out which could be the problem..
can you help me?
Thanks a lot!!
raffaello
[Updated on: Wed, 19 October 2011 05:53] by Moderator