Class CmsResourceTable

java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.CustomComponent
org.opencms.ui.components.CmsResourceTable
All Implemented Interfaces:
com.vaadin.event.ContextClickEvent.ContextClickNotifier, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.HasComponents, Serializable, Iterable<com.vaadin.ui.Component>
Direct Known Subclasses:
CmsFileTable

public class CmsResourceTable extends com.vaadin.ui.CustomComponent
Generic table for displaying lists of resources.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Helper class for easily configuring a set of columns to display, together with their visibility / collapsed status.
    static class 
    Contains the data for the given column, along with some flags to control visibility/collapsed status.
    static class 
    Default description generator for table entries.
    static interface 
    Provides item property values for additional table columns.
    protected static class 
    Extending the indexed container to make the number of un-filtered items available.

    Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector

    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

    Nested classes/interfaces inherited from interface com.vaadin.ui.Component

    com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener

    Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents

    com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener

    Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable

    com.vaadin.server.Sizeable.Unit
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Flag to mark columns as initially collapsed.
    static final int
    Flag to mark columns as invisible.
    The resource data container.
    protected com.vaadin.v7.ui.Table
    The table used to display the resource data.
    Property provider for additional columns.

    Fields inherited from class com.vaadin.ui.AbstractComponent

    DESIGN_ATTR_PLAIN_TEXT

    Fields inherited from interface com.vaadin.server.Sizeable

    SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a property provider.
    void
    Clears the value selection.
    protected void
    fillItem(CmsObject cms, CmsResource resource, Locale locale)
    Fills the file item data.
    static void
    fillItemDefault(com.vaadin.v7.data.Item resourceItem, CmsObject cms, CmsResource resource, Locale locale)
    Static helper method to initialize the 'standard' properties of a data item from a given resource.
    void
    fillTable(CmsObject cms, List<CmsResource> resources)
    Fills the resource table.
    void
    fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter)
    Fills the resource table.
    void
    fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter, boolean sort)
    Fills the resource table.
    void
    fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter, boolean sort, boolean distinctResources)
    Fills the resource table.
    Gets structure ids of resources for current folder in current sort order.
    int
    Returns the number of currently visible items.
    static String
    Gets the CSS style name for the given resource state.
    Returns the structure id to the given string item id.
    boolean
    Returns if the column with the given property id is visible and not collapsed.
    protected List<CmsUUID>
    Transforms the given item ids into UUIDs.
    void
    Removes a property provider.
    void
    Selects all resources.
    void
    setCollapsedColumns(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
    Selects an given object in table.

    Methods inherited from class com.vaadin.ui.CustomComponent

    getComponentCount, getCompositionRoot, getState, getState, iterator, setCompositionRoot

    Methods inherited from class com.vaadin.ui.AbstractComponent

    addContextClickListener, 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, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined, writeDesign

    Methods inherited from class com.vaadin.server.AbstractClientConnector

    addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.server.ClientConnector

    addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler

    Methods inherited from interface com.vaadin.ui.Component

    addListener, 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, writeDesign

    Methods inherited from interface com.vaadin.shared.Connector

    getConnectorId

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface com.vaadin.server.Sizeable

    getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
  • Field Details

  • Constructor Details

    • CmsResourceTable

      Creates a new instance.

      This constructor does *not* set up the columns of the table; use the ColumnBuilder inner class for this.

  • Method Details

    • fillItemDefault

      public static void fillItemDefault(com.vaadin.v7.data.Item resourceItem, CmsObject cms, CmsResource resource, Locale locale)
      Static helper method to initialize the 'standard' properties of a data item from a given resource.

      Parameters:
      resourceItem - the resource item to fill
      cms - the CMS context
      resource - the resource
      locale - the locale
    • getStateStyle

      public static String getStateStyle(CmsResourceState state)
      Gets the CSS style name for the given resource state.

      Parameters:
      state - the resource state
      Returns:
      the CSS style name
    • addPropertyProvider

      Adds a property provider.

      Parameters:
      provider - the property provider
    • clearSelection

      public void clearSelection()
      Clears the value selection.

    • fillTable

      public void fillTable(CmsObject cms, List<CmsResource> resources)
      Fills the resource table.

      Parameters:
      cms - the current CMS context
      resources - the resources which should be displayed in the table
    • fillTable

      public void fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter)
      Fills the resource table.

      Parameters:
      cms - the current CMS context
      resources - the resources which should be displayed in the table
      clearFilter - true to clear the search filter
    • fillTable

      public void fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter, boolean sort)
      Fills the resource table.

      Parameters:
      cms - the current CMS context
      resources - the resources which should be displayed in the table
      clearFilter - true to clear the search filter
      sort - true to sort the table entries
    • fillTable

      public void fillTable(CmsObject cms, List<CmsResource> resources, boolean clearFilter, boolean sort, boolean distinctResources)
      Fills the resource table.

      Parameters:
      cms - the current CMS context
      resources - the resources which should be displayed in the table
      clearFilter - true to clear the search filter
      sort - true to sort the table entries
      distinctResources - whether to only show distinct resources
    • getAllIds

      public List<CmsUUID> getAllIds()
      Gets structure ids of resources for current folder in current sort order.

      Returns:
      the structure ids of the current folder contents
    • getItemCount

      public int getItemCount()
      Returns the number of currently visible items.

      Returns:
      the number of currentliy visible items
    • getUUIDFromItemID

      public CmsUUID getUUIDFromItemID(String itemId)
      Returns the structure id to the given string item id.

      Parameters:
      itemId - the item id
      Returns:
      the structure id
    • isColumnVisible

      public boolean isColumnVisible(CmsResourceTableProperty propertyId)
      Returns if the column with the given property id is visible and not collapsed.

      Parameters:
      propertyId - the property id
      Returns:
      true if the column is visible
    • removePropertyProvider

      Removes a property provider.

      Parameters:
      provider - the provider to remove
    • selectAll

      public void selectAll()
      Selects all resources.

    • setCollapsedColumns

      public void setCollapsedColumns(Object... collapsedColumns)
      Sets the list of collapsed columns.

      Parameters:
      collapsedColumns - the list of collapsed columns
    • setDragMode

      public void setDragMode(com.vaadin.v7.ui.Table.TableDragMode dragMode)
      Sets the table drag mode.

      Parameters:
      dragMode - the drag mode
    • setDropHandler

      public void setDropHandler(com.vaadin.event.dd.DropHandler handler)
      Sets the table drop handler.

      Parameters:
      handler - the drop handler
    • setValue

      public void setValue(Set<String> o)
      Selects an given object in table.

      Parameters:
      o - object to be selected.
    • fillItem

      protected void fillItem(CmsObject cms, CmsResource resource, Locale locale)
      Fills the file item data.

      Parameters:
      cms - the cms context
      resource - the resource
      locale - the workplace locale
    • itemIdsToUUIDs

      protected List<CmsUUID> itemIdsToUUIDs(Collection<String> itemIds)
      Transforms the given item ids into UUIDs.

      Parameters:
      itemIds - the item ids
      Returns:
      the UUIDs