1 12 package org.eclipse.jface.internal.databinding.provisional.conversion; 13 14 15 16 17 20 public class ConvertString2Float implements IConverter { 21 22 25 public Object convert(Object source) { 26 try { 27 return new Float (Float.parseFloat((String ) source)); 28 } catch (Exception e) { 29 throw new IllegalArgumentException ("String2Float: " + e.getMessage() + ": " + source); } 31 } 32 33 public Object getFromType() { 34 return String .class; 35 } 36 37 public Object getToType() { 38 return Float .class; 39 } 40 41 } 42 | Popular Tags |