|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.editor.policy.MacAdapter
public final class MacAdapter
Adapter that maps Mac OS X specific system functions to Swing actions.
Nested Class Summary | |
---|---|
static class |
MacAdapter.EventHandlerAdapter
Adapter for EAWT event handlers. |
static class |
MacAdapter.NopAction
Action that does nothing. |
Field Summary | |
---|---|
private Object |
application
The EAWT application instance. |
private static org.slf4j.Logger |
LOGGER
The logger object of this class. |
Constructor Summary | |
---|---|
MacAdapter()
Creates a new mac adapter that is only active if running on a mac. |
Method Summary | |
---|---|
private Object |
createApplicationInstance()
Creates an instance of an apple application object. |
private Action |
getAction(Action action)
Returns an action for use when registering handlers. |
static void |
initialize(String name)
Sets the Mac OS X application name and enables the application menu bar. |
private boolean |
isActive()
Checks if the adapter is active. |
static boolean |
isMac()
Checks if the application is running on Mac OS X. |
private void |
register(MacAdapter.EventHandlerAdapter adapter)
Registers an EAWT handler for the specified application method and action to execute. |
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. |
private void |
setEnabled(String method,
boolean enabled)
Enables or disables an application feature. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.slf4j.Logger LOGGER
private final Object application
createApplicationInstance()
Constructor Detail |
---|
public MacAdapter()
Method Detail |
---|
public static boolean isMac()
true
if the application is running on Mac OS X,
false
otherwise.public static void initialize(String name)
Does nothing if the application is not running on Mac OS X.
name
- the application name to set.private Object createApplicationInstance()
null
if we are not running
on Mac OS X or the current OS does not support Apple EAWT.private boolean isActive()
true
if the adapter is active, false
otherwise.private void setEnabled(String method, boolean enabled)
method
- the method to call to enable or disable the feature.enabled
- true
to enable the feature, false
to disable it.private void register(MacAdapter.EventHandlerAdapter adapter)
adapter
- the adapter to register for EAWT events.private final Action getAction(Action action)
action
- the preferred action to execute.
null
.public void registerQuitAction(Action action)
action
- the action to execute, null
to disable handling.public void registerAboutAction(Action action)
action
- the action to execute, null
to disable handling.public void registerPreferencesAction(Action action)
action
- the action to execute, null
to disable handling.public void registerOpenFileAction(Action action)
The file to be opened is passed in to the action handler as source of the
action event in form of a String
.
action
- the action to register.public void setDockImage(Image image)
image
- the image to use as dock image.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:48
Copyright (c) 2002-2007 Ergon Informatik AG