JavaApplicationStub with CFBundleDocumentTypes
Posted
by mystro
on Stack Overflow
See other posts from Stack Overflow
or by mystro
Published on 2010-06-13T21:15:57Z
Indexed on
2010/06/13
21:22 UTC
Read the original article
Hit count: 223
I'm trying to use CFBundleDocumentTypes to associate a custom file extension with my application. As far as I can tell, this seems to "work" -- JavaApplicationStub launches my application when I double click the file. However, no callback is registered through the ApplicationListener events I setup in java.
I used the code listed in http://stackoverflow.com/questions/1460193/set-default-file-association-mac-os-x-java-package-maker-installer to do the file association, and the file association itself appears fine, but it seems as if it is the application stub trying to launch the file, and thus fails.
I added the Apple ApplicatinListener code to my java application at (similar to http://developer.apple.com/mac/library/documentation/Java/Reference/1.5.0/appledoc/api/index.html?com/apple/eawt/Application.html) but it doesn't seem like my application ever gets a call back.
the code is similar to
Application.getApplicatin().addApplicationListener(
new ApplicationAdapter() {
public void handleOpenFile(ApplicationEvent evt)
{
//some logging message here that I never get}
});
I should perhaps mention that I'm also using SWT...
Any help would be appreciated
© Stack Overflow or respective owner