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: Services in Java app




On May 25, 2005, at 1:59 PM, Scott Ellsworth wrote:


On May 25, 2005, at 11:50 AM, Bill Tschumy wrote:


NSString doesn't exist in the Java bridge so I assume you are supposed to us NSStringReference instead. It is not clear what I'm supposed to do about error NSString**. Just declaring the method void seems to work in so far as the method is found and called.


I had thought that an NSString * became a java string when thrown over the bridge, while an NSString ** became an NSStringRef, but I cannot find where I read that now. Perhaps the voices in my head?


Scott

Scott,

I think you are right. However, it turns out the data is not in the String anyway. You have to extract it from the NSPasteBoard. Here is some code that is working for me:

public void indexText(NSPasteboard pBoard, String strRef)
{
NSArray types = pBoard.types();
if (types.containsObject(NSPasteboard.StringPboardType))
{
String pBoardString = pBoard.stringForType ("NSStringPboardType");
// do something with the string data.
}


Yea!  I have Services working!

--
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com


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

This email sent to email@hidden
References: 
 >Services in Java app (From: Bill Tschumy <email@hidden>)
 >Re: Services in Java app (From: Scott Ellsworth <email@hidden>)



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.