java.lang.Objectjwrapper.jwutils.JWGenericOS
jwrapper.jwutils.JWMacOS
public class JWMacOS
Utility APIs for MacOS
Nested Class Summary | |
---|---|
static class |
JWMacOS.IgnoreInputStream
|
Constructor Summary | |
---|---|
JWMacOS()
|
Method Summary | |
---|---|
static boolean |
canRunLauncher64()
Returns true if JWrapper will use the native launcher on this version of OS X. |
java.lang.String[] |
getAllConsoleUsers()
Get a list of all users logged in to the console (logged in to a graphical session) |
static java.io.File |
getDotAppLauncher()
Returns a File referencing the .app used to launch this application. |
java.lang.String |
getHostname()
|
static java.lang.String |
getJvmUserAccount()
Get the username that is running this JVM |
static JWMacOS |
getMacOSInstance()
|
static java.io.File |
getNativeLauncherForDotApp(java.io.File dotApp)
Given a .app folder on OS X, return the native binary used to launch the application. |
static java.io.File |
getParameterisationFile(java.io.File dotApp)
OS X dynamic parameters are written to a file in the app bundle. |
static java.lang.String |
getRequestedURL()
Returns the requested URL if this application was launched using a URL handler |
boolean |
killProcess(int pid)
Kill the process with the given PID |
static boolean |
registerAppAsURLHandler(java.lang.String scheme,
java.lang.String bundleID)
Register a .app's bundleID to handle a particular URL scheme. |
static void |
registerURLSchemeForVirtualApp(java.lang.String schemeProtocol,
java.lang.String virtualApp)
|
static void |
requestUserAttention(boolean isCritical)
Request the user's attention. |
static void |
setMyOSXAppBadge(java.lang.String text)
Set the badge for this app (the red decorator text that appears on the apps icon in the OSX dock) |
static void |
setMyOSXAppName(java.lang.String name)
Set the name of this app as it appears in the menu bar in OSX |
static void |
setOSXEventListener(JWOSXEventListener listener)
Register an OSX Event Listener to receive notifications of Apple events. |
Methods inherited from class jwrapper.jwutils.JWGenericOS |
---|
getCurrentProcessID, getInstance, getOSName, getOSNameWithBitness, getOSVersion, setCurrentDirectory, setReadableForAllUsers, setReadableForAllUsersAndWait, setWritableForAllUsers, setWritableForAllUsersAndWait, terminateProcess |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JWMacOS()
Method Detail |
---|
public static boolean canRunLauncher64()
public java.lang.String[] getAllConsoleUsers()
getAllConsoleUsers
in class JWGenericOS
public static java.io.File getDotAppLauncher()
public java.lang.String getHostname()
getHostname
in class JWGenericOS
public static java.lang.String getJvmUserAccount()
public static JWMacOS getMacOSInstance()
public static java.io.File getNativeLauncherForDotApp(java.io.File dotApp)
dotApp
- the application folder
public static java.io.File getParameterisationFile(java.io.File dotApp)
public static java.lang.String getRequestedURL()
public boolean killProcess(int pid)
public static boolean registerAppAsURLHandler(java.lang.String scheme, java.lang.String bundleID)
public static void registerURLSchemeForVirtualApp(java.lang.String schemeProtocol, java.lang.String virtualApp) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public static void requestUserAttention(boolean isCritical)
isCritical
- whether this request is critical, if it is then (think?) the icon will bounce forever rather than a finite number of timespublic static void setMyOSXAppBadge(java.lang.String text)
text
- public static void setMyOSXAppName(java.lang.String name)
name
- public static void setOSXEventListener(JWOSXEventListener listener)