Mailing Lists: Apple Mailing Lists

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

Solved Re: Unsuccessful making widget from simple applet



Summary:
Add access key to info.plist. I added the 'AllowFullAccess' key and I see your applet-Hello Java sample on my Dashboard. Ignore what I said earlier about Cocoa-Java projects.


    <key>AllowFullAccess</key>
    <true/>


From Apple's online docs:

-----------------------8<---------------------------

Access Keys

If your widget needs resources that extend beyond your widget’s bundle or HTML, CSS, and JavaScript technologies, you need to use Dashboard’sInfo.plist Access keys into account.


Detail: Using Access Keys

Dashboard allows you to “declare your intentions” when you:

      Access files outside of your widget bundle
      Use a Web Kit or standard browser plug-in
      Access network resources
      Run a Java applet
      Run a command-line utility
      Using a widget plug-in
-----------------------8<---------------------------


and then later ...

"If you attempt to use any of these resources without first specifying them in your widget’s information property list file, your attempt fails." Apparently without an error-message! :-)

http://developer.apple.com/documentation/AppleApplications/Conceptual/ Dashboard_Tutorial/Security/chapter_10_section_1.html


----------------------info.plist----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowFullAccess</key>
<true/>
<key>CFBundleDisplayName</key>
<string>Hello Java</string>
<key>CFBundleIdentifier</key>
<string>org.segal.widget.hellojava</string>
<key>CFBundleName</key>
<string>Hello Java</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CloseBoxInsetX</key>
<integer>16</integer>
<key>CloseBoxInsetY</key>
<integer>14</integer>
<key>MainHTML</key>
<string>HelloJava.html</string>
</dict>
</plist>
------------------------------------8<-------------------------------


On 31-Jul-05, at 4:15 PM, Robert MacGregor wrote:

My two cents, not based on experience but looking at Apple's example code, you're widget doesn't work because you use Java not Javascript. If you want to use Java, you'll need a widget-plugin:

http://developer.apple.com/documentation/AppleApplications/ Conceptual/Dashboard_Tutorial/index.html?http://developer.apple.com/ documentation/AppleApplications/Conceptual/Dashboard_Tutorial/ Widget_Basics/chapter_3_section_1.html


I'm suggesting the plug-in because of Apple's 'Fortune' example code; that code uses a Cocoa plug-in, unlike every other example which is Javascript. Apple's documentation specifies a Cocoa-plugin so a Cocoa-Java project may work.



http://developer.apple.com/documentation/AppleApplications/ Reference/Dashboard_Ref/index.html#//apple_ref/doc/uid/TP40001339



http://developer.apple.com/documentation/AppleApplications/ Conceptual/SafariJSProgTopics/Tasks/ObjCFromJavaScript.html#// apple_ref/doc/uid/30001215



Sample code is from 10.4's install DVD: /Developer/Examples/ Dashboard/Fortune


Rob




On 31-Jul-05, at 3:02 PM, Mickey Segal wrote:


I tried to make a Macintosh OS 10.4 widget from a Hello World java applet and couldn't get it to work. The full code is at: www.segal.org/java/widget/ along with a downloadable Hello Java.sit file and a copy of the applet working in the web page.

Although I know a fair amount about Java applets, I know very little about the Macintosh per se, so it is possible I am committing some basic Macintosh error. I'd appreciate if someone could point out what is wrong so I could post some cookbook applet widget code and help Java people make widgets (although the demand that is most obvious so far is from my 5 year old, who is completely obsessed with widgets, but that should be a good leading indicator).
_______________________________________________
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/rob.macgregor% 40sympatico.ca


This email sent to email@hidden



_______________________________________________
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/rob.macgregor% 40sympatico.ca


This email sent to email@hidden


_______________________________________________ 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: 
 >Unsuccessful making widget from simple applet (From: "Mickey Segal" <email@hidden>)
 >Re: Unsuccessful making widget from simple applet (From: Robert MacGregor <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.