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
限定符和类型 | 类和说明 |
---|---|
static class |
CmsListItemWidget.AdditionalInfoItem
Additional info item HTML.
|
static class |
CmsListItemWidget.Background
Background color values.
|
protected static interface |
CmsListItemWidget.I_CmsListItemWidgetUiBinder |
static interface |
CmsListItemWidget.I_CmsTitleEditHandler
The interface for handling edits of the title field.
|
限定符和类型 | 字段和说明 |
---|---|
protected com.google.gwt.user.client.ui.FlowPanel |
m_additionalInfo
DIV for additional item info.
|
protected com.google.gwt.user.client.ui.FlowPanel |
m_buttonPanel
Panel to hold buttons.
|
protected com.google.gwt.user.client.ui.FlowPanel |
m_contentPanel
Panel to hold the content.
|
protected java.util.List<com.google.gwt.event.dom.client.ClickHandler> |
m_iconClickHandlers
A list of click handlers for the main icon.
|
protected com.google.gwt.user.client.ui.SimplePanel |
m_iconPanel
The DIV showing the list icon.
|
protected CmsPushButton |
m_openClose
The open-close button for the additional info.
|
protected com.google.gwt.user.client.ui.InlineLabel |
m_shortExtraInfoLabel
A label which is optionally displayed after the subtitle.
|
protected CmsLabel |
m_subtitle
Sub title label.
|
protected CmsLabel |
m_title
Title label.
|
protected com.google.gwt.user.client.ui.FlowPanel |
m_titleBox
Container for the title.
|
protected com.google.gwt.user.client.ui.FlowPanel |
m_titleRow
The title row, holding the title and the open-close button for the additional info.
|
protected static java.lang.String |
OPENCLASS
The CSS class to set the additional info open.
|
构造器和说明 |
---|
CmsListItemWidget(CmsListInfoBean infoBean)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addAdditionalInfo(CmsAdditionalInfoBean additionalInfo)
Adds an additional info item to the list.
|
void |
addButton(com.google.gwt.user.client.ui.Widget w)
Adds a widget to the button panel.
|
void |
addButtonToFront(com.google.gwt.user.client.ui.Widget w)
Adds a widget to the front of the button panel.
|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<CmsListItemWidget> handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addIconClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
Adds a mouse click handler to the icon panel.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<CmsListItemWidget> handler) |
void |
addSubtitleStyleName(java.lang.String styleName)
Adds a style name to the subtitle label.
|
void |
addTitleStyleName(java.lang.String styleName)
Adds a style name to the title label.
|
void |
clearIcon()
Hides the icon of the list item widget.
|
protected void |
editTitle()
Internal method which is called when the user clicks on an editable title field.
|
protected void |
ensureOpenCloseAdditionalInfo()
Ensures the open close button for the additional info list is present.
|
void |
forceMouseOut()
Forces mouse out on self and contained buttons.
|
com.google.gwt.user.client.ui.Widget |
getButton(int index)
Returns the button at the given position.
|
int |
getButtonCount()
Returns the number of buttons.
|
com.google.gwt.user.client.ui.FlowPanel |
getButtonPanel()
Returns the button panel.
|
com.google.gwt.user.client.ui.FlowPanel |
getContentPanel()
Returns the content panel.
|
com.google.gwt.user.client.ui.InlineLabel |
getShortExtraInfoLabel()
Returns the label after the subtitle.
|
java.lang.String |
getSubtitleLabel()
Returns the subtitle label.
|
java.lang.String |
getTitleLabel()
Returns the title label text.
|
CmsLabel |
getTitleWidget()
Gets the title widget.
|
boolean |
hasAdditionalInfo()
Returns if additional info items are present.
|
protected void |
init(CmsListInfoBean infoBean)
Constructor.
|
protected void |
initAdditionalInfo(CmsListInfoBean infoBean)
Initializes the additional info.
|
protected void |
onEditTitleTextBox(com.google.gwt.user.client.ui.TextBox box)
Internal method which is called when the user has finished editing the title.
|
void |
reInitAdditionalInfo(CmsListInfoBean infoBean)
Re-initializes the additional infos.
|
void |
removeButton(com.google.gwt.user.client.ui.Widget w)
Removes a widget from the button panel.
|
void |
removeMouseHandlers()
Removes all registered mouse event handlers including the context menu handler.
|
void |
removeSubtitleStyleName(java.lang.String styleName)
Removes a style name from the subtitle label.
|
void |
removeTitleStyleName(java.lang.String styleName)
Removes a style name from the title label.
|
void |
setAdditionalInfoValue(int index,
java.lang.String label)
Sets the additional info value label at the given position.
|
void |
setAdditionalInfoVisible(boolean visible)
Sets the additional info visible if present.
|
void |
setBackground(CmsListItemWidget.Background background)
Sets the background color.
|
void |
setExtraInfo(java.lang.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.
|
void |
setIcon(com.google.gwt.user.client.ui.Image image)
Sets the icon of this item.
|
void |
setIcon(java.lang.String iconClasses)
Sets the icon for this item using the given CSS classes.
|
void |
setIconCursor(com.google.gwt.dom.client.Style.Cursor cursor)
Sets the cursor for the icon.
|
void |
setIconTitle(java.lang.String title)
Sets the icon title.
|
void |
setLockIcon(CmsListInfoBean.LockIcon icon,
java.lang.String iconTitle)
Sets the lock icon.
|
void |
setStateIcon(CmsListInfoBean.StateIcon icon)
Sets the state icon.
|
void |
setSubtitleLabel(java.lang.String label)
Sets the subtitle label text.
|
void |
setTitleEditable(boolean editable)
Enables or disabled editing of the title field.
|
void |
setTitleEditHandler(CmsListItemWidget.I_CmsTitleEditHandler handler)
Sets the handler for editing the list item widget's title.
|
void |
setTitleLabel(java.lang.String label)
Sets the title label text.
|
void |
setTopRightIcon(java.lang.String iconClass,
java.lang.String title)
Sets the icon in the top right corner and its title.
|
void |
setUnselectable()
Makes the content of the list info box unselectable.
|
void |
truncate(java.lang.String textMetricsPrefix,
int widgetWidth)
Truncates long text and sets the original text to the title attribute.
|
void |
updateTruncation()
Updates the truncation of labels if needed.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
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, toString, unsinkEvents
protected static final java.lang.String OPENCLASS
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_additionalInfo
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_buttonPanel
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_contentPanel
protected java.util.List<com.google.gwt.event.dom.client.ClickHandler> m_iconClickHandlers
@UiField protected com.google.gwt.user.client.ui.SimplePanel m_iconPanel
protected CmsPushButton m_openClose
protected com.google.gwt.user.client.ui.InlineLabel m_shortExtraInfoLabel
@UiField protected CmsLabel m_subtitle
@UiField protected CmsLabel m_title
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_titleBox
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_titleRow
public CmsListItemWidget(CmsListInfoBean infoBean)
infoBean
- bean holding the item informationpublic void addAdditionalInfo(CmsAdditionalInfoBean additionalInfo)
additionalInfo
- the additional info to displaypublic void addButton(com.google.gwt.user.client.ui.Widget w)
w
- the widget to addpublic void addButtonToFront(com.google.gwt.user.client.ui.Widget w)
w
- the widget to addpublic com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler
在接口中 com.google.gwt.event.dom.client.HasClickHandlers
HasClickHandlers.addClickHandler(ClickHandler)
public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<CmsListItemWidget> handler)
addCloseHandler
在接口中 com.google.gwt.event.logical.shared.HasCloseHandlers<CmsListItemWidget>
HasCloseHandlers.addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler)
public com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler handler)
addDoubleClickHandler
在接口中 com.google.gwt.event.dom.client.HasDoubleClickHandlers
HasDoubleClickHandlers.addDoubleClickHandler(com.google.gwt.event.dom.client.DoubleClickHandler)
public com.google.gwt.event.shared.HandlerRegistration addIconClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
handler
- the click handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
addMouseOutHandler
在接口中 com.google.gwt.event.dom.client.HasMouseOutHandlers
HasMouseOutHandlers.addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)
public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
addMouseOverHandler
在接口中 com.google.gwt.event.dom.client.HasMouseOverHandlers
HasMouseOverHandlers.addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)
public com.google.gwt.event.shared.HandlerRegistration addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<CmsListItemWidget> handler)
addOpenHandler
在接口中 com.google.gwt.event.logical.shared.HasOpenHandlers<CmsListItemWidget>
HasOpenHandlers.addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler)
public void addSubtitleStyleName(java.lang.String styleName)
styleName
- the style name to addpublic void addTitleStyleName(java.lang.String styleName)
styleName
- the style name to addpublic void clearIcon()
public void forceMouseOut()
public com.google.gwt.user.client.ui.Widget getButton(int index)
index
- the button indexpublic int getButtonCount()
public com.google.gwt.user.client.ui.FlowPanel getButtonPanel()
public com.google.gwt.user.client.ui.FlowPanel getContentPanel()
public com.google.gwt.user.client.ui.InlineLabel getShortExtraInfoLabel()
public java.lang.String getSubtitleLabel()
public java.lang.String getTitleLabel()
public CmsLabel getTitleWidget()
public boolean hasAdditionalInfo()
true
if additional info items are presentpublic void reInitAdditionalInfo(CmsListInfoBean infoBean)
infoBean
- the info beanpublic void removeButton(com.google.gwt.user.client.ui.Widget w)
w
- the widget to removepublic void removeMouseHandlers()
public void removeSubtitleStyleName(java.lang.String styleName)
styleName
- the style name to addpublic void removeTitleStyleName(java.lang.String styleName)
styleName
- the style name to addpublic void setAdditionalInfoValue(int index, java.lang.String label)
index
- the additional info indexlabel
- the new value to setpublic void setAdditionalInfoVisible(boolean visible)
visible
- true
to show, false
to hidepublic void setBackground(CmsListItemWidget.Background background)
background
- the colorpublic void setExtraInfo(java.lang.String text)
text
- the text to put into the subtitle suffixpublic void setIcon(com.google.gwt.user.client.ui.Image image)
image
- the image to use as iconpublic void setIcon(java.lang.String iconClasses)
iconClasses
- the CSS classespublic void setIconCursor(com.google.gwt.dom.client.Style.Cursor cursor)
cursor
- the cursor for the iconpublic void setIconTitle(java.lang.String title)
title
- the new icon titlepublic void setLockIcon(CmsListInfoBean.LockIcon icon, java.lang.String iconTitle)
icon
- the icon to useiconTitle
- the icon titlepublic void setStateIcon(CmsListInfoBean.StateIcon icon)
The state icon indicates if a resource is exported, secure, etc.
icon
- the state iconpublic void setSubtitleLabel(java.lang.String label)
label
- the new subtitle to setpublic void setTitleEditable(boolean editable)
editable
- if true, makes the title field editablepublic void setTitleEditHandler(CmsListItemWidget.I_CmsTitleEditHandler handler)
handler
- the new title editing handlerpublic void setTitleLabel(java.lang.String label)
label
- the new title to setpublic void setTopRightIcon(java.lang.String iconClass, java.lang.String title)
iconClass
- the CSS class for the icontitle
- the value for the title attribute of the iconpublic void setUnselectable()
public void truncate(java.lang.String textMetricsPrefix, int widgetWidth)
I_CmsTruncable
truncate
在接口中 I_CmsTruncable
textMetricsPrefix
- the key identifying the text metrics to usewidgetWidth
- the width to use in pixelsI_CmsTruncable.truncate(java.lang.String, int)
public void updateTruncation()
Use after changing any text on the widget.
protected void editTitle()
protected void ensureOpenCloseAdditionalInfo()
protected void init(CmsListInfoBean infoBean)
infoBean
- bean holding the item informationprotected void initAdditionalInfo(CmsListInfoBean infoBean)
infoBean
- the info beanprotected void onEditTitleTextBox(com.google.gwt.user.client.ui.TextBox box)
box
- the text box which has been edited