public class SideMenuBar extends MenuBar
Modifier and Type | Field and Description |
---|---|
static String |
COMMAND_ACTIONABLE
When using a side component we might want to only have it behave as a visual tool
and still execute the command when it is clicked.
|
static String |
COMMAND_PLACEMENT_KEY
This string can be used in putClientProperty within command to hint about
the placement of the command
|
static String |
COMMAND_PLACEMENT_VALUE_RIGHT
This string can be used in putClientProperty within command to hint about
the placement of the command e.g.
|
static String |
COMMAND_PLACEMENT_VALUE_TOP
This string can be used in putClientProperty within command to hint about
the placement of the command e.g.
|
static String |
COMMAND_SIDE_COMPONENT
Allows placing a component instance into the client properties of the command so
it is shown instead of the command e.g.:
putClientProperty(SideMenuBar.COMMAND_SIDE_COMPONENT, myCustomComponentInstance);
|
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, LEFT, RIGHT, TOP
Constructor and Description |
---|
SideMenuBar()
Empty Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(Command cmd)
Adds a Command to the MenuBar
|
protected void |
addCommand(Command cmd,
int index)
Add a Command to the MenuBar
|
static void |
closeCurrentMenu()
Folds the current side menu if it is open, notice that the menu will
close asynchronously
|
static void |
closeCurrentMenu(Runnable callback)
Folds the current side menu if it is open, when the menu is closed it
will invoke the runnable callback method
|
void |
closeMenu()
Closes the menu if it is currently open
|
protected Button |
createOpenButton()
Creates the Side Menu open button.
|
protected Container |
createSideNavigationComponent(Vector commands)
Creates the side navigation component with the Commands
|
protected Container |
createSideNavigationComponent(Vector commands,
String placement)
Creates the side navigation component with the Commands
|
protected Button |
createTouchCommandButton(Command c)
Creates a touch command for use as a touch menu item
|
int |
getCommandBehavior() |
protected int |
getDragRegionStatus(int x,
int y)
Indicates if the section within the X/Y area is a "drag region" where
we expect people to drag or press in which case we
can instantly start dragging making perceived performance faster.
|
Form |
getParentForm()
Returns the Parent Form of this menu
|
protected void |
initMenuBar(Form parent)
Initialize the MenuBar
|
protected void |
installMenuBar()
Adds the MenuBar on the parent Form
|
boolean |
isMenuOpen()
Returns true if the Menu is currently open
|
static boolean |
isShowing()
Returns true if a side menu is currently controlling the screen
|
void |
keyReleased(int keyCode)
If this Component is focused, the key released event
will call this method
|
void |
openMenu(String direction)
Opens the menu if it is currently closed
|
protected void |
removeAllCommands()
Remove all commands from the menuBar
|
protected void |
removeCommand(Command cmd)
Removes a Command from the MenuBar
|
void |
setBackCommand(Command backCommand)
Indicates the command that is defined as the back command out of this form.
|
protected void |
unInstallMenuBar()
Removes the MenuBar from the parent Form
|
actionPerformed, calcPreferredSize, calculateTouchCommandGridColumns, createBackCommandButton, createCommandComponent, createCommandList, createMenuCancelCommand, createMenuSelectCommand, createSelectCommand, createSoftButton, getBackCommand, getCancelMenuItem, getClearCommand, getCommand, getCommandCount, getCommands, getDefaultCommand, getMenuStyle, getSelectCommand, getSelectMenuItem, getTitleAreaContainer, getTitleComponent, handlesKeycode, isMinimizeOnBack, isReverseSoftButtons, keyPressed, refreshTheme, removeEmptySoftbuttons, setClearCommand, setCommandUIID, setDefaultCommand, setMenuCellRenderer, setMinimizeOnBack, setSelectCommand, setTransitions, setUnselectedStyle, showMenu, showMenuDialog
addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, cancelRepaints, clearClientProperties, contains, createAnimateMotion, dragInitiated, drop, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isScrollableX, isScrollableY, isSelectableInteraction, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerHover, pointerPressed, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager
addDragOverListener, addDropListener, addFocusListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, animate, bindProperty, calcScrollSize, contains, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragSpeed, getHeight, getLabelForComponent, getName, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTensileLength, getUIID, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFocus, initComponent, initCustomStyle, installDefaultPainter, isAlwaysTensile, isCellRenderer, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isFlatten, isFocusable, isGrabsPointerEvents, isHideInPortrait, isInClippingRegion, isInitialized, isRTL, isScrollable, isScrollVisible, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintLock, paintLockRelease, paintScrollbars, paintScrollbarX, paintScrollbarY, pinch, pointerDragged, pointerDragged, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, removeDragOverListener, removeDropListener, removeFocusListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, repaint, repaint, requestFocus, resetFocusable, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setDirtyRegion, setDisabledStyle, setDraggable, setDropTarget, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHideInPortrait, setInitialized, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setPressedStyle, setPropertyValue, setRTL, setSameHeight, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTactileTouch, setTensileDragEnabled, setTensileLength, setUIID, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, styleChanged, toString, unbindProperty
public static final String COMMAND_PLACEMENT_KEY
public static final String COMMAND_PLACEMENT_VALUE_RIGHT
public static final String COMMAND_PLACEMENT_VALUE_TOP
public static final String COMMAND_SIDE_COMPONENT
public static final String COMMAND_ACTIONABLE
protected void initMenuBar(Form parent)
MenuBar
initMenuBar
in class MenuBar
parent
- the associated Formpublic static boolean isShowing()
public static void closeCurrentMenu()
public static void closeCurrentMenu(Runnable callback)
callback
- will be invoked when the menu is actually closedprotected void removeAllCommands()
MenuBar
removeAllCommands
in class MenuBar
protected void unInstallMenuBar()
MenuBar
unInstallMenuBar
in class MenuBar
protected Button createOpenButton()
protected void installMenuBar()
MenuBar
installMenuBar
in class MenuBar
protected int getDragRegionStatus(int x, int y)
Component
getDragRegionStatus
in class MenuBar
x
- x location for the touchy
- y location for the touchpublic void addCommand(Command cmd)
MenuBar
addCommand
in class MenuBar
cmd
- Command to addpublic void setBackCommand(Command backCommand)
MenuBar
setBackCommand
in class MenuBar
backCommand
- the command to treat as the back Commandpublic int getCommandBehavior()
getCommandBehavior
in class MenuBar
protected void addCommand(Command cmd, int index)
MenuBar
addCommand
in class MenuBar
cmd
- Command to Addindex
- determines the order of the added commandsprotected void removeCommand(Command cmd)
MenuBar
removeCommand
in class MenuBar
cmd
- Command to removepublic void keyReleased(int keyCode)
Component
keyReleased
in class MenuBar
keyCode
- the key code value to indicate a physical key.public void closeMenu()
public void openMenu(String direction)
public boolean isMenuOpen()
protected Container createSideNavigationComponent(Vector commands)
commands
- the Command objectsprotected Container createSideNavigationComponent(Vector commands, String placement)
commands
- the Command objectsprotected Button createTouchCommandButton(Command c)
MenuBar
createTouchCommandButton
in class MenuBar
c
- command to map into the returned buttonpublic Form getParentForm()