[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] SWT and open document event on Mac OS X

Dear all,

I have an SWT application which I export into a Mac OS application bundle (.app) with the corresponding Eclipse export wizard.

Now I would like to allow users to start my application by double-clicking NOT on the application icon but on a file with a certain extension.  On Windows this is simple: the path of the file is passed as a command line argument to the java program.  But Mac OS does not do this, but instead a "open document" event is sent.  How can I catch this event when using SWT ?

I am aware of the following two solutions:
(1) com.apple.eawt.Application
(2) MRJAdapter (available at http://homepage.mac.com/sroy/mrjadapter/ )

These work fine in a small test program I have created.  However, as soon as I add SWT to this they both no longer work.  SWT seems to be incompatible with these.

Is there a way to get the path of the file on which the user double-clicked when using SWT ?

Thank you so much,

Oliver