public class CmsResourceTable extends com.vaadin.ui.CustomComponent
| Modifier and Type | Class and Description |
|---|---|
class |
CmsResourceTable.ColumnBuilder
Helper class for easily configuring a set of columns to display, together with their visibility / collapsed status.
|
static class |
CmsResourceTable.ColumnEntry
Contains the data for the given column, along with some flags to control visibility/collapsed status.
|
static interface |
CmsResourceTable.I_ResourcePropertyProvider
Provides item property values for additional table columns.
|
protected static class |
CmsResourceTable.ItemContainer
Extending the indexed container to make the number of un-filtered items available.
|
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListenercom.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listenercom.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener| Modifier and Type | Field and Description |
|---|---|
static int |
COLLAPSED
Flag to mark columns as initially collapsed.
|
static int |
INVISIBLE
Flag to mark columns as invisible.
|
protected CmsResourceTable.ItemContainer |
m_container
The resource data container.
|
protected com.vaadin.v7.ui.Table |
m_fileTable
The table used to display the resource data.
|
protected java.util.List<CmsResourceTable.I_ResourcePropertyProvider> |
m_propertyProviders
Property provider for additional columns.
|
| Constructor and Description |
|---|
CmsResourceTable()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyProvider(CmsResourceTable.I_ResourcePropertyProvider provider)
Adds a property provider.
|
void |
clearSelection()
Clears the value selection.
|
protected void |
fillItem(CmsObject cms,
CmsResource resource,
java.util.Locale locale)
Fills the file item data.
|
static void |
fillItemDefault(com.vaadin.v7.data.Item resourceItem,
CmsObject cms,
CmsResource resource,
java.util.Locale locale)
Static helper method to initialize the 'standard' properties of a data item from a given resource.
|
void |
fillTable(CmsObject cms,
java.util.List<CmsResource> resources)
Fills the resource table.
|
void |
fillTable(CmsObject cms,
java.util.List<CmsResource> resources,
boolean clearFilter)
Fills the resource table.
|
void |
fillTable(CmsObject cms,
java.util.List<CmsResource> resources,
boolean clearFilter,
boolean sort)
Fills the resource table.
|
java.util.List<CmsUUID> |
getAllIds()
Gets structure ids of resources for current folder in current sort order.
|
int |
getItemCount()
Returns the number of currently visible items.
|
static java.lang.String |
getStateStyle(CmsResourceState state)
Gets the CSS style name for the given resource state.
|
CmsUUID |
getUUIDFromItemID(java.lang.String itemId)
Returns the structure id to the given string item id.
|
boolean |
isColumnVisible(CmsResourceTableProperty propertyId)
Returns if the column with the given property id is visible and not collapsed.
|
protected java.util.List<CmsUUID> |
itemIdsToUUIDs(java.util.Collection<java.lang.String> itemIds)
Transforms the given item ids into UUIDs.
|
void |
removePropertyProvider(CmsResourceTable.I_ResourcePropertyProvider provider)
Removes a property provider.
|
void |
selectAll()
Selects all resources.
|
void |
setCollapsedColumns(java.lang.Object... collapsedColumns)
Sets the list of collapsed columns.
|
void |
setDragMode(com.vaadin.v7.ui.Table.TableDragMode dragMode)
Sets the table drag mode.
|
void |
setDropHandler(com.vaadin.event.dd.DropHandler handler)
Sets the table drop handler.
|
void |
setValue(java.util.Set<java.lang.String> o)
Selects an given object in table.
|
getComponentCount, getCompositionRoot, getState, getState, iterator, setCompositionRootaddContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthUndefined, writeDesignaddAttachListener, 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, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerpublic static final int COLLAPSED
public static final int INVISIBLE
protected CmsResourceTable.ItemContainer m_container
protected com.vaadin.v7.ui.Table m_fileTable
protected java.util.List<CmsResourceTable.I_ResourcePropertyProvider> m_propertyProviders
public CmsResourceTable()
This constructor does *not* set up the columns of the table; use the ColumnBuilder inner class for this.
public static void fillItemDefault(com.vaadin.v7.data.Item resourceItem, CmsObject cms, CmsResource resource, java.util.Locale locale)
resourceItem - the resource item to fillcms - the CMS contextresource - the resourcelocale - the localepublic static java.lang.String getStateStyle(CmsResourceState state)
state - the resource statepublic void addPropertyProvider(CmsResourceTable.I_ResourcePropertyProvider provider)
provider - the property providerpublic void clearSelection()
public void fillTable(CmsObject cms, java.util.List<CmsResource> resources)
cms - the current CMS contextresources - the resources which should be displayed in the tablepublic void fillTable(CmsObject cms, java.util.List<CmsResource> resources, boolean clearFilter)
cms - the current CMS contextresources - the resources which should be displayed in the tableclearFilter - true to clear the search filterpublic void fillTable(CmsObject cms, java.util.List<CmsResource> resources, boolean clearFilter, boolean sort)
cms - the current CMS contextresources - the resources which should be displayed in the tableclearFilter - true to clear the search filtersort - true to sort the table entriespublic java.util.List<CmsUUID> getAllIds()
public int getItemCount()
public CmsUUID getUUIDFromItemID(java.lang.String itemId)
itemId - the item idpublic boolean isColumnVisible(CmsResourceTableProperty propertyId)
propertyId - the property idtrue if the column is visiblepublic void removePropertyProvider(CmsResourceTable.I_ResourcePropertyProvider provider)
provider - the provider to removepublic void selectAll()
public void setCollapsedColumns(java.lang.Object... collapsedColumns)
collapsedColumns - the list of collapsed columnspublic void setDragMode(com.vaadin.v7.ui.Table.TableDragMode dragMode)
dragMode - the drag modepublic void setDropHandler(com.vaadin.event.dd.DropHandler handler)
handler - the drop handlerpublic void setValue(java.util.Set<java.lang.String> o)
o - object to be selected.protected void fillItem(CmsObject cms, CmsResource resource, java.util.Locale locale)
cms - the cms contextresource - the resourcelocale - the workplace localeprotected java.util.List<CmsUUID> itemIdsToUUIDs(java.util.Collection<java.lang.String> itemIds)
itemIds - the item ids