public class ChatBubbleView<T extends Entity> extends AbstractEntityView<T>
A view for a single row/chat bubble in a Chat view. This view is used to render rows for the ChatRoomView
view.
<h3>View Model Requirements</h3>
<p>See ChatBubbleView.ViewModel
for a reference view model for use in this view. However, you don’t need to use this class. Any
entity that implements the required properties will do.</p>
<p><strong>Properties:</strong></p>
<ul>
<li><strong>CreativeWork.text
</strong> - Required. The text to appear in the chat bubble.</li>
<li><strong>CreativeWork.creator
</strong> - Optional. The name of the person who sent the chat message.</li>
<li><strong>Thing.thumbnailUrl
</strong> or ListRowItem.icon
- Optional. The icon or URL to
the user’s avatar who posted the message.
</li>
<li><strong>CreativeWork.datePublished
</strong> - Optional. The date-time the message was posted.</li>
<li><strong>ChatMessage.isOwnMessage
</strong> - Optional. Boolean flag indicating that the message was posted by the current user.
If this isn’t present, it will use an empty CreativeWork.creator
field to imply "true" on this field.
</li>
</ul>
<h3>Supported Actions</h3>
<p>This view supports the following actions:</p>
<ul>
<li>CHAT_BUBBLE_CLICKED
</li>
<li>CHAT_BUBBLE_LONG_PRESS
</li>
<li>CHAT_BUBBLE_CLICKED_MENU
</li>
<li>CHAT_BUBBLE_LONG_PRESS_MENU
</li>
<li>CHAT_BUBBLE_BADGES
</li>
</ul>
<p>In addition to these actions, the poster’s "icon" or thumbnail URL is rendered by the ProfileAvatarView
view
which supports several actions as well. Actions defined on this chat bubble’s view node will be accessible to the
embedded ProfileAvatarView
.</p>
Modifier and Type | Class and Description |
---|---|
static class |
ChatBubbleView.ChatBubbleListCellRenderer
A list cell renderer for creating a row of
ChatBubbleView inside an EntityListView . |
static class |
ChatBubbleView.ViewModel
This is a view model class that may be used as a model for the ChatBubbleView, as it
defines properties with all of the required tags.
|
Modifier and Type | Field and Description |
---|---|
static ActionNode.Category |
CHAT_BUBBLE_BADGES
Actions displayed as "badges" of a chat bubble.
|
static ActionNode.Category |
CHAT_BUBBLE_CLICKED
Action fired when user clicks chat bubble.
|
static ActionNode.Category |
CHAT_BUBBLE_CLICKED_MENU
Actions displayed in popup menu when user clicks chat bubble.
|
static ActionNode.Category |
CHAT_BUBBLE_LONG_PRESS
Action fired when user longpresses chat bubble.
|
static ActionNode.Category |
CHAT_BUBBLE_LONG_PRESS_MENU
Actions displayed in popup menu when user long presses a chat bubble.
|
static Tag |
icon |
static Tag |
TEXT |
static ViewProperty<Boolean> |
USE_OVERFLOW_CONTAINER
View property that can be used to indicate that the chat room should use or not
use an overflow container for the time of a text.
|
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 |
---|
ChatBubbleView(T entity,
Node viewNode)
Creates a new chat bubble view for the given entity.
|
Modifier and Type | Method and Description |
---|---|
void |
commit() |
protected void |
deinitialize() |
Node |
getViewNode() |
protected void |
initComponent() |
void |
update() |
bind, findProperty, getEntity, setEntity, unbind
add, add, add, add, add, add, addAll, addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, 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, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isScrollableX, isScrollableY, isSelectableInteraction, iterator, iterator, keyPressed, keyReleased, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerPressed, refreshTheme, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndices
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, animate, bindProperty, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, 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, 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, getUIID, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFocus, hideNativeOverlay, initCustomStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, 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, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, parsePreferredSize, pinch, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, 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, setTraversable, setUIID, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final ActionNode.Category CHAT_BUBBLE_LONG_PRESS_MENU
Actions displayed in popup menu when user long presses a chat bubble.
public static final ActionNode.Category CHAT_BUBBLE_CLICKED_MENU
Actions displayed in popup menu when user clicks chat bubble.
public static final ActionNode.Category CHAT_BUBBLE_CLICKED
Action fired when user clicks chat bubble.
public static final ActionNode.Category CHAT_BUBBLE_LONG_PRESS
Action fired when user longpresses chat bubble.
public static final ActionNode.Category CHAT_BUBBLE_BADGES
Actions displayed as "badges" of a chat bubble.
public static final Tag TEXT
public static final Tag icon
public static final ViewProperty<Boolean> USE_OVERFLOW_CONTAINER
View property that can be used to indicate that the chat room should use or not use an overflow container for the time of a text.
public ChatBubbleView(T entity, Node viewNode)
Creates a new chat bubble view for the given entity.
entity
- The view model. See ChatBubbleView.ViewModel
for a reference view model, but custom classes will work fine. The view expects properties with tags CreativeWork.text
,
ListRowItem.icon
(or Thing.thumbnailUrl
, CreativeWork.datePublished
, ChatMessage.isOwnMessage
, ChatMessage.typingInProgress
,
and CreativeWork.creator
. However, if a property is missing, it will generally fall-back sensibly, just omitting that information. The only critical
property is CreativeWork.text
which is used as the text of the chat bubble.viewNode
- The view descriptor. Used to pass view parameters, actions, and other view settings.protected void initComponent()
initComponent
in class AbstractEntityView<T extends Entity>
protected void deinitialize()
deinitialize
in class AbstractEntityView<T extends Entity>
public void update()
public void commit()
public Node getViewNode()