View Javadoc

1   package com.eviware.x.impl.swing;
2   
3   import java.awt.Dimension;
4   
5   import javax.swing.Action;
6   import javax.swing.JButton;
7   
8   import com.eviware.x.form.XFormTextField;
9   
10  public class ActionFormFieldComponent extends AbstractSwingXFormField<JButton> implements XFormTextField
11  {
12  	public ActionFormFieldComponent(String name, String description)
13  	{
14  		super( new JButton( name ) );
15  	}
16  
17  	public void setWidth(int columns)
18  	{
19  		getComponent().setPreferredSize(new Dimension( columns, 20 ));
20  	}
21  
22  	public String getValue()
23  	{
24  		return null;
25  	}
26  
27  	public void setValue(String value)
28  	{
29  	}
30  
31  	@Override
32  	public void setProperty(String name, Object value)
33  	{
34  		if( name.equals("action"))
35  		{
36  			getComponent().setAction((Action) value);
37  		}
38  		else
39  		{
40  			super.setProperty(name, value);
41  		}
42  	}
43  	
44  	
45  }