1 11 12 package org.eclipse.core.internal.databinding.conversion; 13 14 import org.eclipse.core.databinding.conversion.Converter; 15 import org.eclipse.core.databinding.conversion.IConverter; 16 import org.eclipse.core.runtime.IStatus; 17 18 23 public class StatusToStringConverter extends Converter implements IConverter { 24 27 public StatusToStringConverter() { 28 super(IStatus.class, String .class); 29 } 30 31 34 public Object convert(Object fromObject) { 35 if (fromObject == null) { 36 throw new IllegalArgumentException ("Parameter 'fromObject' was null."); } 38 39 IStatus status = (IStatus) fromObject; 40 return status.getMessage(); 41 } 42 } 43 | Popular Tags |