/** * Create a {@link HasData} that will display items. The {@link HasData} must * extend {@link Widget}. * * @param <C> the item type in the list view * @param nodeInfo the node info with child data * @param level the level of the list * @return the {@link HasData} */ private <C> BrowserCellList<C> createDisplay(NodeInfo<C> nodeInfo, int level) { BrowserCellList<C> display = new BrowserCellList<C>(nodeInfo.getCell(), level, nodeInfo.getProvidesKey()); if (loadingIndicator != null) { display.setLoadingIndicator(loadingIndicator); } if (pageSize != null) { display.setPageSize(pageSize); } display.setValueUpdater(nodeInfo.getValueUpdater()); /* * A CellBrowser has a single keyboard selection policy and multiple lists, * so we're not using the selection policy in each list. Leave them on all * the time because we use keyboard selection to keep track of which item is * open (selected) at each level. */ display.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED); return display; }
/** * Create a {@link HasData} that will display items. The {@link HasData} must * extend {@link Widget}. * * @param <C> the item type in the list view * @param nodeInfo the node info with child data * @param level the level of the list * @return the {@link HasData} */ private <C> BrowserCellList<C> createDisplay(NodeInfo<C> nodeInfo, int level) { BrowserCellList<C> display = new BrowserCellList<C>(nodeInfo.getCell(), level, nodeInfo.getProvidesKey()); if (loadingIndicator != null) { display.setLoadingIndicator(loadingIndicator); } if (pageSize != null) { display.setPageSize(pageSize); } display.setValueUpdater(nodeInfo.getValueUpdater()); /* * A CellBrowser has a single keyboard selection policy and multiple lists, * so we're not using the selection policy in each list. Leave them on all * the time because we use keyboard selection to keep track of which item is * open (selected) at each level. */ display.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED); return display; }
public NodeCellList(final NodeInfo<C> nodeInfo, final CellTreeNodeView<?> nodeView, int pageSize) { this.defaultPageSize = pageSize; this.nodeInfo = nodeInfo; this.nodeView = nodeView; cell = nodeInfo.getCell(); // Create a presenter. presenter = new HasDataPresenter<C>(this, new View(nodeView.ensureChildContainer()), pageSize, nodeInfo.getProvidesKey()); // Disable keyboard selection because it is handled by CellTree. presenter.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); // Use a pager to update buttons. presenter.addRowCountChangeHandler(new RowCountChangeEvent.Handler() { @Override public void onRowCountChange(RowCountChangeEvent event) { int rowCount = event.getNewRowCount(); boolean isExact = event.isNewRowCountExact(); int pageSize = getVisibleRange().getLength(); showOrHide(nodeView.showMoreElem, isExact && rowCount > pageSize); } }); }
public NodeCellList(final NodeInfo<C> nodeInfo, final CellTreeNodeView<?> nodeView, int pageSize) { this.defaultPageSize = pageSize; this.nodeInfo = nodeInfo; this.nodeView = nodeView; cell = nodeInfo.getCell(); // Create a presenter. presenter = new HasDataPresenter<C>(this, new View(nodeView.ensureChildContainer()), pageSize, nodeInfo.getProvidesKey()); // Disable keyboard selection because it is handled by CellTree. presenter.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); // Use a pager to update buttons. presenter.addRowCountChangeHandler(new RowCountChangeEvent.Handler() { @Override public void onRowCountChange(RowCountChangeEvent event) { int rowCount = event.getNewRowCount(); boolean isExact = event.isNewRowCountExact(); int pageSize = getVisibleRange().getLength(); showOrHide(nodeView.showMoreElem, isExact && rowCount > pageSize); } }); }
/** * Returns the key for the value of this node using the parent's * implementation of NodeInfo.getKey(). */ protected Object getValueKey() { return parentNodeInfo.getProvidesKey().getKey(value); }
/** * Returns the key for the value of this node using the parent's * implementation of NodeInfo.getKey(). */ protected Object getValueKey() { return parentNodeInfo.getProvidesKey().getKey(value); }
/** * Create a {@link HasData} that will display items. The {@link HasData} must * extend {@link Widget}. * * @param <C> the item type in the list view * @param nodeInfo the node info with child data * @param level the level of the list * @return the {@link HasData} */ private <C> BrowserCellList<C> createDisplay(NodeInfo<C> nodeInfo, int level) { BrowserCellList<C> display = new BrowserCellList<C>(nodeInfo.getCell(), level, nodeInfo.getProvidesKey()); if (loadingIndicator != null) { display.setLoadingIndicator(loadingIndicator); } if (pageSize != null) { display.setPageSize(pageSize); } display.setValueUpdater(nodeInfo.getValueUpdater()); /* * A CellBrowser has a single keyboard selection policy and multiple lists, * so we're not using the selection policy in each list. Leave them on all * the time because we use keyboard selection to keep track of which item is * open (selected) at each level. */ display.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED); return display; }
public NodeCellList(final NodeInfo<C> nodeInfo, final CellTreeNodeView<?> nodeView, int pageSize) { this.defaultPageSize = pageSize; this.nodeInfo = nodeInfo; this.nodeView = nodeView; cell = nodeInfo.getCell(); // Create a presenter. presenter = new HasDataPresenter<C>(this, new View(nodeView.ensureChildContainer()), pageSize, nodeInfo.getProvidesKey()); // Disable keyboard selection because it is handled by CellTree. presenter.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); // Use a pager to update buttons. presenter.addRowCountChangeHandler(new RowCountChangeEvent.Handler() { @Override public void onRowCountChange(RowCountChangeEvent event) { int rowCount = event.getNewRowCount(); boolean isExact = event.isNewRowCountExact(); int pageSize = getVisibleRange().getLength(); showOrHide(nodeView.showMoreElem, isExact && rowCount > pageSize); } }); }
/** * Returns the key for the value of this node using the parent's * implementation of NodeInfo.getKey(). */ protected Object getValueKey() { return parentNodeInfo.getProvidesKey().getKey(value); }