Created
October 11, 2009 19:04
-
-
Save fab1an/207822 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ../gl-1.8.0-source/extensions/swt/source/ca/odell/glazedlists/swt/EventTableViewer.java 2008-12-14 05:49:50.000000000 +0100 | |
+++ gl-patches/patched/EventTableViewer.java 2009-10-11 20:55:26.000000000 +0200 | |
@@ -231,7 +231,8 @@ | |
* {@link TableFormat}. This method is not yet implemented for SWT. | |
*/ | |
public void setTableFormat(TableFormat<E> tableFormat) { | |
- throw new UnsupportedOperationException(); | |
+ this.tableFormat = tableFormat; | |
+ this.tableHandler.redraw(); | |
} | |
/** | |
@@ -552,6 +553,9 @@ | |
* completely virtual table | |
*/ | |
public int getLastIndex(); | |
+ | |
+ /* redraw items */ | |
+ public void redraw(); | |
} | |
/** | |
@@ -601,6 +605,12 @@ | |
public int getLastIndex() { | |
return table.getItemCount() - 1; | |
} | |
+ | |
+ public void redraw() { | |
+ for (int i=0; i<source.size(); i++) { | |
+ renderTableItem(table.getItem(i), source.get(i), i); | |
+ } | |
+ } | |
} | |
/** | |
@@ -611,7 +621,7 @@ | |
private final class VirtualTableHandler implements TableHandler<E>, Listener { | |
/** to keep track of what's been requested */ | |
- private final Barcode requested = new Barcode(); | |
+ private Barcode requested = new Barcode(); | |
/** | |
* Create a new VirtualTableHandler. | |
@@ -711,5 +721,12 @@ | |
public void dispose() { | |
table.removeListener(SWT.SetData, this); | |
} | |
+ | |
+ public void redraw() { | |
+ this.requested = new Barcode(); | |
+ table.setItemCount(0); | |
+ table.setItemCount(source.size()); | |
+ requested.addWhite(0, source.size()); | |
+ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment