[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: Is SWT in MVC architecture?

I use the ComboBoxCellEditor class (which uses CCombo rather than Combo) and don't see this problem.
I don't think you really want to change the size of the cell. It's based on the font of the text, the image size (if any) and the column widths either specified programmatically or by user resizing. Is the Combo box using the same font as your table?
You might look at the TableViewer class to see how it introduces the TableEditor and CellEditor, particularly for the layout data, and see how it compares to what you are doing.
 
   Stef
I am able to use TableEditor to create cell editors, however if the cell editor is a Combo, then even by setting grabVertical and grabHorizontal to true, the height of the Combo box is always bigger than the table cell, and width is smaller than the cell. Is there a way to change the size of a cell?
 
 
 

Stef van Dijk wrote:

Actually, I have to take this back. There's no viewer to allow this, but you should be able to do what you want directly using the Table and TableEditor classes, and handling the mouse events yourself. There is some sample code in the JavaDoc for the TableEditor class.    Stef
"Stef van Dijk" <Stef_van_Dijk@xxxxxxx> wrote in message news:9kpcst$odq$1@xxxxxxxxxxxxx...In short, you can't. The TableViewer only allows for one cell editor per column. The PropertySheetViewer is closer in some respects to what you want since you can have a unique cell editor per cell, but it a) is not public, b) requires you provide IPropertySheetEntrys, c) only supports two columns and d) only allows editing of the second column. But other than that... ;-)I had to create my own hybrid of these two to get the behavior I needed. BTW, I also had to create my own EditableComboBoxCellEditor to allow the user to type arbitrary text into the field as well as select from a pre-defined list.   Stef
<leunga@xxxxxxxxxx> wrote in message news:3B7024E2.59C84ECE@xxxxxxxxxx...How can I create a SWT table where each cell is editable? The cell editors can be a text editior or a comboBox editor.

Anita