org.pietschy.command.demo

Class PageSelectorGroup

Implemented Interfaces:
CommandManagerListener, EventListener

public class PageSelectorGroup
extends ToggleCommandGroup

This class extends ToggleCommandGroup to provide a widget based on the JButtonBar component from http://l2fprod.com/.
Version:
$Revision: 1.8 $
Author:
andrewp

Field Summary

Fields inherited from class org.pietschy.command.CommandGroup

memberList

Fields inherited from class org.pietschy.command.Command

internalLog, listenerList, pcs

Constructor Summary

PageSelectorGroup(CommandManager container, String groupId)
Creates a new group with the specified Id and that uses the specified CommandManager.

Method Summary

JButtonBar
createButtonBar()
Creates a new vertical JButtonBar using the "page-selector" face.
JButtonBar
createButtonBar(int orientation)
Creates a new JButtonBar with the specified orientation using the "page-selector" face.
JButtonBar
createButtonBar(int orientation, String faceName)
Creates a new JButtonBar with the specified orientation using the specified face.
String[]
getAlternativeFaceNames(String face)
Overrides the default implementation to provide defaults for the page-selector face if it hasn't been specified.

Methods inherited from class org.pietschy.command.ToggleCommandGroup

getController, isAllowableMember, isEmptySelectionAllowed, isExclusive, setEmptySelectionAllowed, setExclusive

Methods inherited from class org.pietschy.command.CommandGroup

acceptVisitor, add, add, addGlue, addGlue, addGroupListener, addInline, addInline, addSeparator, addSeparator, bindMembers, bindMembers, commandRegistered, contains, createButton, createButton, createMenuBar, createMenuBar, createMenuBar, createMenuBar, createMenuItem, createPopupMenu, createPopupMenu, createToolBar, createToolBar, createToolBar, createToolBar, fireMembersChanged, getMemberCount, getMemberFactory, getMemberList, isAllowableMember, isInlineMember, isMember, rebuildAllPopups, remove, remove, removeGroupListener, reset, reset, visit, visitChildren

Methods inherited from class org.pietschy.command.Command

addFace, addHoverListener, addNewFace, addNotify, addPropertyChangeListener, addPropertyChangeListener, attach, buttonIterator, configureButtonAppearance, configureButtonAppearances, configureButtonAppearances, configureButtonStates, createButton, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, createMenuItem, detach, export, faceExists, fireHoverEnded, fireHoverStarted, getAccelerator, getAlternativeFaceNames, getButtonFactory, getButtonIn, getCommandManager, getDefaultFace, getDefaultFace, getDescription, getFace, getFace, getIcon, getId, getLongDescription, getMenuFactory, getMnemonic, getMnemonicIndex, getProperty, getProperty, getPropertyNames, getSelectedIcon, getText, getTextPosition, getToolbarFactory, initCommandManager, installFace, isAnonymous, isAttachedTo, isEnabled, isVisible, putProperty, removeHoverListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, requestFocusIn, setAccelerator, setButtonFactory, setDescription, setEnabled, setIcon, setLongDescription, setMenuFactory, setMnemonic, setMnemonicIndex, setSelectedIcon, setText, setTextPosition, setToolbarFactory, setVisible, toString

Constructor Details

PageSelectorGroup

public PageSelectorGroup(CommandManager container,
                         String groupId)
Creates a new group with the specified Id and that uses the specified CommandManager.
Parameters:
container - the CommandManager the group is to use.
groupId - the id of the group.

Method Details

createButtonBar

public JButtonBar createButtonBar()
Creates a new vertical JButtonBar using the "page-selector" face.
Returns:
a new JButtonBar for this group.

createButtonBar

public JButtonBar createButtonBar(int orientation)
Creates a new JButtonBar with the specified orientation using the "page-selector" face.
Parameters:
orientation - the orientation of the bar, either JButtonBar.VERTICAL or JButtonBar.HORIZONTAL.
Returns:
a new JButtonBar for this group.

createButtonBar

public JButtonBar createButtonBar(int orientation,
                                  String faceName)
Creates a new JButtonBar with the specified orientation using the specified face.
Parameters:
orientation - the orientation of the bar, either JButtonBar.VERTICAL or JButtonBar.HORIZONTAL.
faceName - the face for button bar and its members to use.
Returns:
a new JButtonBar for this group.

getAlternativeFaceNames

public String[] getAlternativeFaceNames(String face)
Overrides the default implementation to provide defaults for the page-selector face if it hasn't been specified.
Overrides:
getAlternativeFaceNames in interface Command
Parameters:
face - the desired face name
Returns:
a String array with the alternate faces in preferred order.