/** * Reload the table according to setting (colums) * * @param tableSetting */ public void reloadTableSetting(final VLViewTableSettingXML tableSetting) { final List<TableColumn> newcols = new ArrayList<>(); for (final VLViewTableSettingColumnXML tcol : tableSetting.getColumns()) { for (final TableColumn col : tableView.getColumns()) { if (tcol.getId().equals(col.getId())) { col.setPrefWidth(tcol.getWidth()); col.setVisible(tcol.isDisplayed()); newcols.add(col); } } } tableView.getColumns().clear(); for(TableColumn e: newcols) { tableView.getColumns().add(e); } }
/** * Reload the table according to setting (colums) * * @param tableSetting */ public void reloadTableSetting(final VLViewTableSettingXML tableSetting) { final List<TreeTableColumn> newcols = new ArrayList<>(); for (final VLViewTableSettingColumnXML tcol : tableSetting.getColumns()) { for (final TreeTableColumn col : treeView.getColumns()) { if (tcol.getId().equals(col.getId())) { col.setPrefWidth(tcol.getWidth()); col.setVisible(tcol.isDisplayed()); newcols.add(col); } } } treeView.getColumns().clear(); for(TreeTableColumn e: newcols) { treeView.getColumns().add(e); } }