Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Creating Document Bundles in Java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating Document Bundles in Java



On Nov 3, 2010, at 12:23 PM, Kevin Muldoon wrote:

Strange.

 .xyz extension to a FILE works. The bundled Java application launches as expected. 

 .xyz to a FOLDER does nothing at all. Opens as a regular folder and the Java app bundle is not called.

I restarted the computer. I used .truemediapackage instead of .xyz but can't see how that would effect anything. pList is shown below.

Don't forget the "LSTypeIsPackage" boolean.

Regards,
Mike Swingler
Java Engineering
Apple Inc.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>truemediapackage</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>GenericApp.icns</string>
<key>CFBundleTypeName</key>
<string>TrueMedia Package</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TMPK</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleName</key>
<string>HelloWorld</string>
<key>CFBundleIdentifier</key>
<string>com.truebluedot.helloworld.HelloWorld</string>
<key>CFBundleVersion</key>
<string>100.0</string>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>tmpk</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIconFile</key>
<string>GenericApp.icns</string>
<key>Java</key>
<dict>
<key>MainClass</key>
<string>com.truebluedot.helloworld.HelloWorld</string>
<key>JVMVersion</key>
<string>1.5+</string>
<key>ClassPath</key>
<string>$JAVAROOT/HelloWorld.jar</string>
<key>Properties</key>
<dict>
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
</dict>
</dict>
</dict>
</plist>


On Oct 30, 2010, at 11:54 PM, Mike Swingler wrote:

You can simply create a directory named with a particular extension (.xyz), and then claim that file type in your app's Info.plist. As long as your bundled app and it's claimed file association is known to Launch Services, any directory with that extension will be your "document" format. It is also the only reliable way to ensure that your app is launched when the file type is double-clicked on.

We actually use this exact technique in "Java Preferences.app" to claim .jdk bundles.

Regards,
Mike Swingler
Java Engineering
Apple Inc.

On Oct 30, 2010, at 7:29 PM, Kevin Muldoon wrote:

Thanks for asking!

Trying to create an app that creates document packages. You know, like application bundles but for files. Have an idea that depends on this function.

On Oct 30, 2010, at 9:44 PM, Mike Swingler wrote:

No, there is no bridge to NSFileWrapper in Java. What are you trying to do?

Curious,
Mike Swingler
Java Engineering
Apple Inc.




 _______________________________________________
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: Creating Document Bundles in Java (From: Kevin Muldoon <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.