Class CmsResourceTreeContainer
- java.lang.Object
-
- com.vaadin.v7.data.util.AbstractContainer
-
- com.vaadin.v7.data.util.AbstractInMemoryContainer<java.lang.Object,java.lang.Object,com.vaadin.v7.data.Item>
-
- com.vaadin.v7.data.util.IndexedContainer
-
- com.vaadin.v7.data.util.HierarchicalContainer
-
- org.opencms.ui.components.fileselect.CmsResourceTreeContainer
-
- All Implemented Interfaces:
com.vaadin.v7.data.Container
,com.vaadin.v7.data.Container.Filterable
,com.vaadin.v7.data.Container.Hierarchical
,com.vaadin.v7.data.Container.Indexed
,com.vaadin.v7.data.Container.ItemSetChangeNotifier
,com.vaadin.v7.data.Container.Ordered
,com.vaadin.v7.data.Container.PropertySetChangeNotifier
,com.vaadin.v7.data.Container.SimpleFilterable
,com.vaadin.v7.data.Container.Sortable
,com.vaadin.v7.data.Property.ValueChangeNotifier
,java.io.Serializable
,java.lang.Cloneable
public class CmsResourceTreeContainer extends com.vaadin.v7.data.util.HierarchicalContainer
The data container for the sitmeap folder selection tree.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.v7.data.util.IndexedContainer
com.vaadin.v7.data.util.IndexedContainer.ItemSetChangeEvent
-
Nested classes/interfaces inherited from class com.vaadin.v7.data.util.AbstractInMemoryContainer
com.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemAddEvent, com.vaadin.v7.data.util.AbstractInMemoryContainer.BaseItemRemoveEvent
-
Nested classes/interfaces inherited from class com.vaadin.v7.data.util.AbstractContainer
com.vaadin.v7.data.util.AbstractContainer.BaseItemSetChangeEvent, com.vaadin.v7.data.util.AbstractContainer.BasePropertySetChangeEvent
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.Container
com.vaadin.v7.data.Container.Editor, com.vaadin.v7.data.Container.Filter, com.vaadin.v7.data.Container.Filterable, com.vaadin.v7.data.Container.Hierarchical, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeEvent, com.vaadin.v7.data.Container.ItemSetChangeListener, com.vaadin.v7.data.Container.ItemSetChangeNotifier, com.vaadin.v7.data.Container.Ordered, com.vaadin.v7.data.Container.PropertySetChangeEvent, com.vaadin.v7.data.Container.PropertySetChangeListener, com.vaadin.v7.data.Container.PropertySetChangeNotifier, com.vaadin.v7.data.Container.SimpleFilterable, com.vaadin.v7.data.Container.Sortable, com.vaadin.v7.data.Container.Viewer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_RESOURCE
Property which is used to store the CmsResource.static java.lang.String
PROPERTY_SITEMAP_CAPTION
Property which is used to store the sitemap view caption HTML.
-
Constructor Summary
Constructors Constructor Description CmsResourceTreeContainer(CmsResourceFilter filter)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTreeItem(CmsObject cms, CmsResource resource, CmsUUID parentId)
Adds an item to the folder tree.protected void
defineProperties()
Defines the container properties.protected void
fillProperties(CmsObject cms, com.vaadin.v7.data.Item resourceItem, CmsResource resource, CmsUUID parentId)
Fills the properties of a tree item.protected java.lang.String
getName(CmsObject cms, CmsResource resource, CmsUUID parentId)
Gets the name to display for the given resource.java.util.Collection<?>
getSortableContainerPropertyIds()
void
initRoot(CmsObject cms, CmsResource root)
Initializes the root level of the tree.void
readTreeLevel(CmsObject cms, CmsUUID parentId)
Reads the given tree level.void
removeChildren(CmsUUID parentId)
Clears the given tree level.void
update(CmsObject cms, CmsUUID id, CmsResourceFilter filter)
Updates the item for the given structure id.void
updateSort()
Updates the item order according to the latest sort setting.-
Methods inherited from class com.vaadin.v7.data.util.HierarchicalContainer
addItem, addItem, areChildrenAllowed, doFilterContainer, doSort, fireItemSetChange, getChildren, getParent, hasChildren, isIncludeParentsWhenFiltering, isRoot, moveAfterSibling, passesFilters, removeAllItems, removeItem, removeItemRecursively, removeItemRecursively, rootItemIds, setChildrenAllowed, setIncludeParentsWhenFiltering, setParent
-
Methods inherited from class com.vaadin.v7.data.util.IndexedContainer
addContainerFilter, addContainerFilter, addContainerProperty, addItemAfter, addItemAfter, addItemAt, addItemAt, addListener, addListener, addPropertySetChangeListener, addValueChangeListener, clone, fireItemAdded, fireItemSetChange, getContainerFilters, getContainerProperty, getContainerPropertyIds, getItemSorter, getListeners, getType, getUnfilteredItem, hasContainerFilters, registerNewItem, removeAllContainerFilters, removeContainerFilter, removeContainerFilters, removeContainerProperty, removeListener, removeListener, removePropertySetChangeListener, removeValueChangeListener, setItemSorter, sort
-
Methods inherited from class com.vaadin.v7.data.util.AbstractInMemoryContainer
addFilter, addItemSetChangeListener, addListener, containsId, filterAll, fireItemRemoved, fireItemsAdded, fireItemsRemoved, firstItemId, getAllItemIds, getFilteredItemIds, getFilters, getFirstVisibleItem, getIdByIndex, getItem, getItemIds, getItemIds, getSortablePropertyIds, getVisibleItemIds, indexOfId, internalAddItemAfter, internalAddItemAt, internalAddItemAtEnd, internalRemoveAllItems, internalRemoveItem, isFiltered, isFirstId, isLastId, isPropertyFiltered, lastItemId, nextItemId, prevItemId, removeAllFilters, removeFilter, removeFilters, removeItemSetChangeListener, removeListener, setAllItemIds, setFilteredItemIds, setFilters, size, sortContainer
-
Methods inherited from class com.vaadin.v7.data.util.AbstractContainer
fireContainerPropertySetChange, fireContainerPropertySetChange, getItemSetChangeListeners, getPropertySetChangeListeners, setItemSetChangeListeners, setPropertySetChangeListeners
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
PROPERTY_RESOURCE
public static final java.lang.String PROPERTY_RESOURCE
Property which is used to store the CmsResource.- See Also:
- Constant Field Values
-
PROPERTY_SITEMAP_CAPTION
public static final java.lang.String PROPERTY_SITEMAP_CAPTION
Property which is used to store the sitemap view caption HTML.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsResourceTreeContainer
public CmsResourceTreeContainer(CmsResourceFilter filter)
Default constructor.- Parameters:
filter
- the resource filter to use
-
-
Method Detail
-
addTreeItem
public void addTreeItem(CmsObject cms, CmsResource resource, CmsUUID parentId)
Adds an item to the folder tree.- Parameters:
cms
- the CMS contextresource
- the folder resourceparentId
- the parent folder id
-
getSortableContainerPropertyIds
public java.util.Collection<?> getSortableContainerPropertyIds()
- Specified by:
getSortableContainerPropertyIds
in interfacecom.vaadin.v7.data.Container.Sortable
- Overrides:
getSortableContainerPropertyIds
in classcom.vaadin.v7.data.util.IndexedContainer
- See Also:
IndexedContainer.getSortableContainerPropertyIds()
-
initRoot
public void initRoot(CmsObject cms, CmsResource root)
Initializes the root level of the tree.- Parameters:
cms
- the CMS contextroot
- the root folder
-
readTreeLevel
public void readTreeLevel(CmsObject cms, CmsUUID parentId)
Reads the given tree level.- Parameters:
cms
- the CMS contextparentId
- the parent id
-
removeChildren
public void removeChildren(CmsUUID parentId)
Clears the given tree level.- Parameters:
parentId
- the parent id
-
update
public void update(CmsObject cms, CmsUUID id, CmsResourceFilter filter) throws CmsException
Updates the item for the given structure id.- Parameters:
cms
- the CMS contextid
- the structure idfilter
- the resource filter used for reading the resource- Throws:
CmsException
- if something goes wrong
-
updateSort
public void updateSort()
Updates the item order according to the latest sort setting.
-
defineProperties
protected void defineProperties()
Defines the container properties.
-
fillProperties
protected void fillProperties(CmsObject cms, com.vaadin.v7.data.Item resourceItem, CmsResource resource, CmsUUID parentId)
Fills the properties of a tree item.- Parameters:
cms
- the CMS contextresourceItem
- the empty itemresource
- the resource for which the tree item is being createdparentId
- the parent id
-
getName
protected java.lang.String getName(CmsObject cms, CmsResource resource, CmsUUID parentId)
Gets the name to display for the given resource.- Parameters:
cms
- the CMS contextresource
- a resourceparentId
- the id of the parent of the resource- Returns:
- the name for the given resoure
-
-