Skip to content

Commit d87a8fa

Browse files
author
soheil_h_y
committed
1. index is not updated all the time
1 parent 048d1a0 commit d87a8fa

File tree

1 file changed

+5
-1
lines changed
  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets

1 file changed

+5
-1
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/TableItem.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public class TableItem extends Item {
4242
boolean checked, grayed, cached;
4343
int imageIndent, background = -1, foreground = -1, font = -1;
4444
int [] cellBackground, cellForeground, cellFont;
45+
/**
46+
* TODO : the index is not valid after a remove is called.
47+
* But updating this field after a remove will degrade performance when the removed item is at the top
48+
*/
4549
int index;
4650
private boolean selected;
4751
Element check;
@@ -174,7 +178,7 @@ public void run() {
174178
e.item = TableItem.this;
175179
e.widget = TableItem.this;
176180
parent.sendEvent(e);
177-
parent.setFocusIndex(index);
181+
parent.setFocusIndex(parent.indexOf(TableItem.this));
178182
toReturn(false);
179183
}
180184
};

0 commit comments

Comments
 (0)