Package org.opencms.ui.components
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
Table for displaying resources.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
File edit handler.class
Field factory to enable inline editing of individual file properties.static class
Extends the default sorting to differentiate between files and folder when sorting by name.static interface
Handles folder selects in the file table.Nested classes/interfaces inherited from class org.opencms.ui.components.CmsResourceTable
CmsResourceTable.ColumnBuilder, CmsResourceTable.ColumnEntry, CmsResourceTable.DefaultItemDescriptionGenerator, CmsResourceTable.I_ResourcePropertyProvider, CmsResourceTable.ItemContainer
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
Modifier and TypeFieldDescriptionstatic final Map<CmsResourceTableProperty,
Integer> The default file table columns.protected List<CmsResource>
The selected resources.Fields inherited from class org.opencms.ui.components.CmsResourceTable
COLLAPSED, INVISIBLE, m_container, m_fileTable, m_propertyProviders
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
ConstructorDescriptionCmsFileTable
(I_CmsContextProvider contextProvider) Default constructor.CmsFileTable
(I_CmsContextProvider contextProvider, Map<CmsResourceTableProperty, Integer> tableColumns) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalStyleGenerator
(com.vaadin.v7.ui.Table.CellStyleGenerator styleGenerator) Adds an additional cell style generator.void
Applies settings generally used within workplace app file lists.void
Clears all container filters.boolean
containsId
(CmsUUID structureId) Checks if the file table has a row for the resource with the given structure id.void
filterTable
(String search) Filters the displayed resources.byte[]
Generates UTF-8 encoded CSV for currently active table columns (standard columns only).Returns the dialog context provider.int
Returns the index of the first visible item.Gets the selected structure ids.Gets the list of selected resources.static String
getStateStyle
(com.vaadin.v7.data.Item resourceItem) Returns the resource state specific style name.Returns the current table state.void
handleSelection
(String itemId) Handles the item selection.boolean
Returns if a file property is being edited.boolean
isEditProperty
(CmsResourceTableProperty propertyId) Returns if the given property is being edited.void
openContextMenu
(com.vaadin.v7.event.ItemClickEvent event) Opens the context menu.void
removeAdditionalStyleGenerator
(com.vaadin.v7.ui.Table.CellStyleGenerator styleGenerator) Removes the given cell style generator.void
Restores container filters to the ones previously saved via saveFilters().void
Saves currently active filters.void
setActionColumnProperty
(CmsResourceTableProperty actionColumnProperty) Sets the default action column property.void
setContextProvider
(I_CmsContextProvider provider) Sets the dialog context provider.void
setFirstVisibleItemIndex
(int i) Sets the first visible item index.void
setFolderSelectHandler
(CmsFileTable.I_FolderSelectHandler folderSelectHandler) Sets the folder select handler.void
setMenuBuilder
(I_CmsContextMenuBuilder builder) Sets the menu builder.void
Sets the table state.void
startEdit
(CmsUUID itemId, CmsResourceTableProperty propertyId, I_CmsFilePropertyEditHandler editHandler) Starts inline editing of the given file property.void
stopEdit()
Stops the current edit process to save the changed property value.void
update
(Collection<CmsUUID> ids, boolean remove) Updates all items with ids from the given list.void
updateColumnWidths
(int estimatedSpace) Updates the column widths.void
Updates the file table sorting.Methods inherited from class org.opencms.ui.components.CmsResourceTable
addPropertyProvider, clearSelection, fillItem, fillItemDefault, fillTable, fillTable, fillTable, fillTable, getAllIds, getItemCount, getStateStyle, getUUIDFromItemID, isColumnVisible, itemIdsToUUIDs, removePropertyProvider, selectAll, setCollapsedColumns, setDragMode, setDropHandler, setValue
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
-
DEFAULT_TABLE_PROPERTIES
The default file table columns. -
m_currentResources
The selected resources.
-
-
Constructor Details
-
CmsFileTable
Default constructor.- Parameters:
contextProvider
- the dialog context provider
-
CmsFileTable
public CmsFileTable(I_CmsContextProvider contextProvider, Map<CmsResourceTableProperty, Integer> tableColumns) Default constructor.- Parameters:
contextProvider
- the dialog context providertableColumns
- the table columns to show
-
-
Method Details
-
getStateStyle
Returns the resource state specific style name.- Parameters:
resourceItem
- the resource item- Returns:
- the style name
-
addAdditionalStyleGenerator
Adds an additional cell style generator.- Parameters:
styleGenerator
- the cell style generator
-
applyWorkplaceAppSettings
Applies settings generally used within workplace app file lists. -
clearFilters
Clears all container filters. -
containsId
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
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
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
Handles the item selection.- Parameters:
itemId
- the selected item id
-
isEditing
Returns if a file property is being edited.- Returns:
true
if a file property is being edited
-
isEditProperty
Returns if the given property is being edited.- Parameters:
propertyId
- the property id- Returns:
true
if the given property is being edited
-
openContextMenu
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
Restores container filters to the ones previously saved via saveFilters(). -
saveFilters
Saves currently active filters. -
setActionColumnProperty
Sets the default action column property.- Parameters:
actionColumnProperty
- the default action column property
-
setContextProvider
Sets the dialog context provider.- Parameters:
provider
- the dialog context provider
-
setFirstVisibleItemIndex
Sets the first visible item index.- Parameters:
i
- the item index
-
setFolderSelectHandler
Sets the folder select handler.- Parameters:
folderSelectHandler
- the folder select handler
-
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 idpropertyId
- the property to editeditHandler
- the edit handler
-
stopEdit
Stops the current edit process to save the changed property value. -
update
Updates all items with ids from the given list.- Parameters:
ids
- the resource structure ids to updateremove
- true if the item should be removed only
-
updateColumnWidths
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
Updates the file table sorting.
-