X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=swt%2Forg.argeo.cms.swt%2Fsrc%2Forg%2Fargeo%2Fcms%2Fswt%2Fwidgets%2FSwtTableView.java;h=3291980f650d15b3eaea58d36fa4550abd122774;hb=84914c5224fe7d441cc10f30b8418bf4ac4b0a0f;hp=b136f36e16c73cb03ba615160a453f5c4fa14ff3;hpb=fd46e1f55b8aa95e6218dabf84315adcc9c4957f;p=lgpl%2Fargeo-commons.git diff --git a/swt/org.argeo.cms.swt/src/org/argeo/cms/swt/widgets/SwtTableView.java b/swt/org.argeo.cms.swt/src/org/argeo/cms/swt/widgets/SwtTableView.java index b136f36e1..3291980f6 100644 --- a/swt/org.argeo.cms.swt/src/org/argeo/cms/swt/widgets/SwtTableView.java +++ b/swt/org.argeo.cms.swt/src/org/argeo/cms/swt/widgets/SwtTableView.java @@ -22,10 +22,10 @@ public class SwtTableView extends AbstractSwtView { private CmsSwtTheme theme; public SwtTableView(Composite parent, int style, TabularPart tabularPart) { - super(parent, style, tabularPart); + super(parent, tabularPart); theme = CmsSwtUtils.getCmsTheme(parent); - table = new Table(this, SWT.VIRTUAL | SWT.BORDER); + table = new Table(this, SWT.VIRTUAL | style); table.setLinesVisible(true); table.setLayoutData(CmsSwtUtils.fillAll()); @@ -60,9 +60,9 @@ public class SwtTableView extends AbstractSwtView { protected void refreshItem(TableItem item) { int row = getTable().indexOf(item); + T data = tabularPart.getData(row); for (int i = 0; i < tabularPart.getColumnCount(); i++) { Column column = tabularPart.getColumn(i); - T data = tabularPart.getData(row); item.setData(data); String text = data != null ? column.getText(data) : ""; if (text != null) @@ -75,6 +75,11 @@ public class SwtTableView extends AbstractSwtView { } } + @Override + public void notifyItemCountChange() { + table.setItemCount(tabularPart.getItemCount()); + } + protected Table getTable() { return table; }