Java-Cocoa App Service
Java-Cocoa App Service
- Subject: Java-Cocoa App Service
- From: Robbie Ford <email@hidden>
- Date: Mon, 15 Mar 2004 23:59:05 +0000
From: Robbie Ford <email@hidden>
Date: 15 March 2004 11:54:22 pm GMT
To: email@hidden, email@hidden
Subject: Java-Cocoa App Service
Hi,
Sorry for the double post but I'm not entirely sure which list might be
the most relevant.
I have a Java-Cocoa app that I am wanting to implement to provide a
service to other applications. It is aimed at receiving text and
placing it in a non-editable text view where the program will then
process it in some manner. I am currently using Panther 10.3.2 with
Xcode and Java 1.4.1.
As far as I can tell I have set up the info.plist correctly, I have
included the following method in the controller class to register it as
receiving the request for the service:
public void applicationDidFinishLaunching(NSNotification notification) {
System.out.println("applicationDidFinishLaunching called");
// To get service requests to go to the controller...
NSApplication.sharedApplication().setServicesProvider(this);
}
The method that it is defined to call is defined as follows in the
controller class:
String processText(NSPasteboard pboard, String userData) {
.
.
.
}
In the services menu of other applications the program appears
correctly it launches fine when text is selected in the currently
active app but it doesn't seem to call the method that I have defined
in the info.plist. I have double and triple checked the info.plist
settings and am near as dammit certain that they are fine. I have read
the documentation on Services and looked at what examples I could and
am still none the wiser.
Here is the NSServices entry in the info.plist file:
<key>NSServices</key>
<array>
<dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>AppName/Process Selection</string>
</dict>
<key>NSMessage</key>
<string>processText</string>
<key>NSPortName</key>
<string>AppName</string>
<key>NSSendTypes</key>
<array>
<string>NSStringPboardType</string>
<string>NSRTFPboardType</string>
<string>NSRTFDPboardType</string>
</array>
</dict>
</array>
Are there any other methods that I need to define or am I missing
something so obvious that I can't see it for looking?
Thanks in advance
Robbie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.