Browse Source

Add disclaimers about performance to TreeTable (#10381)

tags/7.7.13
Teemu Suo-Anttila 6 years ago
parent
commit
c7e28c5d06

+ 3
- 1
documentation/components/components-treetable.asciidoc View File

@@ -51,7 +51,9 @@ ttable.setParent(6, 2);

Some container types may allow defining hierarchies if the container data
itself, without explicitly setting the parent-child relationships with
[methodname]#setParent()#.
[methodname]#setParent()#. These containers should be used if there is going
to be a lot of data. Setting up a [interfacename]#Container.Hierarchical# before
setting it to the [classname]#TreeTable# will improve the initial performance.

Unlike [classname]#Tree#, a [classname]#TreeTable# can have components in the
hierarchical column, both when the property type is a component type and when

+ 108
- 0
server/src/main/java/com/vaadin/ui/TreeTable.java View File

@@ -32,6 +32,7 @@ import org.jsoup.nodes.Element;

import com.vaadin.data.Collapsible;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.Container.Hierarchical;
import com.vaadin.data.Container.ItemSetChangeEvent;
import com.vaadin.data.util.ContainerHierarchicalWrapper;
@@ -66,6 +67,11 @@ import com.vaadin.ui.declarative.DesignException;
* standard Hierarchical implementations. Developer must however note that
* {@link Collapsible} containers can not be shared among several users as they
* share UI state in the container.
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@SuppressWarnings({ "serial" })
public class TreeTable extends Table implements Hierarchical {
@@ -703,12 +709,114 @@ public class TreeTable extends Table implements Hierarchical {
areChildrenAllowed);
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance.
*/
@Override
public boolean setParent(Object itemId, Object newParentId)
throws UnsupportedOperationException {
return getContainerDataSource().setParent(itemId, newParentId);
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@Override
public Object addItem() throws UnsupportedOperationException {
return super.addItem();
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
return super.addItem(itemId);
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@Override
public Object addItem(Object[] cells, Object itemId)
throws UnsupportedOperationException {
return super.addItem(cells, itemId);
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {
return super.addItemAfter(previousItemId, newItemId);
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@Override
public Object addItemAfter(Object previousItemId)
throws UnsupportedOperationException {
return super.addItemAfter(previousItemId);
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@Override
public void addItems(Collection<?> itemIds)
throws UnsupportedOperationException {
super.addItems(itemIds);
}

/**
* {@inheritDoc}
* <p>
* <strong>Note:</strong> Constructing a big hierarchical data set using the
* methods in {@link TreeTable} may cause a decrease in performance. Instead a
* {@link Container.Hierarchical} container should be populated before setting it
* to the {@code TreeTable}.
*/
@Override
public void addItems(Object... itemId)
throws UnsupportedOperationException {
super.addItems(itemId);
}

/**
* Sets the Item specified by given identifier as collapsed or expanded. If
* the Item is collapsed, its children are not displayed to the user.

Loading…
Cancel
Save