net.sf.jomic.tools
Class SystemTools

java.lang.Object
  extended by net.sf.jomic.tools.SystemTools

public final class SystemTools
extends java.lang.Object

Utility methods to simplify dealing system dependent issues.

Author:
Thomas Aglassinger

Method Summary
 java.lang.String getJavaInfo()
           
 java.lang.String getLocaleInfo()
           
 java.lang.String getPlatformInfo()
           
static SystemTools instance()
          Get accessor to unique instance.
 boolean isAqua()
          Is Aqua the current look and feel?
 boolean isMacOSX()
          Do we run under Mac OS X?
 boolean isWindows()
          Do we run under some Windows derivate?
 void openURL(java.lang.String url)
          Open url in web browser.
 void reveal(java.io.File path)
          Reveals a file or directory in the Systems file browser.
 void runScript(java.lang.String prefix, java.lang.String suffix, java.lang.String runner, java.lang.String scriptText)
          Run script containing scriptText.
 void setHelpAccelerato(javax.swing.JMenuItem helpMenuItem)
           Set the accelerator for the "Help" menu item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setHelpAccelerato

public void setHelpAccelerato(javax.swing.JMenuItem helpMenuItem)

Set the accelerator for the "Help" menu item.

Known bug : This does not work with Mac OS X. The Help key would be Command-?, but there is no no KeyEvent for "?". There are some hacks, but they don't work for internaltional keyboards (like using Shift-/ to get a "?"). For example, on the German keyboard the "?" is Shift-ß.


getJavaInfo

public java.lang.String getJavaInfo()

getLocaleInfo

public java.lang.String getLocaleInfo()

getPlatformInfo

public java.lang.String getPlatformInfo()

isAqua

public boolean isAqua()
Is Aqua the current look and feel?


isMacOSX

public boolean isMacOSX()
Do we run under Mac OS X?

For implementation details, see TN2110


isWindows

public boolean isWindows()
Do we run under some Windows derivate?


instance

public static SystemTools instance()
Get accessor to unique instance.


openURL

public void openURL(java.lang.String url)
Open url in web browser.


reveal

public void reveal(java.io.File path)
            throws java.io.IOException,
                   java.lang.InterruptedException
Reveals a file or directory in the Systems file browser. For Mac OS, this is the Finder. For Windows, this is the Explorer.

Throws:
java.io.IOException
java.lang.InterruptedException

runScript

public void runScript(java.lang.String prefix,
                      java.lang.String suffix,
                      java.lang.String runner,
                      java.lang.String scriptText)
               throws java.io.IOException,
                      java.lang.InterruptedException
Run script containing scriptText. The script is stored in a temporary file having a name with the specified prefix and suffix (without the dot).

Throws:
java.io.IOException
java.lang.InterruptedException