Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » File Association (--launcher.openFile)
File Association (--launcher.openFile) [message #739509] Mon, 17 October 2011 10:54
Eclipse UserFriend
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

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: Sat Jul 05 12:40:33 EDT 2025

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

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

Back to the top