Package org.opencms.gwt.client.ui
Class CmsListItemWidget
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.opencms.gwt.client.ui.CmsListItemWidget
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasClickHandlers,com.google.gwt.event.dom.client.HasDoubleClickHandlers,com.google.gwt.event.dom.client.HasMouseOutHandlers,com.google.gwt.event.dom.client.HasMouseOverHandlers,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasCloseHandlers<CmsListItemWidget>,com.google.gwt.event.logical.shared.HasOpenHandlers<CmsListItemWidget>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget,I_CmsTruncable
- Direct Known Subclasses:
CmsGalleryTreeItem.CmsGalleryListItemWidget,CmsInfoLoadingListItemWidget,CmsModelPageTreeItem.CmsModelPageListItemWidget,CmsResultItemWidget
public class CmsListItemWidget
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.logical.shared.HasOpenHandlers<CmsListItemWidget>, com.google.gwt.event.logical.shared.HasCloseHandlers<CmsListItemWidget>, com.google.gwt.event.dom.client.HasMouseOutHandlers, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasDoubleClickHandlers, com.google.gwt.event.dom.client.HasMouseOverHandlers, I_CmsTruncable
Provides a UI list item.
- Since:
- 8.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAdditional info item HTML.static enumBackground color values.protected static interfacestatic interfaceThe interface for handling edits of the title field.Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.google.gwt.user.client.ui.FlowPanelDIV for additional item info.protected com.google.gwt.user.client.ui.FlowPanelPanel to hold buttons.protected com.google.gwt.user.client.ui.FlowPanelPanel to hold the content.protected List<com.google.gwt.event.dom.client.ClickHandler> A list of click handlers for the main icon.protected com.google.gwt.user.client.ui.SimplePanelThe DIV showing the list icon.protected CmsPushButtonThe open-close button for the additional info.protected com.google.gwt.user.client.ui.InlineLabelA label which is optionally displayed after the subtitle.protected CmsLabelSub title label.protected CmsLabelTitle label.protected com.google.gwt.user.client.ui.FlowPanelContainer for the title.protected com.google.gwt.user.client.ui.FlowPanelThe title row, holding the title and the open-close button for the additional info.protected static final StringThe CSS class to set the additional info open.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionCmsListItemWidget(org.opencms.gwt.shared.CmsListInfoBean infoBean) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdditionalInfo(org.opencms.gwt.shared.CmsAdditionalInfoBean additionalInfo) Adds an additional info item to the list.voidaddButton(com.google.gwt.user.client.ui.Widget w) Adds a widget to the button panel.voidaddButtonToFront(com.google.gwt.user.client.ui.Widget w) Adds a widget to the front of the button panel.com.google.gwt.event.shared.HandlerRegistrationaddClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<CmsListItemWidget> handler) com.google.gwt.event.shared.HandlerRegistrationaddDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddIconClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) Adds a mouse click handler to the icon panel.com.google.gwt.event.shared.HandlerRegistrationaddMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<CmsListItemWidget> handler) voidaddSubtitleStyleName(String styleName) Adds a style name to the subtitle label.voidaddTitleStyleName(String styleName) Adds a style name to the title label.voidHides the icon of the list item widget.protected voidInternal method which is called when the user clicks on an editable title field.protected voidEnsures the open close button for the additional info list is present.voidForces mouse out on self and contained buttons.com.google.gwt.user.client.ui.WidgetgetButton(int index) Returns the button at the given position.intReturns the number of buttons.com.google.gwt.user.client.ui.FlowPanelReturns the button panel.com.google.gwt.user.client.ui.FlowPanelReturns the content panel.org.opencms.gwt.shared.CmsListInfoBeancom.google.gwt.user.client.ui.InlineLabelReturns the label after the subtitle.Returns the subtitle label.Returns the title label text.Gets the title widget.booleanReturns if additional info items are present.protected voidinit(org.opencms.gwt.shared.CmsListInfoBean infoBean) Constructor.protected voidinitAdditionalInfo(org.opencms.gwt.shared.CmsListInfoBean infoBean) Initializes the additional info.protected voidonEditTitleTextBox(com.google.gwt.user.client.ui.TextBox box) Internal method which is called when the user has finished editing the title.voidreInitAdditionalInfo(org.opencms.gwt.shared.CmsListInfoBean infoBean) Re-initializes the additional infos.voidremoveButton(com.google.gwt.user.client.ui.Widget w) Removes a widget from the button panel.voidRemoves all registered mouse event handlers including the context menu handler.voidremoveSubtitleStyleName(String styleName) Removes a style name from the subtitle label.voidremoveTitleStyleName(String styleName) Removes a style name from the title label.voidsetAdditionalInfoValue(int index, String label) Sets the additional info value label at the given position.voidsetAdditionalInfoVisible(boolean visible) Sets the additional info visible if present.voidsetBackground(CmsListItemWidget.Background background) Sets the background color.voidsetExtraInfo(String text) Sets the extra info text, and hides or displays the extra info label depending on whether the text is null or not null.voidsetIcon(com.google.gwt.user.client.ui.Image image) Sets the icon of this item.voidSets the icon for this item using the given CSS classes.voidSets the icon for this item using the given CSS classes.voidsetIconCursor(com.google.gwt.dom.client.Style.Cursor cursor) Sets the cursor for the icon.voidsetIconTitle(String title) Sets the icon title.voidsetLockIcon(org.opencms.gwt.shared.CmsListInfoBean.LockIcon icon, String iconTitle) Sets the lock icon.voidsetStateIcon(org.opencms.gwt.shared.CmsListInfoBean.StateIcon icon) Sets the state icon.voidsetSubtitleLabel(String label) Sets the subtitle label text.voidsetTitleEditable(boolean editable) Enables or disabled editing of the title field.voidSets the handler for editing the list item widget's title.voidsetTitleLabel(String label) Sets the title label text.voidsetTopRightIcon(String iconClass, String title) Sets the icon in the top right corner and its title.voidMakes the content of the list info box unselectable.voidTruncates long text and sets the original text to the title attribute.voidtruncateAdditionalInfo(String textMetricsPrefix, int widgetWidth) Truncates the additional info items.voidUpdates the truncation of labels if needed.Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetMethods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Field Details
-
OPENCLASS
The CSS class to set the additional info open. -
m_additionalInfo
DIV for additional item info. -
m_buttonPanel
Panel to hold buttons. -
m_contentPanel
Panel to hold the content. -
m_iconClickHandlers
A list of click handlers for the main icon. -
m_iconPanel
The DIV showing the list icon. -
m_openClose
The open-close button for the additional info. -
m_shortExtraInfoLabel
A label which is optionally displayed after the subtitle. -
m_subtitle
Sub title label. -
m_title
Title label. -
m_titleBox
Container for the title. -
m_titleRow
The title row, holding the title and the open-close button for the additional info.
-
-
Constructor Details
-
Method Details
-
addButton
Adds a widget to the button panel.- Parameters:
w- the widget to add
-
addButtonToFront
Adds a widget to the front of the button panel.- Parameters:
w- the widget to add
-
addClickHandler
public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) - Specified by:
addClickHandlerin interfacecom.google.gwt.event.dom.client.HasClickHandlers- See Also:
-
addDoubleClickHandler
public com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler) - Specified by:
addDoubleClickHandlerin interfacecom.google.gwt.event.dom.client.HasDoubleClickHandlers- See Also:
-
addIconClickHandler
public com.google.gwt.event.shared.HandlerRegistration addIconClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) Adds a mouse click handler to the icon panel.- Parameters:
handler- the click handler- Returns:
- the handler registration
-
addMouseOutHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) - Specified by:
addMouseOutHandlerin interfacecom.google.gwt.event.dom.client.HasMouseOutHandlers- See Also:
-
addMouseOverHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) - Specified by:
addMouseOverHandlerin interfacecom.google.gwt.event.dom.client.HasMouseOverHandlers- See Also:
-
addSubtitleStyleName
Adds a style name to the subtitle label.- Parameters:
styleName- the style name to add
-
addTitleStyleName
Adds a style name to the title label.- Parameters:
styleName- the style name to add
-
clearIcon
Hides the icon of the list item widget. -
forceMouseOut
Forces mouse out on self and contained buttons. -
getButton
Returns the button at the given position.- Parameters:
index- the button index- Returns:
- the button at the given position
-
getButtonCount
Returns the number of buttons.- Returns:
- the number of buttons
-
getButtonPanel
Returns the button panel.- Returns:
- the button panel
-
getContentPanel
Returns the content panel.- Returns:
- the content panel
-
getInfoBean
-
getOpenClose
-
getShortExtraInfoLabel
Returns the label after the subtitle.- Returns:
- the label after the subtitle
-
getSubtitleLabel
Returns the subtitle label.- Returns:
- the subtitle label
-
getTitleLabel
Returns the title label text.- Returns:
- the title label text
-
getTitleWidget
Gets the title widget.- Returns:
- the title widget
-
hasAdditionalInfo
Returns if additional info items are present.- Returns:
trueif additional info items are present
-
removeButton
Removes a widget from the button panel.- Parameters:
w- the widget to remove
-
removeMouseHandlers
Removes all registered mouse event handlers including the context menu handler. -
removeSubtitleStyleName
Removes a style name from the subtitle label.- Parameters:
styleName- the style name to add
-
removeTitleStyleName
Removes a style name from the title label.- Parameters:
styleName- the style name to add
-
setAdditionalInfoValue
Sets the additional info value label at the given position.- Parameters:
index- the additional info indexlabel- the new value to set
-
setAdditionalInfoVisible
Sets the additional info visible if present.- Parameters:
visible-trueto show,falseto hide
-
setBackground
Sets the background color.- Parameters:
background- the color
-
setExtraInfo
Sets the extra info text, and hides or displays the extra info label depending on whether the text is null or not null.- Parameters:
text- the text to put into the subtitle suffix
-
setIcon
Sets the icon of this item.- Parameters:
image- the image to use as icon
-
setIcon
Sets the icon for this item using the given CSS classes.- Parameters:
iconClasses- the CSS classes
-
setIcon
Sets the icon for this item using the given CSS classes.- Parameters:
iconClasses- the CSS classesdetailIconClasses- the detail type icon classes if available
-
setIconCursor
Sets the cursor for the icon.- Parameters:
cursor- the cursor for the icon
-
setIconTitle
Sets the icon title.- Parameters:
title- the new icon title
-
setSubtitleLabel
Sets the subtitle label text.- Parameters:
label- the new subtitle to set
-
setTitleEditable
Enables or disabled editing of the title field.- Parameters:
editable- if true, makes the title field editable
-
setTitleEditHandler
Sets the handler for editing the list item widget's title.- Parameters:
handler- the new title editing handler
-
setTitleLabel
Sets the title label text.- Parameters:
label- the new title to set
-
setTopRightIcon
Sets the icon in the top right corner and its title.- Parameters:
iconClass- the CSS class for the icontitle- the value for the title attribute of the icon
-
setUnselectable
Makes the content of the list info box unselectable. -
truncate
Description copied from interface:I_CmsTruncableTruncates long text and sets the original text to the title attribute.- Specified by:
truncatein interfaceI_CmsTruncable- Parameters:
textMetricsPrefix- the key identifying the text metrics to usewidgetWidth- the width to use in pixels- See Also:
-
truncateAdditionalInfo
Truncates the additional info items.- Parameters:
textMetricsPrefix- the text metrics prefixwidgetWidth- the width to truncate to
-
updateTruncation
Updates the truncation of labels if needed.Use after changing any text on the widget.
-
editTitle
Internal method which is called when the user clicks on an editable title field. -
ensureOpenCloseAdditionalInfo
Ensures the open close button for the additional info list is present. -
onEditTitleTextBox
Internal method which is called when the user has finished editing the title.- Parameters:
box- the text box which has been edited