* Add missing since tags for 8.1.0.alpha1 * Update @since for DataCommunicatorClientRpc * Update @since for DataCommunicatortags/8.1.0.alpha2
/** | /** | ||||
* A connector for HierarchicalDataCommunicator class. | * A connector for HierarchicalDataCommunicator class. | ||||
* | |||||
* | |||||
* @author Vaadin Ltd | * @author Vaadin Ltd | ||||
* @since | |||||
* @since 8.1 | |||||
*/ | */ | ||||
@Connect(HierarchicalDataCommunicator.class) | @Connect(HierarchicalDataCommunicator.class) | ||||
public class HierarchicalDataCommunicatorConnector | public class HierarchicalDataCommunicatorConnector |
* Set the range of rows to push for next response. | * Set the range of rows to push for next response. | ||||
* | * | ||||
* @param pushRows | * @param pushRows | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected void setPushRows(Range pushRows) { | protected void setPushRows(Range pushRows) { | ||||
this.pushRows = pushRows; | this.pushRows = pushRows; | ||||
* Get the current range of rows to push in the next response. | * Get the current range of rows to push in the next response. | ||||
* | * | ||||
* @return the range of rows to push | * @return the range of rows to push | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected Range getPushRows() { | protected Range getPushRows() { | ||||
return pushRows; | return pushRows; | ||||
/** | /** | ||||
* Get the object used for filtering in this data communicator. | * Get the object used for filtering in this data communicator. | ||||
* | |||||
* | |||||
* @return the filter object of this data communicator | * @return the filter object of this data communicator | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected Object getFilter() { | protected Object getFilter() { | ||||
return filter; | return filter; | ||||
/** | /** | ||||
* Get the client rpc interface for this data communicator. | * Get the client rpc interface for this data communicator. | ||||
* | |||||
* | |||||
* @return the client rpc interface for this data communicator | * @return the client rpc interface for this data communicator | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected DataCommunicatorClientRpc getClientRpc() { | protected DataCommunicatorClientRpc getClientRpc() { | ||||
return rpc; | return rpc; | ||||
* the index of the first cached row | * the index of the first cached row | ||||
* @param cacheSize | * @param cacheSize | ||||
* the number of cached rows | * the number of cached rows | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected void onRequestRows(int firstRowIndex, int numberOfRows, | protected void onRequestRows(int firstRowIndex, int numberOfRows, | ||||
int firstCachedRowIndex, int cacheSize) { | int firstCachedRowIndex, int cacheSize) { | ||||
* | * | ||||
* @param keys | * @param keys | ||||
* the keys of the rows that have been dropped | * the keys of the rows that have been dropped | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected void onDropRows(JsonArray keys) { | protected void onDropRows(JsonArray keys) { | ||||
for (int i = 0; i < keys.length(); ++i) { | for (int i = 0; i < keys.length(); ++i) { | ||||
* | * | ||||
* @param initial | * @param initial | ||||
* {@code true} if initial data load, {@code false} if not | * {@code true} if initial data load, {@code false} if not | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected void sendDataToClient(boolean initial) { | protected void sendDataToClient(boolean initial) { | ||||
if (getDataProvider() == null) { | if (getDataProvider() == null) { | ||||
* Returns the active data handler. | * Returns the active data handler. | ||||
* | * | ||||
* @return the active data handler | * @return the active data handler | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected ActiveDataHandler getActiveDataHandler() { | protected ActiveDataHandler getActiveDataHandler() { | ||||
return handler; | return handler; | ||||
* Returns the currently set updated data. | * Returns the currently set updated data. | ||||
* | * | ||||
* @return the set of data that should be updated on the next response | * @return the set of data that should be updated on the next response | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected Set<T> getUpdatedData() { | protected Set<T> getUpdatedData() { | ||||
return updatedData; | return updatedData; | ||||
* Returns the {@link Comparator} to use with in-memory sorting. | * Returns the {@link Comparator} to use with in-memory sorting. | ||||
* | * | ||||
* @return comparator used to sort data | * @return comparator used to sort data | ||||
* @since 8.1 | |||||
*/ | */ | ||||
public Comparator<T> getInMemorySorting() { | public Comparator<T> getInMemorySorting() { | ||||
return inMemorySorting; | return inMemorySorting; | ||||
* Returns the {@link QuerySortOrder} to use with backend sorting. | * Returns the {@link QuerySortOrder} to use with backend sorting. | ||||
* | * | ||||
* @return list of sort order information to pass to a query | * @return list of sort order information to pass to a query | ||||
* @since 8.1 | |||||
*/ | */ | ||||
public List<QuerySortOrder> getBackEndSorting() { | public List<QuerySortOrder> getBackEndSorting() { | ||||
return backEndSorting; | return backEndSorting; |
* @param <T> | * @param <T> | ||||
* the bean type | * the bean type | ||||
* @author Vaadin Ltd | * @author Vaadin Ltd | ||||
* @since | |||||
* @since 8.1 | |||||
*/ | */ | ||||
public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { | public class HierarchicalDataCommunicator<T> extends DataCommunicator<T> { | ||||
int collapsedSubTreeSize = mapper.collapse(collapsedRowKey, | int collapsedSubTreeSize = mapper.collapse(collapsedRowKey, | ||||
collapsedRowIndex); | collapsedRowIndex); | ||||
getClientRpc().removeRows(collapsedRowIndex + 1, | |||||
collapsedSubTreeSize); | |||||
getClientRpc().removeRows(collapsedRowIndex + 1, collapsedSubTreeSize); | |||||
// FIXME seems like a slight overkill to do this just for refreshing | // FIXME seems like a slight overkill to do this just for refreshing | ||||
// expanded status | // expanded status | ||||
refresh(collapsedItem); | refresh(collapsedItem); |
* @param <F> | * @param <F> | ||||
* filter type | * filter type | ||||
* | * | ||||
* @since 8.0 | |||||
* @since 8.1 | |||||
*/ | */ | ||||
public class HierarchicalQuery<T, F> extends Query<T, F> { | public class HierarchicalQuery<T, F> extends Query<T, F> { | ||||
/** | /** | ||||
* Get the hierarchical parent object, can be <code>null</code>. | * Get the hierarchical parent object, can be <code>null</code>. | ||||
* | |||||
* | |||||
* @return the hierarchical parent object, can be <code>null</code> | * @return the hierarchical parent object, can be <code>null</code> | ||||
*/ | */ | ||||
public T getParent() { | public T getParent() { | ||||
/** | /** | ||||
* Get an Optional of the hierarchical parent object. | * Get an Optional of the hierarchical parent object. | ||||
* | |||||
* | |||||
* @see #getParent() | * @see #getParent() | ||||
* @return the result of {@link #getParent()} wrapped by an Optional | * @return the result of {@link #getParent()} wrapped by an Optional | ||||
*/ | */ |
* the custom data communicator to set | * the custom data communicator to set | ||||
* @see #Grid() | * @see #Grid() | ||||
* @see #Grid(PropertySet, DataCommunicator) | * @see #Grid(PropertySet, DataCommunicator) | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected Grid(DataCommunicator<T> dataCommunicator) { | protected Grid(DataCommunicator<T> dataCommunicator) { | ||||
this(new PropertySet<T>() { | this(new PropertySet<T>() { | ||||
* the property set implementation to use, not <code>null</code>. | * the property set implementation to use, not <code>null</code>. | ||||
* @param dataCommunicator | * @param dataCommunicator | ||||
* the data communicator to use, not<code>null</code> | * the data communicator to use, not<code>null</code> | ||||
* @since 8.1 | |||||
*/ | */ | ||||
protected Grid(PropertySet<T> propertySet, | protected Grid(PropertySet<T> propertySet, | ||||
DataCommunicator<T> dataCommunicator) { | DataCommunicator<T> dataCommunicator) { |
* the destination index of the new row data | * the destination index of the new row data | ||||
* @param count | * @param count | ||||
* the number of rows inserted | * the number of rows inserted | ||||
* @since 8.1 | |||||
*/ | */ | ||||
void insertRows(int firstRowIndex, int count); | void insertRows(int firstRowIndex, int count); | ||||
* @param count | * @param count | ||||
* the number of removed rows, starting from | * the number of removed rows, starting from | ||||
* <code>firstRowIndex</code> | * <code>firstRowIndex</code> | ||||
* @since 8.1 | |||||
*/ | */ | ||||
void removeRows(int firstRowIndex, int count); | void removeRows(int firstRowIndex, int count); | ||||
} | } |
/** | /** | ||||
* Shared state for HierarchicalDataCommunicator. | * Shared state for HierarchicalDataCommunicator. | ||||
* | * | ||||
* @since | |||||
* @since 8.1 | |||||
*/ | */ | ||||
public class HierarchicalDataCommunicatorState extends DataCommunicatorState { | public class HierarchicalDataCommunicatorState extends DataCommunicatorState { | ||||