public class SideMenuBar
ImplementsActionListener, Animation, Editable, Iterable<Component>, StyleListener
com.codename1.ui.ToolbarFields
public static final String COMMAND_PLACEMENT_KEY = "placement" | This string can be used in putClientProperty within command to hint about the placement of the command |
public static final String COMMAND_PLACEMENT_VALUE_RIGHT = "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); |
public static final String COMMAND_PLACEMENT_VALUE_TOP = "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); |
public static final String COMMAND_SIDE_COMPONENT = "SideComponent" | 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); |
public static final String COMMAND_ACTIONABLE = "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. |
Constructors
public SideMenuBar() |
Methods
public static boolean isShowing() | Returns true if a side menu is currently controlling the screen |
public static void closeCurrentMenu() | Folds the current side menu if it is open, notice that the menu will close asynchronously |
public 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 |
protected void initMenuBar(Form parent) | Initialize the MenuBar |
protected void removeAllCommands() | Remove all commands from the menuBar |
protected void unInstallMenuBar() | Removes the MenuBar from the parent Form |
protected Button createOpenButton() | Creates the Side Menu open button. |
protected void installMenuBar() | Adds the MenuBar on the parent Form |
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. |
public void addCommand(Command cmd) | Adds a Command to the MenuBar |
public void setBackCommand(Command backCommand) | Indicates the command that is defined as the back command out of this form. |
public int getCommandBehavior() | |
protected void addCommand(Command cmd, int index) | Add a Command to the MenuBar |
protected void removeCommand(Command cmd) | Removes a Command from the MenuBar |
public void keyReleased(int keyCode) | If this Component is focused, the key released event will call this method |
public void closeMenu() | Closes the menu if it is currently open |
public void openMenu(String direction) | Opens the menu if it is currently closed |
public boolean isMenuOpen() | Deprecated Returns true if the Menu is currently open |
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 Container constructSideNavigationComponent() | Creates an empty side navigation panel. |
protected void addComponentToSideMenu(Container menu, Component cmp) | This method responsible to add a Component to the side navigation panel. |
protected Button createTouchCommandButton(Command c) | Creates a touch command for use as a touch menu item |
public Form getParentForm() | Returns the Parent Form of this menu |
Inherited fields
From Component
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_Y, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_IMMEDIATELY_DRAG_XY, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_CENTER_OFFSET, BRB_OTHER, CENTER, TOP, LEFT, BOTTOM, RIGHT, BASELINE
Inherited methods
From MenuBar
removeEmptySoftbuttons, getDefaultCommand, setDefaultCommand, getClearCommand, setClearCommand, findCommandComponent, getBackCommand, getSelectCommand, setSelectCommand, actionPerformed, createSoftButton, setUnselectedStyle, calcPreferredSize, setTransitions, isMenuShowing, showMenu, createBackCommandButton, getCommand, getCommandCount, createSelectCommand, createMenuSelectCommand, createMenuCancelCommand, setMenuCellRenderer, getMenuStyle, handlesKeycode, keyPressed, refreshTheme, showMenuDialog, isReverseSoftButtons, calculateTouchCommandGridColumns, setCommandUIID, createCommandComponent, getCommands, createCommandList, getSelectMenuItem, getCancelMenuItem, isMinimizeOnBack, setMinimizeOnBack, getTitleAreaContainer, getTitleComponent
From Container
encloseIn, encloseIn, initLaf, getUIManager, setUIManager, isSurface, add, addAll, add, add, add, add, add, getLeadComponent, setLeadComponent, getLeadParent, getLayout, setLayout, invalidate, setShouldLayout, setShouldCalcPreferredSize, getLayoutWidth, getLayoutHeight, applyRTL, constrainWidthWhenScrollable, constrainHeightWhenScrollable, addComponent, addComponent, addComponent, addComponent, replaceAndWait, replaceAndWait, replace, replaceAndWait, replace, createReplaceTransition, isEnabled, setEnabled, removeComponent, cancelRepaints, flushReplace, removeAll, revalidateWithAnimationSafety, revalidate, revalidateLater, forceRevalidate, clearClientProperties, paint, paintGlass, layoutContainer, isSafeArea, setSafeArea, isSafeAreaRoot, getSafeAreaRoot, setSafeAreaRoot, getComponentCount, getComponentAt, getComponentIndex, contains, scrollComponentToVisible, getClosestComponentTo, getResponderAt, getComponentAt, findDropTargetAt, pointerPressed, paramString, isScrollableX, setScrollableX, isScrollableY, setScrollableY, getSideGap, getBottomGap, setScrollable, setCellRenderer, getScrollIncrement, setScrollIncrement, findFirstFocusable, dragInitiated, fireClicked, isSelectableInteraction, getGridPosY, paintComponentBackground, getGridPosX, animateHierarchyAndWait, createAnimateHierarchy, animateHierarchy, animateHierarchyFadeAndWait, createAnimateHierarchyFade, animateHierarchyFade, animateLayoutFadeAndWait, createAnimateLayoutFadeAndWait, animateLayoutFade, createAnimateLayoutFade, animateLayoutAndWait, animateLayout, updateTabIndices, createAnimateLayout, drop, createAnimateMotion, morph, morphAndWait, animateUnlayout, animateUnlayoutAndWait, createAnimateUnlayout, getChildrenAsList, iterator, iterator
From Component
setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, setVisible, getClientProperty, stripMarginAndPadding, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, isDragRegion, getBaseline, getBaselineResizeBehavior, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbars, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, paintBackground, isScrollable, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, getComponentForm, getTopLevelContainer, repaint, repaint, longKeyPress, keyRepeated, registerForAnimation, deregisterFromAnimation, getAnimationManager, getScrollAnimationSpeed, setScrollAnimationSpeed, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, isSmoothScrolling, setSmoothScrolling, pointerHover, stopScrollMomentum, pointerHoverReleased, pointerHoverPressed, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, pointerDragged, getDragImage, getDragTransparency, setDragTransparency, toImage, drawDraggedImage, draggingOver, dragEnter, dragExit, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, pointerDragged, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerReleased, longPointerPress, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, getTextSelectionSupport, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addPointerPressedListener, addLongPressListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, mouseWheel, paintRippleOverlay, removePointerPressedListener, removeLongPressListener, removeDragFinishedListener, addPointerReleasedListener, removePointerReleasedListener, addPointerDraggedListener, removePointerDraggedListener, getDragSpeed, getStyle, getPressedStyle, setPressedStyle, initUnselectedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, refreshTheme, refreshTheme, isDragActivated, animate, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, isScrollVisible, setScrollVisible, setIsScrollVisible, startEditingAsync, stopEditing, isEditing, isEditable, laidOut, deinitialize, initComponent, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, getPropertyNames, getPropertyTypes, getPropertyTypeNames, getPropertyValue, setPropertyValue, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isAlwaysTensile, setAlwaysTensile, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, getBindablePropertyNames, getBindablePropertyTypes, bindProperty, unbindProperty, getBoundPropertyValue, setBoundPropertyValue, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip
Field details
COMMAND_PLACEMENT_KEY
public static final String COMMAND_PLACEMENT_KEY = "placement"COMMAND_PLACEMENT_VALUE_RIGHT
public static final String COMMAND_PLACEMENT_VALUE_RIGHT = "right"COMMAND_PLACEMENT_VALUE_TOP
public static final String COMMAND_PLACEMENT_VALUE_TOP = "top"COMMAND_SIDE_COMPONENT
public static final String COMMAND_SIDE_COMPONENT = "SideComponent"COMMAND_ACTIONABLE
public static final String COMMAND_ACTIONABLE = "Actionable"Constructor details
SideMenuBar
public SideMenuBar()Method details
isShowing
public static boolean isShowing()Returns
closeCurrentMenu
public static void closeCurrentMenu()closeCurrentMenu
public static void closeCurrentMenu(Runnable callback)Parameters
callbackRunnable- will be invoked when the menu is actually closed
initMenuBar
protected void initMenuBar(Form parent)Parameters
parentForm- the associated Form
removeAllCommands
protected void removeAllCommands()unInstallMenuBar
protected void unInstallMenuBar()createOpenButton
protected Button createOpenButton()Returns
installMenuBar
protected void installMenuBar()getDragRegionStatus
protected int getDragRegionStatus(int x, int y)Parameters
xint- x location for the touch
yint- y location for the touch
Returns
addCommand
public void addCommand(Command cmd)Parameters
cmdCommand- Command to add
setBackCommand
public void setBackCommand(Command backCommand)Parameters
backCommandCommand- the command to treat as the back Command
getCommandBehavior
public int getCommandBehavior()addCommand
protected void addCommand(Command cmd, int index)Parameters
cmdCommand- Command to Add
indexint- determines the order of the added commands
removeCommand
protected void removeCommand(Command cmd)Parameters
cmdCommand- Command to remove
keyReleased
public void keyReleased(int keyCode)Parameters
keyCodeint- the key code value to indicate a physical key.
closeMenu
public void closeMenu()openMenu
public void openMenu(String direction)isMenuOpen
public boolean isMenuOpen()Returns
addComponentToSideMenu
protected void addComponentToSideMenu(Container menu, Component cmp)Parameters
menuContainer- the Menu Container that was created in the constructSideNavigationComponent() method
cmpComponent- the Component to add to the side menu
createTouchCommandButton
protected Button createTouchCommandButton(Command c)Parameters
cCommand- command to map into the returned button
Returns
getParentForm
public Form getParentForm()