CDateTime: How to set value [message #62728] |
Tue, 17 February 2009 08:10  |
Eclipse User |
|
|
|
Hi all,
How do I set the default date (or time) when using a CDateTime control?
I'm using the CDateTime widget to set a time within a table (or grid).
Therefore I have a TimeCellEditor (extending CellEditor). Within the
doSetValue(Object value) method I'd like to do something like this:
@Override
protected void doSetValue(Object value) {
cdt.setValue(value.toString());
}
Where the given 'value' object has the same format as is set on the
CDateTime using cdt.setPattern("HH:mm:ss");
How can I set the time (or date for that matter) to a CDateTime widget?
Thanks in advance for any hint.
Christian
|
|
|
Re: CDateTime: How to set value [message #62829 is a reply to message #62728] |
Tue, 17 February 2009 19:16  |
Eclipse User |
|
|
|
Hi Christian,
Currently CDateTime only takes a java.util.Date object to set its
selection: cdt.setSelection(java.util.Date).
However, since you can set the format explicitly, I have considered
adding a setSelection(String) method... not sure if it's worth the
additional api yet, or if there are other negative implications.
If this is something you're interested in, please open a bug and we'll
discuss it there.
cheers,
Jeremy
Christian Hauser wrote:
> Hi all,
>
> How do I set the default date (or time) when using a CDateTime control?
>
> I'm using the CDateTime widget to set a time within a table (or grid).
> Therefore I have a TimeCellEditor (extending CellEditor). Within the
> doSetValue(Object value) method I'd like to do something like this:
>
> @Override
> protected void doSetValue(Object value) {
> cdt.setValue(value.toString());
> }
>
> Where the given 'value' object has the same format as is set on the
> CDateTime using cdt.setPattern("HH:mm:ss");
>
> How can I set the time (or date for that matter) to a CDateTime widget?
>
> Thanks in advance for any hint.
>
> Christian
>
>
|
|
|
Re: CDateTime: How to set value [message #593686 is a reply to message #62728] |
Tue, 17 February 2009 19:16  |
Eclipse User |
|
|
|
Hi Christian,
Currently CDateTime only takes a java.util.Date object to set its
selection: cdt.setSelection(java.util.Date).
However, since you can set the format explicitly, I have considered
adding a setSelection(String) method... not sure if it's worth the
additional api yet, or if there are other negative implications.
If this is something you're interested in, please open a bug and we'll
discuss it there.
cheers,
Jeremy
Christian Hauser wrote:
> Hi all,
>
> How do I set the default date (or time) when using a CDateTime control?
>
> I'm using the CDateTime widget to set a time within a table (or grid).
> Therefore I have a TimeCellEditor (extending CellEditor). Within the
> doSetValue(Object value) method I'd like to do something like this:
>
> @Override
> protected void doSetValue(Object value) {
> cdt.setValue(value.toString());
> }
>
> Where the given 'value' object has the same format as is set on the
> CDateTime using cdt.setPattern("HH:mm:ss");
>
> How can I set the time (or date for that matter) to a CDateTime widget?
>
> Thanks in advance for any hint.
>
> Christian
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03798 seconds