/** * Render a table section in the table. * * @param table the {@link AbstractCellTable} * @param section the {@link TableSectionElement} to replace * @param html the html of a table section element containing the rows */ public final void replaceAllRows(AbstractCellTable<?> table, TableSectionElement section, SafeHtml html) { // If the widget is not attached, attach an event listener so we can catch // synchronous load events from cached images. if (!table.isAttached()) { DOM.setEventListener(table.getElement(), table); } // Remove the section from the tbody. Element parent = section.getParentElement(); Element nextSection = section.getNextSiblingElement(); detachSectionElement(section); // Render the html. replaceAllRowsImpl(table, section, html); /* * Reattach the section. If next section is null, the section will be * appended instead. */ reattachSectionElement(parent, section, nextSection); // Detach the event listener. if (!table.isAttached()) { DOM.setEventListener(table.getElement(), null); } }
private void applyTableStyle(boolean striped, TableType type) { if(striped) { getTableHeadElement().getParentElement().addClassName(type.get()); getTableBodyElement().getParentElement().addClassName(type.get()); getTableFootElement().getParentElement().addClassName(type.get()); } else { getTableHeadElement().getParentElement().removeClassName(type.get()); getTableBodyElement().getParentElement().removeClassName(type.get()); getTableFootElement().getParentElement().removeClassName(type.get()); } }
/** * Constructs a table with the given page size with the specified * {@link Resources}. * * @param pageSize the page size * @param resources the resources to use for this widget */ public DataGrid(final int pageSize, final DataGrid.Resources resources) { super(pageSize, resources, null); getTableBodyElement().getParentElement().addClassName(TableType.DEFAULT.getCssName()); }
/** * Constructs a table with the given page size, the specified * {@link Resources}, and the given key provider. * * @param pageSize the page size * @param resources the resources to use for this widget * @param keyProvider an instance of ProvidesKey, or null if the record * object should act as its own key * @param loadingIndicator the widget to use as a loading indicator, or null * to disable */ public DataGrid(final int pageSize, final Resources resources, final ProvidesKey<T> keyProvider, final Widget loadingIndicator) { super(pageSize, resources, keyProvider, loadingIndicator); getTableBodyElement().getParentElement().addClassName(TableType.DEFAULT.getCssName()); }
private void addToDataGrid(final TableType tableType) { getTableHeadElement().getParentElement().addClassName(tableType.getCssName()); getTableBodyElement().getParentElement().addClassName(tableType.getCssName()); getTableFootElement().getParentElement().addClassName(tableType.getCssName()); }
private void removeFromDataGrid(final TableType tableType) { getTableHeadElement().getParentElement().removeClassName(tableType.getCssName()); getTableBodyElement().getParentElement().removeClassName(tableType.getCssName()); getTableFootElement().getParentElement().removeClassName(tableType.getCssName()); }
/** * Constructs a table with the given page size with the specified * {@link Resources}. * * @param pageSize the page size * @param resources the resources to use for this widget */ public DataGrid(final int pageSize, final DataGrid.Resources resources) { super(pageSize, resources, null); getTableBodyElement().getParentElement().addClassName(TableType.DEFAULT.getCssName()); }
private void addToDataGrid(final TableType tableType) { getTableHeadElement().getParentElement().addClassName(tableType.getCssName()); getTableBodyElement().getParentElement().addClassName(tableType.getCssName()); getTableFootElement().getParentElement().addClassName(tableType.getCssName()); }
private void removeFromDataGrid(final TableType tableType) { getTableHeadElement().getParentElement().removeClassName(tableType.getCssName()); getTableBodyElement().getParentElement().removeClassName(tableType.getCssName()); getTableFootElement().getParentElement().removeClassName(tableType.getCssName()); }
Element parent = section.getParentElement(); Element nextSection = section.getNextSiblingElement(); detachSectionElement(section);
/** * Constructs a table with the given page size, the specified * {@link Resources}, and the given key provider. * * @param pageSize the page size * @param resources the resources to use for this widget * @param keyProvider an instance of ProvidesKey, or null if the record * object should act as its own key * @param loadingIndicator the widget to use as a loading indicator, or null * to disable */ public DataGrid(final int pageSize, final Resources resources, final ProvidesKey<T> keyProvider, final Widget loadingIndicator) { super(pageSize, resources, keyProvider, loadingIndicator); getTableBodyElement().getParentElement().addClassName(TableType.DEFAULT.getCssName()); }
/** * Constructs a table with the given page size and the given * {@link ProvidesKey key provider}. * * @param pageSize the page size * @param keyProvider an instance of ProvidesKey, or null if the record * object should act as its own key */ public DataGrid(final int pageSize, final ProvidesKey<T> keyProvider) { super(pageSize, getDefaultResources(), keyProvider); getTableBodyElement().getParentElement().addClassName(TableType.DEFAULT.getCssName()); }
/** * Constructs a table with the given page size and the given * {@link ProvidesKey key provider}. * * @param pageSize the page size * @param keyProvider an instance of ProvidesKey, or null if the record * object should act as its own key */ public DataGrid(final int pageSize, final ProvidesKey<T> keyProvider) { super(pageSize, getDefaultResources(), keyProvider); getTableBodyElement().getParentElement().addClassName(TableType.DEFAULT.getCssName()); }
/** * Render a table section in the table. * * @param table the {@link AbstractCellTable} * @param section the {@link TableSectionElement} to replace * @param html the html of a table section element containing the rows */ public final void replaceAllRows(AbstractCellTable<?> table, TableSectionElement section, SafeHtml html) { // If the widget is not attached, attach an event listener so we can catch // synchronous load events from cached images. if (!table.isAttached()) { DOM.setEventListener(table.getElement(), table); } // Remove the section from the tbody. Element parent = section.getParentElement(); Element nextSection = section.getNextSiblingElement(); detachSectionElement(section); // Render the html. replaceAllRowsImpl(table, section, html); /* * Reattach the section. If next section is null, the section will be * appended instead. */ reattachSectionElement(parent, section, nextSection); // Detach the event listener. if (!table.isAttached()) { DOM.setEventListener(table.getElement(), null); } }
/** * Render a table section in the table. * * @param table the {@link AbstractCellTable} * @param section the {@link TableSectionElement} to replace * @param html the html of a table section element containing the rows */ public final void replaceAllRows(AbstractCellTable<?> table, TableSectionElement section, SafeHtml html) { // If the widget is not attached, attach an event listener so we can catch // synchronous load events from cached images. if (!table.isAttached()) { DOM.setEventListener(table.getElement(), table); } // Remove the section from the tbody. Element parent = section.getParentElement(); Element nextSection = section.getNextSiblingElement(); detachSectionElement(section); // Render the html. replaceAllRowsImpl(table, section, html); /* * Reattach the section. If next section is null, the section will be * appended instead. */ reattachSectionElement(parent, section, nextSection); // Detach the event listener. if (!table.isAttached()) { DOM.setEventListener(table.getElement(), null); } }
Element parent = section.getParentElement(); Element nextSection = section.getNextSiblingElement(); detachSectionElement(section);
Element parent = section.getParentElement(); Element nextSection = section.getNextSiblingElement(); detachSectionElement(section);