1 17 18 package org.objectweb.jac.aspects.gui.swing; 19 20 import org.objectweb.jac.aspects.gui.FieldUpdate; 21 import org.objectweb.jac.aspects.gui.FieldView; 22 import org.objectweb.jac.aspects.gui.GuiAC; 23 import org.objectweb.jac.core.rtti.FieldItem; 24 import javax.swing.JComponent ; 25 import javax.swing.JLabel ; 26 27 public class SwingFieldView extends AbstractFieldView 28 implements FieldView, FieldUpdate 29 { 30 31 Object value; 32 JLabel label = new JLabel (); 33 34 public SwingFieldView(Object value, Object substance, FieldItem field) { 35 super(substance,field); 36 setValue(value); 37 add(label); 38 } 39 40 public void setValue(Object value) { 41 this.value = value; 42 label.setText(value!=null?GuiAC.toString(value):"null"); 43 } 44 45 protected JComponent getComponent() { 46 return label; 47 } 48 } 49 | Popular Tags |