View Javadoc
1 /* 2 * Angkor Web Framework 3 * 4 * Distributable under LGPL license. 5 * See terms of license at gnu.org. 6 */ 7 package com.tirsen.angkor.widget; 8 9 import java.beans.PropertyEditor; 10 import java.beans.PropertyEditorManager; 11 12 /*** 13 * A simple value model that keeps track of the a value, the type of the value is determined based 14 * on the value given when constructed. 15 * 16 * <!-- $Id: BasicValueModel.java,v 1.3 2002/10/07 19:49:20 tirsen Exp $ --> 17 * 18 * @author $Author: tirsen $ 19 * @version $Revision: 1.3 $ 20 */ 21 public class BasicValueModel extends AbstractValueModel 22 { 23 private Object value = ""; 24 25 public BasicValueModel(Object value) 26 { 27 this.value = value; 28 } 29 30 public BasicValueModel() 31 { 32 } 33 34 public Object getValue() 35 { 36 return value; 37 } 38 39 public void setValue(Object value) 40 { 41 this.value = value; 42 changed(); 43 } 44 45 public boolean isReadOnly() 46 { 47 return false; 48 } 49 50 public Class getValueClass() 51 { 52 return value.getClass(); 53 } 54 55 public PropertyEditor getPropertyEditor() 56 { 57 return PropertyEditorManager.findEditor(getValueClass()); 58 } 59 }

This page was automatically generated by Maven