
public class TWTSideBarView extends AbstractEntityView
A component inspired by the Twitter mobile app’s sidebar menu.
This is designed to work seamlessly with the
TWTFormController
and the CollapsibleSideBarContainer
to provide a sidebar menu for
an app that uses the Tweet App UI Kit. It is the default component returned by TWTFormController#createSideBarView(), and this controller
uses the CollapsibleSideBarContainer
view to wrap its content by default.
However, this component can be used on its own as well.
There are no special requirements for the view model. If the view model implements Thing.name
and/or Thing.thumbnailUrl
,
these will be used to generate the user avatar. Customization of the content of this view is primarily handled
by registering actions.
SIDEBAR_TOP_ACTIONS
- Actions displayed at the top of the sidebar.
SIDEBAR_TOP_OVERFLOW_MENU
- Actions displayed in the overflow menu at the top of the sidebar.
SIDEBAR_STATS
- Actions meant to display user stats (e.g. 2034 Posts, etc..).
SIDEBAR_ACTIONS
- The primary menu items in the sidebar. These will render icon and text.
SIDEBAR_SETTINGS_ACTIONS
- Additional settings/related actions that are rendered below the SIDEBAR_ACTIONS
menu. These will be rendered
as text only. No icons.
SIDEBAR_BOTTOM_LEFT_ACTIONS
- Actions rendered in the bottom left.
SIDEBAR_BOTTOM_RIGHT_ACTIONS
- Actions rendered in the bottom right.
TWTSideBar
- UIID for the component.
TWTSideBarTopAction
- UIID used for buttons in the SIDEBAR_TOP_ACTIONS
category.
TWTSideBarAction
- UIID used by main actions. i.e. SIDEBAR_ACTIONS
category.
TWTSideBarActionIcon
- UIID used for icons of main actions. I.e. icons of SIDEBAR_ACTIONS
category.
TWTSideBarStatsAction
- UIID used by stats actions. I.e. SIDEBAR_STATS
category.
TWTSideBarStatsActionIcon
- UIID used for icons of stats actions.
TWTSideBarBottomLeftAction
- UIID used for bottom left actions. I.e. SIDEBAR_BOTTOM_LEFT_ACTIONS
category.
TWTSideBarBottomLeftActionsWrapper
- UIID used for wrapper container of all of the bottom left actions.
TWTSideBarBottomRightAction
- UIID used for bottom right actions. I.e. SIDEBAR_BOTTOM_RIGHT_ACTIONS
category.
TWTSideBarBottomRightActionsWrapper
- UIID used for wrapper container of all of the bottom right actions.
TWTSideBarWrapper
- Wrapper component inside TWTSideBar
but wrapping all of the content.
TWTSideBarNorth
- North container in the sidebar. This wraps top actions, avatar/username, and stats actions.
TWTSideBarOverflowMenuButton
- UIID of the overflow menu button.
TWTSideBarNameLabel
- UIID for the label with the profile user name.
TWTSideBarIDLabel
- UIID for the label with the user ID.
TWTSideBarStatsActionsWrapper
- UIID for the wrapper container of all of the stats actions.
TWTSideBarCenter
- UIID for the wrapper container of the CENTER slot in the TWTSideBarWrapper. This wraps the SIDEBAR_ACTIONS and SIDEBAR_SETTINGS_ACTIONS.
TWTSideBarActionsWrapper
- UIID for the sidebar actions wrapper container.
TWTSideBarSettingsActionsWrapper
- UIID for the container that wraps the settings actions.
TWTSideBarSouth
- UIID for the south container. This wraps the bottom left and bottom right actions.
<twtSideBarView />
Modifier and Type | Field and Description |
---|---|
static ActionNode.Category |
SIDEBAR_ACTIONS
Actions rendered at the top of the sidebar.
|
static ActionNode.Category |
SIDEBAR_BOTTOM_LEFT_ACTIONS
Actions rendered at the top of the sidebar.
|
static ActionNode.Category |
SIDEBAR_BOTTOM_RIGHT_ACTIONS
Actions rendered at the top of the sidebar.
|
static ActionNode.Category |
SIDEBAR_SETTINGS_ACTIONS
Actions rendered at the top of the sidebar.
|
static ActionNode.Category |
SIDEBAR_STATS
Actions rendered at the top of the sidebar.
|
static ActionNode.Category |
SIDEBAR_TOP_ACTIONS
Actions rendered at the top of the sidebar.
|
static ActionNode.Category |
SIDEBAR_TOP_OVERFLOW_MENU
Actions rendered at the top of the sidebar.
|
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 and Description |
---|
TWTSideBarView(Entity entity,
ViewNode node)
Deprecated.
|
TWTSideBarView(ViewContext context) |
Modifier and Type | Method and Description |
---|---|
protected Dimension |
calcPreferredSize() |
void |
commit() |
void |
layoutContainer() |
void |
update() |
activate, addBindListener, addUnbindListener, addUpdateListener, bind, bindImpl, deinitialize, findProperty, getContext, getEntity, getParam, getViewNode, initComponent, isBindOnPropertyChangeEvents, removeUpdateListener, setBindOnPropertyChangeEvents, setEntity, unbind, unbindImpl
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, iterator, iterator, keyPressed, keyReleased, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerPressed, refreshTheme, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndices
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, animate, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, 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, initCustomStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, parsePreferredSize, 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, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDirtyRegion, setDisabledStyle, setDraggable, 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, 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, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final ActionNode.Category SIDEBAR_TOP_ACTIONS
Actions rendered at the top of the sidebar.
public static final ActionNode.Category SIDEBAR_TOP_OVERFLOW_MENU
Actions rendered at the top of the sidebar.
public static final ActionNode.Category SIDEBAR_STATS
Actions rendered at the top of the sidebar.
public static final ActionNode.Category SIDEBAR_ACTIONS
Actions rendered at the top of the sidebar.
public static final ActionNode.Category SIDEBAR_SETTINGS_ACTIONS
Actions rendered at the top of the sidebar.
public static final ActionNode.Category SIDEBAR_BOTTOM_LEFT_ACTIONS
Actions rendered at the top of the sidebar.
public static final ActionNode.Category SIDEBAR_BOTTOM_RIGHT_ACTIONS
Actions rendered at the top of the sidebar.
public TWTSideBarView(ViewContext context)
public TWTSideBarView(Entity entity, ViewNode node)
TWTSideBarView(ViewContext)
Creates a new sidebar.
entity
- The view model. See class documentation for specific view model requirements.node
- The UI descriptor. See class documentation for UI descriptor requirements, including supported action categories.public void update()
public void commit()
public void layoutContainer()
layoutContainer
in class Container
protected Dimension calcPreferredSize()
calcPreferredSize
in class Container
Copyright © 2021. All Rights Reserved.