org.openpermis.editor.policy
Class MacAdapter

java.lang.Object
  extended by org.openpermis.editor.policy.MacAdapter

public final class MacAdapter
extends Object

Adapter that maps Mac OS X specific system functions to Swing actions.

Since:
0.1.0

Nested Class Summary
static class MacAdapter.EventHandlerAdapter
          Adapter for EAWT event handlers.
static class MacAdapter.NopAction
          Action that does nothing.
 
Constructor Summary
MacAdapter()
          Creates a new mac adapter that is only active if running on a mac.
 
Method Summary
static void initialize(String name)
          Sets the Mac OS X application name and enables the application menu bar.
static boolean isMac()
          Checks if the application is running on Mac OS X.
 void registerAboutAction(Action action)
          Registers an action for the application about menu item.
 void registerOpenFileAction(Action action)
          Registers an action for events that prompt the application to open a file.
 void registerPreferencesAction(Action action)
          Registers an action for the application preferences menu item.
 void registerQuitAction(Action action)
          Registers an action for the application quit command.
 void setDockImage(Image image)
          Sets the image displayed on the dock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacAdapter

public MacAdapter()
Creates a new mac adapter that is only active if running on a mac.

Since:
0.1.0
Method Detail

isMac

public static boolean isMac()
Checks if the application is running on Mac OS X.

Returns:
true if the application is running on Mac OS X, false otherwise.
Since:
0.1.0

initialize

public static void initialize(String name)
Sets the Mac OS X application name and enables the application menu bar.

Does nothing if the application is not running on Mac OS X.

Notes:
Has to be called prior to initializing AWT.
Parameters:
name - the application name to set.
Since:
0.1.0

registerQuitAction

public void registerQuitAction(Action action)
Registers an action for the application quit command.

Parameters:
action - the action to execute, null to disable handling.
Since:
0.1.0

registerAboutAction

public void registerAboutAction(Action action)
Registers an action for the application about menu item.

Parameters:
action - the action to execute, null to disable handling.
Since:
0.1.0

registerPreferencesAction

public void registerPreferencesAction(Action action)
Registers an action for the application preferences menu item.

Parameters:
action - the action to execute, null to disable handling.
Since:
0.1.0

registerOpenFileAction

public void registerOpenFileAction(Action action)
Registers an action for events that prompt the application to open a file.

The file to be opened is passed in to the action handler as source of the action event in form of a String.

Parameters:
action - the action to register.
Since:
0.1.0

setDockImage

public void setDockImage(Image image)
Sets the image displayed on the dock.

Parameters:
image - the image to use as dock image.
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:11
Copyright (c) 2002-2007 Ergon Informatik AG