Class SideMenuBar
- All Implemented Interfaces:
Animation, Editable, ActionListener, StyleListener, Iterable<Component>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhen 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 final StringThis string can be used in putClientProperty within command to hint about the placement of the commandstatic final StringThis string can be used in putClientProperty within command to hint about the placement of the command e.g.static final StringThis string can be used in putClientProperty within command to hint about the placement of the command e.g.static final StringAllows 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);Fields inherited from class Component
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, 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, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(Command cmd) Adds a Command to the MenuBarprotected voidaddCommand(Command cmd, int index) Add a Command to the MenuBarprotected voidaddComponentToSideMenu(Container menu, Component cmp) This method responsible to add a Component to the side navigation panel.static voidFolds the current side menu if it is open, notice that the menu will close asynchronouslystatic voidcloseCurrentMenu(Runnable callback) Folds the current side menu if it is open, when the menu is closed it will invoke the runnable callback methodvoidCloses the menu if it is currently openprotected ContainerCreates an empty side navigation panel.protected ButtonCreates the Side Menu open button.protected ContainercreateSideNavigationComponent(Vector commands) Creates the side navigation component with the Commandsprotected ContainercreateSideNavigationComponent(Vector commands, String placement) Creates the side navigation component with the Commandsprotected ButtonCreates a touch command for use as a touch menu itemintprotected intgetDragRegionStatus(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.Returns the Parent Form of this menuprotected voidinitMenuBar(Form parent) Initialize the MenuBarprotected voidAdds the MenuBar on the parent FormbooleanReturns true if the Menu is currently openstatic booleanReturns true if a side menu is currently controlling the screenvoidkeyReleased(int keyCode) If this Component is focused, the key released event will call this methodvoidOpens the menu if it is currently closedprotected voidRemove all commands from the menuBarprotected voidremoveCommand(Command cmd) Removes a Command from the MenuBarvoidsetBackCommand(Command backCommand) Indicates the command that is defined as the back command out of this form.protected voidRemoves the MenuBar from the parent FormMethods inherited from class MenuBar
actionPerformed, calcPreferredSize, calculateTouchCommandGridColumns, createBackCommandButton, createCommandComponent, createCommandList, createMenuCancelCommand, createMenuSelectCommand, createSelectCommand, createSoftButton, findCommandComponent, getBackCommand, getCancelMenuItem, getClearCommand, getCommand, getCommandCount, getCommands, getDefaultCommand, getMenuStyle, getSelectCommand, getSelectMenuItem, getTitleAreaContainer, getTitleComponent, handlesKeycode, isMenuShowing, isMinimizeOnBack, isReverseSoftButtons, keyPressed, refreshTheme, removeEmptySoftbuttons, setClearCommand, setCommandUIID, setDefaultCommand, setMenuCellRenderer, setMinimizeOnBack, setSelectCommand, setTransitions, setUnselectedStyle, showMenu, showMenuDialogMethods inherited from class Container
add, add, add, add, add, add, addAll, addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, cancelRepaints, clearClientProperties, constrainHeightWhenScrollable, constrainWidthWhenScrollable, contains, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayout, createAnimateLayoutFade, createAnimateLayoutFadeAndWait, createAnimateMotion, createAnimateUnlayout, createReplaceTransition, dragInitiated, drop, encloseIn, encloseIn, findDropTargetAt, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getChildrenAsList, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getResponderAt, getSafeAreaRoot, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isSafeArea, isSafeAreaRoot, isScrollableX, isScrollableY, isSelectableInteraction, isSurface, iterator, iterator, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerPressed, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndicesMethods inherited from class Component
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, animate, announceForAccessibility, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAccessibilityText, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initComponent, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, onSetFocusable, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAccessibilityText, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUIIDFinal, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContainsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
COMMAND_PLACEMENT_KEY
This string can be used in putClientProperty within command to hint about the placement of the command- See Also:
-
COMMAND_PLACEMENT_VALUE_RIGHT
This string can be used in putClientProperty within command to hint about the placement of the command e.g. putClientProperty(SideMenuBar.COMMAND_PLACEMENT_KEY, SideMenuBar.COMMAND_PLACEMENT_VALUE_RIGHT);- See Also:
-
COMMAND_PLACEMENT_VALUE_TOP
This string can be used in putClientProperty within command to hint about the placement of the command e.g. putClientProperty(SideMenuBar.COMMAND_PLACEMENT_KEY, SideMenuBar.COMMAND_PLACEMENT_VALUE_TOP);- See Also:
-
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);- See Also:
-
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. The default behavior is to delegate events to the component, however if this flag is used the command will act as normal while using the COMMAND_SIDE_COMPONENT only for visual effect e.g.: putClientProperty(SideMenuBar.COMMAND_ACTIONABLE, Boolean.TRUE);- See Also:
-
-
Constructor Details
-
SideMenuBar
public SideMenuBar()
-
-
Method Details
-
isShowing
public static boolean isShowing()Returns true if a side menu is currently controlling the screen
Returns
true if a side menu is currently controlling the screen
-
closeCurrentMenu
public static void closeCurrentMenu()Folds the current side menu if it is open, notice that the menu will close asynchronously -
closeCurrentMenu
Folds the current side menu if it is open, when the menu is closed it will invoke the runnable callback method
Parameters
callback: will be invoked when the menu is actually closed
-
initMenuBar
Initialize the MenuBar
Parameters
parent: the associated Form
- Overrides:
initMenuBarin classMenuBar
-
removeAllCommands
protected void removeAllCommands()Remove all commands from the menuBar- Overrides:
removeAllCommandsin classMenuBar
-
unInstallMenuBar
protected void unInstallMenuBar()Removes the MenuBar from the parent Form- Overrides:
unInstallMenuBarin classMenuBar
-
createOpenButton
Creates the Side Menu open button.
Returns
a Button instance to place on the TitleArea
-
installMenuBar
protected void installMenuBar()Adds the MenuBar on the parent Form- Overrides:
installMenuBarin classMenuBar
-
getDragRegionStatus
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. This is invoked by the implementation code to optimize drag start behavior
Parameters
-
x: x location for the touch -
y: y location for the touch
Returns
one of the DRAG_REGION_* values
- Overrides:
getDragRegionStatusin classMenuBar
-
-
addCommand
Adds a Command to the MenuBar
Parameters
cmd: Command to add
- Overrides:
addCommandin classMenuBar
-
setBackCommand
Indicates the command that is defined as the back command out of this form. A back command can be used both to map to a hardware button (e.g. on the Sony Ericsson devices) and by elements such as transitions etc. to change the behavior based on direction (e.g. slide to the left to enter screen and slide to the right to exit with back).
Parameters
backCommand: the command to treat as the back Command
- Overrides:
setBackCommandin classMenuBar
-
getCommandBehavior
public int getCommandBehavior()- Overrides:
getCommandBehaviorin classMenuBar
-
addCommand
Add a Command to the MenuBar
Parameters
-
cmd: Command to Add -
index: determines the order of the added commands
- Overrides:
addCommandin classMenuBar
-
-
removeCommand
Removes a Command from the MenuBar
Parameters
cmd: Command to remove
- Overrides:
removeCommandin classMenuBar
-
keyReleased
public void keyReleased(int keyCode) Description copied from class:MenuBarIf this Component is focused, the key released event will call this method
Parameters
keyCode: the key code value to indicate a physical key.
- Overrides:
keyReleasedin classMenuBar
-
closeMenu
public void closeMenu()Closes the menu if it is currently open -
openMenu
Opens the menu if it is currently closed -
isMenuOpen
public boolean isMenuOpen()Returns true if the Menu is currently open
Returns
true if menu open
Deprecated
this code references functionality that is no longer supported and currently always returns false
-
addComponentToSideMenu
-
createTouchCommandButton
Creates a touch command for use as a touch menu item
Parameters
c: command to map into the returned button
Returns
a button that would fire the touch command appropriately
- Overrides:
createTouchCommandButtonin classMenuBar
-
getParentForm
Returns the Parent Form of this menu
Returns
Form Object
-