1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Action actionDown= new Action("Descendre") {
public void run() {
TableViewer viewer= new TableViewer(table);
int index0 = table.getSelectionIndex();
int index1 = index0 - 1;
Object o1 = table.getItem(index0);
Object o2 = table.getItem(index1);
viewer.replace( o2,index0);
viewer.replace(o1,index1);
table.select(index0);
}
};
Action actionUp = new Action("Monter") {
public void run() {
TableViewer viewer= new TableViewer(table);
int index0 = table.getSelectionIndex();
int index1 = index0 + 1;
Object o1 = table.getItem(index0);
Object o2 = table.getItem(index1);
viewer.replace( o2,index0);
viewer.replace(o1,index1);
table.select(index1);
}
}; |
Partager