Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About the Cocoa-Java bridge



There's an article here about getting the JavaBridge to work for arbitrary Cocoa classes.
Its for Jaguar/Project Builder. Perhaps it'll still work on Panther/Xcode, with tweaking.

Please go file a bug on this. Lots of people want it to be supported, but there's no sign of Apple doing this yet.

AndyT

On Feb 5, 2004, at 9:54 AM, Steve Roy wrote:

In AppleScript Studio, one can use the 'call method' command to call any method
of any object in Objective-C, and not just for Cocoa classes but any code, even
Objective-C code you have written yourself. For example:

call method "sharedWorkspace" of class "NSWorkspace"

call method "numberWithInt:" of class "NSNumber" with parameter 10

It would be wonderful if there was something equivalent in Java. JNI can do
this, but you have to write a dylib, load it, and all this fun stuff. Currently
we have the Cocoa-Java bridge, but it is limited to the classes that have been
wrapped, and not all of them have been, and specialized APIs like the Address
Book API or the NSAppleEventManager class are not available through Cocoa-Java.

I don't know why bridging from AppleScript to Objective-C is a matter of one
command, when in Java it's a matter of a set of classes. Maybe it's because the
Cocoa-Java bridge wraps classes instead of just implementing a way to call them?

Steve
--
Steve Roy <email@hidden>
Personal homepage: <http://homepage.mac.com/sroy>
Projects homepage: <http://www.roydesign.net>
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.


AndyT (lordpixel - the cat who walks through walls)
A little bigger on the inside

(see you later space cowboy ...)
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.