[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Small ComboBoxCellEditor improvement

I think your messing things up a bit because the value you are seeing is the INDEX in the list and not the value!!!!!!

In 3.4 we added a ComboBoxViewerCellEditor which uses a JFace-Viewer. You can simply copy it to your 3.3 workspace and your are done.

Tom

David Perez schrieb:
Hi,

I would change this method (Integer --> Number)

   protected void doSetValue(Object value) {
       Assert.isTrue(comboBox != null && (value instanceof Integer));
       selection = ((Integer) value).intValue();
       comboBox.select(selection);
   }

to:

   protected void doSetValue(Object value) {
       Assert.isTrue(comboBox != null && (value instanceof Number));
       selection = ((Number) value).intValue();
       comboBox.select(selection);
   }

because e.g. in a JDBC environment, you could have Short, Long, ... instead of Integer. We would have more genericity with no cost.

SWT developers, what do you think?



--
B e s t S o l u t i o n . at
--------------------------------------------------------------------
Tom Schindl                                          JFace-Committer
--------------------------------------------------------------------