Class CmsFileTable

java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.CustomComponent
org.opencms.ui.components.CmsResourceTable
org.opencms.ui.components.CmsFileTable
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:
CmsLinkValidationInternalTable, CmsResultTable

public class CmsFileTable extends CmsResourceTable
Table for displaying resources.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getStateStyle

      public static String getStateStyle(com.vaadin.v7.data.Item resourceItem)
      Returns the resource state specific style name.

      Parameters:
      resourceItem - the resource item
      Returns:
      the style name
    • addAdditionalStyleGenerator

      public void addAdditionalStyleGenerator(com.vaadin.v7.ui.Table.CellStyleGenerator styleGenerator)
      Adds an additional cell style generator.

      Parameters:
      styleGenerator - the cell style generator
    • applyWorkplaceAppSettings

      Applies settings generally used within workplace app file lists.

    • clearFilters

      public void clearFilters()
      Clears all container filters.
    • containsId

      public boolean containsId(CmsUUID structureId)
      Checks if the file table has a row for the resource with the given structure id.
      Parameters:
      structureId - a structure id
      Returns:
      true if the file table has a row for the resource with the given id
    • filterTable

      public void filterTable(String search)
      Filters the displayed resources.

      Only resources where either the resource name, the title or the nav-text contains the given substring are shown.

      Parameters:
      search - the search term
    • generateCsv

      public byte[] generateCsv()
      Generates UTF-8 encoded CSV for currently active table columns (standard columns only).

      Note: the generated CSV takes the active filters into account.

      Returns:
      the generated CSV data
    • getContextProvider

      Returns the dialog context provider.

      Returns:
      the dialog context provider
    • getFirstVisibleItemIndex

      Returns the index of the first visible item.

      Returns:
      the first visible item
    • getSelectedIds

      Gets the selected structure ids.

      Returns:
      the set of selected structure ids
    • getSelectedResources

      Gets the list of selected resources.

      Returns:
      the list of selected resources
    • getTableSettings

      Returns the current table state.

      Returns:
      the table state
    • handleSelection

      public void handleSelection(String itemId)
      Handles the item selection.

      Parameters:
      itemId - the selected item id
    • isEditing

      public boolean isEditing()
      Returns if a file property is being edited.

      Returns:
      true if a file property is being edited
    • isEditProperty

      public boolean isEditProperty(CmsResourceTableProperty propertyId)
      Returns if the given property is being edited.

      Parameters:
      propertyId - the property id
      Returns:
      true if the given property is being edited
    • openContextMenu

      public void openContextMenu(com.vaadin.v7.event.ItemClickEvent event)
      Opens the context menu.

      Parameters:
      event - the click event
    • removeAdditionalStyleGenerator

      public void removeAdditionalStyleGenerator(com.vaadin.v7.ui.Table.CellStyleGenerator styleGenerator)
      Removes the given cell style generator.

      Parameters:
      styleGenerator - the cell style generator to remove
    • restoreFilters

      public void restoreFilters()
      Restores container filters to the ones previously saved via saveFilters().
    • saveFilters

      public void saveFilters()
      Saves currently active filters.

    • setActionColumnProperty

      public void setActionColumnProperty(CmsResourceTableProperty actionColumnProperty)
      Sets the default action column property.

      Parameters:
      actionColumnProperty - the default action column property
    • setContextProvider

      public void setContextProvider(I_CmsContextProvider provider)
      Sets the dialog context provider.

      Parameters:
      provider - the dialog context provider
    • setFirstVisibleItemIndex

      public void setFirstVisibleItemIndex(int i)
      Sets the first visible item index.

      Parameters:
      i - the item index
    • setFolderSelectHandler

      Sets the folder select handler.

      Parameters:
      folderSelectHandler - the folder select handler
    • setMenuBuilder

      public void setMenuBuilder(I_CmsContextMenuBuilder builder)
      Sets the menu builder.

      Parameters:
      builder - the menu builder
    • setTableState

      Sets the table state.

      Parameters:
      state - the table state
    • startEdit

      public void startEdit(CmsUUID itemId, CmsResourceTableProperty propertyId, I_CmsFilePropertyEditHandler editHandler)
      Starts inline editing of the given file property.

      Parameters:
      itemId - the item resource structure id
      propertyId - the property to edit
      editHandler - the edit handler
    • stopEdit

      public void stopEdit()
      Stops the current edit process to save the changed property value.

    • update

      public void update(Collection<CmsUUID> ids, boolean remove)
      Updates all items with ids from the given list.

      Parameters:
      ids - the resource structure ids to update
      remove - true if the item should be removed only
    • updateColumnWidths

      public void updateColumnWidths(int estimatedSpace)
      Updates the column widths.

      The reason this is needed is that the Vaadin table does not support minimum widths for columns, so expanding columns get squished when most of the horizontal space is used by other columns. So we try to determine whether the expanded columns would have enough space, and if not, give them a fixed width.

      Parameters:
      estimatedSpace - the estimated horizontal space available for the table.
    • updateSorting

      public void updateSorting()
      Updates the file table sorting.