title: Eclipse RCP: File association (--launcher.openFile)
body: <p>I'm developing an eclipse product and i need to associate a file extension to my editor.
  I followed several examples (as like as <a href="http://aniefer.blogspot.com/2010/05/opening-files-in-eclipse-from-command.html" rel="noreferrer">this</a> and
  <a href="http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.equinox/incubator/demos/fileAssociation/org.eclipse.equinox.demo.file.association/?root=RT_Project" rel="noreferrer">this</a>) but it seems that the editor ever receives the SWT OpenDocument event.</p>
  
  <p>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 <code>PlatformUI.createAndRunWorkbench()</code> method gets called</p>
  
  <pre><code>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));
  </code></pre>
  
  <p>In the product file i added the following program arguments:</p>
  
  <pre><code>--launcher.XXMaxPermSize
  256m
  --launcher.defaultAction
  openFile
  -name
  XVR Studio Developer
  </code></pre>
  
  <p>If I use the same code in a new empty RCP project it works like a charm..</p>
  
  <p>I can't figured out which could be the problem..</p>
  
  <p>can you help me?</p>
  
  <p>Thanks a lot!!</p>