edu.rice.cs.drjava.platform
Interface PlatformSupport


public interface PlatformSupport

Central interface for all platform-specific code in DrJava. A default platform-neutral implementation is provided in DefaultPlatform.

Version:
$Id: PlatformSupport.java 4691 2008-12-02 23:33:27Z dlsmith $
See Also:
DefaultPlatform

Method Summary
 void afterUISetup(Action about, Action prefs, Action quit)
          Hook for performing general UI setup.
 void beforeUISetup()
          Hook for performing general UI setup.
 String getJavaSpecVersion()
          Returns the current Java specification version.
 boolean has13ToolsJar()
          Returns true if the classpath's tools.jar is from version 1.3.
 boolean has14ToolsJar()
          Returns true if the classpath's tools.jar is from version 1.4.
 boolean isMacPlatform()
          Returns whether this is a Mac OS X platform.
 boolean isUsingSystemLAF()
          Utility method to determine if the current Swing look and feel is the platform-specific look and feel for the client platform.
 boolean isWindowsPlatform()
          Returns whether this is a Windows platform.
 boolean openURL(URL address)
          Utility method for opening a URL in a browser in a platform-specific way.
 void setMnemonic(AbstractButton obj, char mnemonic)
          Set the keyboard mnemonic for the component in a way that is consistent with the current platform.
 void setMnemonic(AbstractButton obj, int mnemonic)
          Set the keyboard mnemonic for the component in a way that is consistent with the current platform.
 void setMnemonic(ButtonModel obj, int mnemonic)
          Set the keyboard mnemonic for the component in a way that is consistent with the current platform.
 void setMnemonicAt(JTabbedPane obj, int tabIndex, int mnemonic)
          Set the keyboard mnemonic for the component in a way that is consistent with the current platform.
 

Method Detail

isMacPlatform

boolean isMacPlatform()
Returns whether this is a Mac OS X platform.


isWindowsPlatform

boolean isWindowsPlatform()
Returns whether this is a Windows platform.


getJavaSpecVersion

String getJavaSpecVersion()
Returns the current Java specification version.


has13ToolsJar

boolean has13ToolsJar()
Returns true if the classpath's tools.jar is from version 1.3.


has14ToolsJar

boolean has14ToolsJar()
Returns true if the classpath's tools.jar is from version 1.4.


isUsingSystemLAF

boolean isUsingSystemLAF()
Utility method to determine if the current Swing look and feel is the platform-specific look and feel for the client platform.

Returns:
true if current Swing look and feel is the system look and feel

beforeUISetup

void beforeUISetup()
Hook for performing general UI setup. Called before all other UI setup is done.


afterUISetup

void afterUISetup(Action about,
                  Action prefs,
                  Action quit)
Hook for performing general UI setup. Called after all other UI setup is done.

Parameters:
about - the Action associated with openning the About dialog
prefs - the Action associated with openning the Preferences dialog
quit - the Action associated with quitting the DrJava application

openURL

boolean openURL(URL address)
Utility method for opening a URL in a browser in a platform-specific way. The default implementation uses Runtime.exec to execute a command specified in Preferences. Platform implementations should attempt the default method first, then try to use a "default browser", if such a thing exists on the specific platform.

Parameters:
address - the URL to open
Returns:
true if the URL was successfully handled, false otherwise

setMnemonic

void setMnemonic(AbstractButton obj,
                 int mnemonic)
Set the keyboard mnemonic for the component in a way that is consistent with the current platform.

Parameters:
obj - the component whose mnemonic should be set
mnemonic - the key code which represents the mnemonic
See Also:
AbstractButton.setMnemonic(int), KeyEvent

setMnemonic

void setMnemonic(AbstractButton obj,
                 char mnemonic)
Set the keyboard mnemonic for the component in a way that is consistent with the current platform.

Parameters:
obj - the component whose mnemonic should be set
mnemonic - a char specifying the mnemonic value
See Also:
AbstractButton.setMnemonic(char)

setMnemonic

void setMnemonic(ButtonModel obj,
                 int mnemonic)
Set the keyboard mnemonic for the component in a way that is consistent with the current platform.

Parameters:
obj - the component whose mnemonic should be set
mnemonic - the key code which represents the mnemonic
See Also:
ButtonModel.setMnemonic(int), KeyEvent

setMnemonicAt

void setMnemonicAt(JTabbedPane obj,
                   int tabIndex,
                   int mnemonic)
Set the keyboard mnemonic for the component in a way that is consistent with the current platform.

Parameters:
obj - the component whose mnemonic should be set
tabIndex - the index of the tab that the mnemonic refers to
mnemonic - the key code which represents the mnemonic
See Also:
JTabbedPane.setMnemonicAt(int,int), KeyEvent