Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: handleOpenFile(ApplicationEvent) not being called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: handleOpenFile(ApplicationEvent) not being called




On Sep 22, 2006, at 12:02 PM, email@hidden wrote:

ior with dropped files has little or nothing to do with the LS
database.

if you remember (or search the archives), i had exactly this problem a few months back. i get openApplication and reopenApplication but not openFile. and there's way too much work in my (Ruby) launch script to simply switch to JavaApplicationStub, so i'd love to know what the magic ingredient is.

I suspect, given my experience, that what happens is that JavaApplicationStub launches the Java code, but stays connected with the JVM and listens for Apple Events from the rest of the system. Those events are then passed to the application via the ApplicationListener interface.


I think the handleOpenApplication happens as a direct result of registering the listener. When trying to get the hipster code to work, I watched the Apple Events being sent back and forth and there didn't appear to be one, which suggests the method is called whether or not a stub like JavaApplicationStub is running. Consequently an application starting via a shell script will still get the handleOpenApplication().

I must admit, I never got the handleReOpenApplication() method.
 _______________________________________________

You did get one open document event, why that may not of processed unless there was no AppleEvent handler I don't know. You did not get two open document events which when I re-read one of your prior posts seemed to be what you should of got. Something does need to install the native appleevent handlers and remain around. The JavaApplicationStub is strictly tied into the launch as far as I know so it probably is not what does it. It is probably additional code included with the OS X JVM to manage that.
This is getting to be guess work on my part, but it provides about all the additional knowledge I have in my experience. Which has included java JDirect and JNIDirect AppleEvent handlers. Actually java AppleEvent client/server code. Although that was supposed to make more sense when I had more machines to mess around with for client/server type applications. For now it's still just me and the mighty mini so I don't do that much with that or the RMI client/ server functionality in my code.


Mike Hall        mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: handleOpenFile(ApplicationEvent) not being called (From: Elliott Hughes <email@hidden>)
 >Re: handleOpenFile(ApplicationEvent) not being called (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.