com.github.axet.desktop.os.mac
Class Apple

java.lang.Object
  extended by com.github.axet.desktop.os.mac.Apple

public class Apple
extends Object


Nested Class Summary
static interface Apple.AppReOpenedListener
           
static interface Apple.OpenFilesHandler
           
static interface Apple.OpenURIHandler
           
static interface Apple.QuitHandler
           
 
Constructor Summary
Apple()
           
 
Method Summary
 void appReOpenedListener(Apple.AppReOpenedListener r)
           
static boolean isAvailable()
           
static void setFileType(String s, String bundleId)
          Sets the user‚Äôs preferred default handler for the specified content type in the specified roles.
 void setOpenFileHandler(Apple.OpenFilesHandler o)
           
 void setOpenURIHandler(Apple.OpenURIHandler q)
           
 void setQuitHandler(Apple.QuitHandler q)
           
static void setUrlType(String s, String bundleId)
          Sets the user‚Äôs preferred default handler for the specified URL scheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Apple

public Apple()
Method Detail

setUrlType

public static void setUrlType(String s,
                              String bundleId)
Sets the user’s preferred default handler for the specified URL scheme. URL handling capability is determined according to the value of the CFBundleURLTypes key in an application’s Info.plist. For information on the CFBundleURLTypes key, see the section “CFBundleURLTypes” in OS X Runtime Configuration Guidelines. Browser will open your app, when uses clicks on the web page url (magnet url for example).

Parameters:
s - - URL scheme, ex: "magnet" for "magnet://some_magnet_link"
bundleId - - bundle id

setFileType

public static void setFileType(String s,
                               String bundleId)
Sets the user’s preferred default handler for the specified content type in the specified roles. Call LSCopyDefaultRoleHandlerForContentType to get the current setting of the user’s preferred default handler for a specified content type. It helps browser to show proper download dialog which asks user which App to use to open this file you are downloading.

Parameters:
s - contenet handler. ex: "org.bittorrent.torrent", "torrent"
bundleId - - bundle ID

isAvailable

public static boolean isAvailable()

setOpenFileHandler

public void setOpenFileHandler(Apple.OpenFilesHandler o)

appReOpenedListener

public void appReOpenedListener(Apple.AppReOpenedListener r)

setQuitHandler

public void setQuitHandler(Apple.QuitHandler q)

setOpenURIHandler

public void setOpenURIHandler(Apple.OpenURIHandler q)


Copyright © 2012. All Rights Reserved.