DatePickerCombo as CellEditor [message #458915] |
Tue, 26 July 2005 11:41 |
Joos-Hendrik Böse Messages: 1 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm trying to use the DatePickerCombo Widget of
http://sourceforge.net/projects/swt-datepicker/ as CellEditor to
manipulate date values.
I derived my new class from CellEditor and implemented the needed
methods, this was quite simple and in fact everything seems to work
except that the DatePicker only shows up for a few milliseconds and
dissappears again :-/
Any Ideas?
regards
Joos
This is the implementation of my class:
-----------
public class DateCellEditor extends CellEditor {
static Logger logger = Logger.getLogger(DateCellEditor.class);
private DatePickerCombo combo;
protected Control createControl(Composite parent) {
logger.debug("createControl called");
combo = new DatePickerCombo(parent, SWT.FLAT);
combo.setFont(parent.getFont());
return combo;
}
protected Object doGetValue() {
return combo.getDate();
}
protected void doSetFocus() {
combo.setFocus();
}
protected void doSetValue(Object value) {
Date newDate = (Date)value;
combo.setDate(newDate);
}
public LayoutData getLayoutData() {
LayoutData layoutData = super.getLayoutData();
layoutData.minimumWidth = 40;
return layoutData;
}
}
------------
|
|
|
Powered by
FUDForum. Page generated in 0.02822 seconds