Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » DatePickerCombo as CellEditor
DatePickerCombo as CellEditor [message #458915] Tue, 26 July 2005 07:41
Eclipse UserFriend
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;
}

}

------------
Previous Topic:How to detect MouseEvent on Text Editor?
Next Topic:Add drag and drop on a TableViewer
Goto Forum:
  


Current Time: Thu Jul 03 13:28:37 EDT 2025

Powered by FUDForum. Page generated in 0.03530 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top