org.pietschy.command

Class MacFaceRenderer

Implemented Interfaces:
FaceRenderer

public class MacFaceRenderer
extends DefaultFaceRenderer

The MacFaceRender extends DefaultFaceRenderer to provide Mac specific rendering of buttons and menus. In particular this renderer ensures.

Field Summary

Fields inherited from class org.pietschy.command.DefaultFaceRenderer

defaultGroupIcon

Method Summary

void
configureButton(AbstractButton button, RenderContext buttonContext)
Configures the specified button using the specified RenderContext.
protected void
configureIcons(AbstractButton button, Face face)
protected void
configureMnemonic(AbstractButton button, Face face)
static boolean
isButtonMnemonicsEnabled()
Checks if the renderer will be configuring mnemonics on buttons.
static boolean
isMenuMnemonicsEnabled()
Checks if the renderer will be configuring mnemonics on menu items.
boolean
isToolbar(RenderContext buttonContext)
Checks the the current button context is rendering a toolbar.
static void
setButtonMnemonicsEnabled(boolean buttonMnemonicsEnabled)
Sets if the renderer will be configuring mnemonics on buttons.
static void
setMenuMnemonicsEnabled(boolean menuMnemonicsEnabled)
Sets if the renderer will be configuring mnemonics on menu items.
protected boolean
shouldDisplayMnemonic(AbstractButton button)
Returns false.

Methods inherited from class org.pietschy.command.DefaultFaceRenderer

configureAccelerator, configureButton, configureIcons, configureMenu, configureMnemonic, configureText, configureTextPosition, configureToolTip, getDefaultGroupIcon, getFace, setDefaultGroupIcon

Method Details

configureButton

public void configureButton(AbstractButton button,
                            RenderContext buttonContext)
Configures the specified button using the specified RenderContext.
Specified by:
configureButton in interface FaceRenderer
Overrides:
configureButton in interface DefaultFaceRenderer
Parameters:
button - the button to configure.
buttonContext - the RenderContext of the button.

configureIcons

protected void configureIcons(AbstractButton button,
                              Face face)
Overrides:
configureIcons in interface DefaultFaceRenderer

configureMnemonic

protected void configureMnemonic(AbstractButton button,
                                 Face face)
Overrides:
configureMnemonic in interface DefaultFaceRenderer

isButtonMnemonicsEnabled

public static boolean isButtonMnemonicsEnabled()
Checks if the renderer will be configuring mnemonics on buttons.
Returns:
true if the buttons mnemonics are enabled, false otherwise.

isMenuMnemonicsEnabled

public static boolean isMenuMnemonicsEnabled()
Checks if the renderer will be configuring mnemonics on menu items.
Returns:
true if the menu mnemonics are enabled, false otherwise.

isToolbar

public boolean isToolbar(RenderContext buttonContext)
Checks the the current button context is rendering a toolbar. This simply checks that the parent groups isn't null and that the button face is Face.TOOLBAR.
Parameters:
buttonContext - the RenderContext for the current button.
Returns:
true if the button has a toolbar face and is being rendered as part of a group.

setButtonMnemonicsEnabled

public static void setButtonMnemonicsEnabled(boolean buttonMnemonicsEnabled)
Sets if the renderer will be configuring mnemonics on buttons.
Parameters:
buttonMnemonicsEnabled - true if the buttons mnemonics are enabled, false otherwise.

setMenuMnemonicsEnabled

public static void setMenuMnemonicsEnabled(boolean menuMnemonicsEnabled)
Sets if the renderer will be configuring mnemonics on menu items.
Parameters:
menuMnemonicsEnabled - true if the menu mnemonics are enabled, false otherwise.

shouldDisplayMnemonic

protected boolean shouldDisplayMnemonic(AbstractButton button)
Returns false.
Parameters:
button - the button to check.
Returns:
false.