Mercurial > projects > dwt2
annotate org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.d @ 88:9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 19 Apr 2009 11:10:09 +0200 |
parents | 6be48cf9f95c |
children |
rev | line source |
---|---|
78 | 1 /* |
2 * Copyright cast(C) 2005 db4objects Inc. http://www.db4o.com | |
3 * | |
4 * All rights reserved. This program and the accompanying materials | |
5 * are made available under the terms of the Eclipse Public License v1.0 | |
6 * which accompanies this distribution, and is available at | |
7 * http://www.eclipse.org/legal/epl-v10.html | |
8 * | |
9 * Contributors: | |
10 * db4objects - Initial API and implementation | |
11 */ | |
12 module org.eclipse.core.internal.databinding.conversion.StringToBooleanConverter; | |
81 | 13 import org.eclipse.core.internal.databinding.conversion.StringToBooleanPrimitiveConverter; |
78 | 14 |
15 import java.lang.all; | |
16 | |
17 /** | |
18 * StringToBooleanConverter. | |
19 */ | |
20 public class StringToBooleanConverter : StringToBooleanPrimitiveConverter { | |
21 | |
22 /* | |
23 * (non-Javadoc) | |
24 * | |
25 * @see org.eclipse.jface.binding.converter.IConverter#convert(java.lang.Object) | |
26 */ | |
27 public Object convert(Object source) { | |
85 | 28 String sourceString = stringcast( source); |
78 | 29 if ("".equals(sourceString.trim())) { //$NON-NLS-1$ |
30 return null; | |
31 } | |
32 return super.convert(source); | |
33 } | |
34 | |
35 public Object getToType() { | |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
85
diff
changeset
|
36 return Class.fromType!(Boolean); |
78 | 37 } |
38 | |
39 } |