Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » File Association (--launcher.openFile)
File Association (--launcher.openFile) [message #739509] Mon, 17 October 2011 10:54
raffaello  is currently offline raffaello
Messages: 5
Registered: June 2011
Junior Member
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]

Report message to a moderator

Previous Topic:Making the e4 pojo programming model accessible from org.eclipse.ui extension points
Next Topic:common navigator framework: adding popup menu entry under New Submenu
Goto Forum:
  


Current Time: Thu Aug 28 21:35:20 EDT 2014

Powered by FUDForum. Page generated in 0.02882 seconds