ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
537
537
EMPFEHLEN
-
Ich bin es noch einmal mit einem Table-Problemchen

Ich versuche auf eine Tabelle einen Editor zu legen, der dann aktiviert wird, wenn man auf einen "edit" button klickt, und schrittweise mit entweder "tab" oder "enter" von der column 0 bis zur column x durchwandert.
hier der code:
Code :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 30 31 32 33 34 35 36 37
final int EDITABLECOLUMN = 0; //Konstante für die 1. Spalte butEdit.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() { public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { // Editorbeispiel aus eclipse Control oldEditor = editor.getEditor(); if (oldEditor != null) oldEditor.dispose(); // Identify the selected row TableItem item = (TableItem)itemSelected.item; //übergibt die vorher selektierte Zeile-ok if (item == null) return; // The control that will be the editor must be a child of the Table for (int i = 0; i < 6; i++){ // Soll die columns von index 0 bis 5 durchgehen Text newEditor = new Text(table, SWT.NONE); newEditor.setText(item.getText(EDITABLECOLUMN + i)); newEditor.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { Text text = (Text)editor.getEditor(); editor.getItem().setText(EDITABLECOLUMN, text.getText()); } }); newEditor.selectAll(); newEditor.setFocus(); editor.setEditor(newEditor, item, EDITABLECOLUMN + i); } } });
Bekomme immer eine Fehlermeldung "widget is disposed", weiß jemand Rat, was ich machen könnte? danke im voraus!
lg Gertsch
Ähnliche Themen
-
SWT Table sortieren mit TableEditor(Combobox)
Von draig im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 0Letzter Beitrag: 17.08.08, 17:24 -
SWT: TableEditor und TableItem
Von Tobias Köhler im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 2Letzter Beitrag: 16.10.07, 13:27 -
Hilfe zu SWT Table, TableItem und TableEditor
Von tommy_ im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 1Letzter Beitrag: 11.10.07, 13:19 -
Tabellensortierung funktioniert / Nur die TableEditor nicht!
Von SteffenPeil im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 0Letzter Beitrag: 23.07.07, 08:32 -
SWT - Table und TableEditor
Von CoolWater im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 0Letzter Beitrag: 19.08.04, 16:38





Zitieren
Login





