http://www.vogella.de/articles/EclipseJFaceTable/article.html

14 views
Skip to first unread message

Eugene

unread,
May 14, 2009, 4:51:28 PM5/14/09
to vogella
Hi Lars,

It'll be beter if you use this ComboBoxCellEditor(table, gender,
SWT.READ_ONLY);

in methode:

public PersonEditingSupport(ColumnViewer viewer, int column) {
super(viewer);
Table table = ((TableViewer) viewer).getTable();
// Create the correct editor based on the column index
switch (column) {
case 2:
String[] gender = { "male", "female" };
editor = new ComboBoxCellEditor(table, gender);
break;
case 3:
editor = new CheckboxCellEditor(null, SWT.CHECK);
break;
default:
editor = new TextCellEditor(table);
}
this.column = column;
}

Regards,

Eugene Markine

Lars Vogel

unread,
May 15, 2009, 4:41:40 PM5/15/09
to vog...@googlegroups.com
Hi Eugene,

why is this better? I can tell no difference.

Best regards, Lars

2009/5/14 Eugene <emar...@gmail.com>



--
Lars
http://www.vogella.de - Tutorial about Java, Eclipse and Web programming

Eugene Markine

unread,
May 15, 2009, 9:31:14 PM5/15/09
to vog...@googlegroups.com
Hi Lars,

Because in Combo editor you can select only two values "male", "female" from the list.
But in case CheckboxCellEditor(null, SWT.CHECK) you can type in the combo text field any other text ('blah' for instance). This is not conform with domain model of Person.
Anyway, thank you very much for your tutorial!

Regards,

Eugene

2009/5/15 Lars Vogel <lars....@googlemail.com>

Lars Vogel

unread,
May 17, 2009, 4:04:58 AM5/17/09
to vog...@googlegroups.com
Hi Eugene,

This is true, I adjusted the tutorial. Thank you for your feedback.

Best regards, Lars

2009/5/16 Eugene Markine <emar...@gmail.com>
Reply all
Reply to author
Forward
0 new messages