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

Work on databinding
author Frank Benoit <benoit@tionex.de>
date Sat, 18 Apr 2009 13:54:50 +0200
parents 0a55d2d5a946
children 9e0ab372d5d8
comparison
equal deleted inserted replaced
84:fcf926c91ca4 85:6be48cf9f95c
21 * Converts an IStatus into a String. The message of the status is the returned value. 21 * Converts an IStatus into a String. The message of the status is the returned value.
22 * 22 *
23 * @since 1.0 23 * @since 1.0
24 */ 24 */
25 public class StatusToStringConverter : Converter , IConverter { 25 public class StatusToStringConverter : Converter , IConverter {
26 public override Object getFromType() {
27 return super.getFromType();
28 }
29 public override Object getToType() {
30 return super.getToType();
31 }
26 /** 32 /**
27 * Constructs a new instance. 33 * Constructs a new instance.
28 */ 34 */
29 public this() { 35 public this() {
30 super(IStatus.classinfo, String.classinfo); 36 super(typeid(IStatus), typeid(StringCls));
31 } 37 }
32 38
33 /* (non-Javadoc) 39 /* (non-Javadoc)
34 * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object) 40 * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
35 */ 41 */
37 if (fromObject is null) { 43 if (fromObject is null) {
38 throw new IllegalArgumentException("Parameter 'fromObject' was null."); //$NON-NLS-1$ 44 throw new IllegalArgumentException("Parameter 'fromObject' was null."); //$NON-NLS-1$
39 } 45 }
40 46
41 IStatus status = cast(IStatus) fromObject; 47 IStatus status = cast(IStatus) fromObject;
42 return status.getMessage(); 48 return stringcast(status.getMessage());
43 } 49 }
44 } 50 }