public class CmsResourceIcon extends com.vaadin.ui.Label
Important: To avoid issues with click event propagation within tables, we are required to extent the Label component.
Modifier and Type | Class and Description |
---|---|
static class |
CmsResourceIcon.IconMode
Enum used to control icon display style.
|
com.vaadin.ui.Label.ValueChangeEvent
com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeEvent, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.Transactional<T>, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
Constructor and Description |
---|
CmsResourceIcon()
Constuctor.
|
CmsResourceIcon(CmsResourceUtil resUtil,
java.lang.String iconPath,
CmsResourceState state,
boolean showLocks)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDefaultFileOrDetailType(CmsObject cms,
CmsResource resource)
Returns the default file type or detail type for the given resource.
|
static java.lang.String |
getDetailType(CmsObject cms,
CmsResource detailPage,
CmsResource parentFolder)
Returns the detail content type for container pages that may be detail pages.
|
static java.lang.String |
getIconHTML(CmsResourceUtil resUtil,
java.lang.String iconPath,
CmsResourceState state,
boolean showLocks)
Returns the icon HTML.
|
static java.lang.String |
getSitemapResourceIcon(CmsObject cms,
CmsResource resource,
CmsResourceIcon.IconMode iconMode)
Gets the resource icon for a resource for use in a CmsResourceInfo widget when used in a sitemap context.
|
static java.lang.String |
getTreeCaptionHTML(java.lang.String resourceName,
CmsResourceUtil resUtil,
java.lang.String iconPath,
CmsResourceState state,
boolean showLocks)
Returns the tree caption HTML including the resource icon.
|
void |
initContent(CmsResourceUtil resUtil,
java.lang.String iconPath,
CmsResourceState state,
boolean showLocks,
boolean showDetailIcon)
Initializes the content.
|
addListener, addValueChangeListener, attach, compareTo, fireValueChange, getContentMode, getConverter, getCustomAttributes, getPropertyDataSource, getState, getState, getType, getValue, readDesign, removeListener, removeValueChangeListener, setContentMode, setConverter, setLocale, setPropertyDataSource, setValue, toString, valueChange, writeDesign
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
public CmsResourceIcon()
To be used in declarative layouts. Make sure to call initContent later on.
public CmsResourceIcon(CmsResourceUtil resUtil, java.lang.String iconPath, CmsResourceState state, boolean showLocks)
resUtil
- the resource utiliconPath
- the resource iconstate
- the resource stateshowLocks
- true
to show the resource lockspublic static java.lang.String getDefaultFileOrDetailType(CmsObject cms, CmsResource resource)
cms
- the cms contextresource
- the container page resourcepublic static java.lang.String getDetailType(CmsObject cms, CmsResource detailPage, CmsResource parentFolder)
cms
- the cms contextdetailPage
- the container page resourceparentFolder
- the parent folder or null
public static java.lang.String getIconHTML(CmsResourceUtil resUtil, java.lang.String iconPath, CmsResourceState state, boolean showLocks)
resUtil
- the resource util for the resourceiconPath
- the icon pathstate
- the resource stateshowLocks
- true
to show lock state overlaypublic static java.lang.String getSitemapResourceIcon(CmsObject cms, CmsResource resource, CmsResourceIcon.IconMode iconMode)
cms
- the CMS contextresource
- a resourceiconMode
- the icon modepublic static java.lang.String getTreeCaptionHTML(java.lang.String resourceName, CmsResourceUtil resUtil, java.lang.String iconPath, CmsResourceState state, boolean showLocks)
resourceName
- the resource name to displayresUtil
- the resource util for the resourceiconPath
- the icon pathstate
- the resource stateshowLocks
- true
to show lock state overlaypublic void initContent(CmsResourceUtil resUtil, java.lang.String iconPath, CmsResourceState state, boolean showLocks, boolean showDetailIcon)
resUtil
- the resource utiliconPath
- the resource iconstate
- the resource stateshowLocks
- true
to show the resource locksshowDetailIcon
- true
to show the detail icon overlay