com.jgoodies.uif.util
Class SystemUtils

java.lang.Object
  extended by com.jgoodies.uif.util.SystemUtils

public final class SystemUtils
extends Object

Provides convenience behavior to determine the operating system and a few other odds and ends.

Version:
$Revision: 1.12 $
Author:
Karsten Lentzsch

Field Summary
static boolean IS_JAVA_5
          True if this is Java 5.x.
static boolean IS_JAVA_6
          True if this is Java 6.
static boolean IS_JAVA_6_OR_LATER
          True if this is Java 6.x or later.
static boolean IS_LOW_RES
          Is true if this environment's default toolkit reports a screen resolution below 120 dpi.
static boolean IS_OS_LINUX
          Is true if this is Linux.
static boolean IS_OS_MAC
          Is true if this is the Mac OS.
static boolean IS_OS_SOLARIS
          True if this is Solaris.
static boolean IS_OS_WINDOWS
          Is true if this is the Windows OS.
static boolean IS_OS_WINDOWS_2000
          Is true if this is the Windows 2000 OS.
static boolean IS_OS_WINDOWS_XP
          Is true if this is the Windows XP OS.
 
Method Summary
static void dumpProperties(PrintStream stream, Properties properties)
          Dumps the given Properties to the specified PrintStream.
static Properties getExtendedSystemProperties()
          Looks up and returns an extended set of system properties that consist of the standard system properties plus those added by #addSpecialProperties.
static void sleep(long milliseconds)
          Sleeps for the given milliseconds catching a potential InterruptedException.
static boolean systemExitAllowed()
          Checks and answers if a system exit is allowed or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_OS_LINUX

public static final boolean IS_OS_LINUX
Is true if this is Linux.


IS_OS_MAC

public static final boolean IS_OS_MAC
Is true if this is the Mac OS.


IS_OS_SOLARIS

public static final boolean IS_OS_SOLARIS
True if this is Solaris.


IS_OS_WINDOWS

public static final boolean IS_OS_WINDOWS
Is true if this is the Windows OS.


IS_OS_WINDOWS_2000

public static final boolean IS_OS_WINDOWS_2000
Is true if this is the Windows 2000 OS.


IS_OS_WINDOWS_XP

public static final boolean IS_OS_WINDOWS_XP
Is true if this is the Windows XP OS.


IS_JAVA_5

public static final boolean IS_JAVA_5
True if this is Java 5.x. We check for a prefix of 1.5.


IS_JAVA_6

public static final boolean IS_JAVA_6
True if this is Java 6. We check for a prefix of 1.6.


IS_JAVA_6_OR_LATER

public static final boolean IS_JAVA_6_OR_LATER
True if this is Java 6.x or later. Since we don't support Java 1.4, we can check that it's not 1.5.


IS_LOW_RES

public static final boolean IS_LOW_RES
Is true if this environment's default toolkit reports a screen resolution below 120 dpi.

Method Detail

dumpProperties

public static void dumpProperties(PrintStream stream,
                                  Properties properties)
Dumps the given Properties to the specified PrintStream.

Parameters:
stream - the stream to write to
properties - the properties to dump

getExtendedSystemProperties

public static Properties getExtendedSystemProperties()
Looks up and returns an extended set of system properties that consist of the standard system properties plus those added by #addSpecialProperties.

First calls System.getProperties that may result in a security exception if there is a security manager that doesn't allow access to the system properties.

Returns:
the extended system properties
Throws:
SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow access to the system properties.
See Also:
SecurityException, SecurityManager.checkPropertiesAccess(), Properties

sleep

public static void sleep(long milliseconds)
Sleeps for the given milliseconds catching a potential InterruptedException.

Parameters:
milliseconds - the time to sleep in milliseconds

systemExitAllowed

public static boolean systemExitAllowed()
Checks and answers if a system exit is allowed or not. For example, as a plug-in you should not exit the system but silently shut down your application threads.

Returns:
true if System.exit() is allowed


Copyright © 2000-2008 JGoodies Karsten Lentzsch. All Rights Reserved.