comparison org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.d @ 85:6be48cf9f95c

Work on databinding
author Frank Benoit <benoit@tionex.de>
date Sat, 18 Apr 2009 13:54:50 +0200
parents 383ce7bd736b
children 9e0ab372d5d8
comparison
equal deleted inserted replaced
84:fcf926c91ca4 85:6be48cf9f95c
26 * @since 1.0 26 * @since 1.0
27 */ 27 */
28 public class DateToStringConverter : DateConversionSupport , IConverter { 28 public class DateToStringConverter : DateConversionSupport , IConverter {
29 public Object convert(Object source) { 29 public Object convert(Object source) {
30 if (source !is null) 30 if (source !is null)
31 return format(cast(Date)source); 31 return stringcast(format(cast(Date)source));
32 return ""; //$NON-NLS-1$ 32 return stringcast(""); //$NON-NLS-1$
33 } 33 }
34 34
35 public Object getFromType() { 35 public Object getFromType() {
36 return Date.classinfo; 36 return typeid(Date);
37 } 37 }
38 38
39 public Object getToType() { 39 public Object getToType() {
40 return String.classinfo; 40 return typeid(StringCls);
41 } 41 }
42 } 42 }