Revision 974
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/DynFormFieldAction.java | ||
---|---|---|
1 |
package org.gvsig.tools.dynform.spi.dynformfield; |
|
2 |
|
|
3 |
import java.awt.event.ActionEvent; |
|
4 |
import java.beans.PropertyChangeListener; |
|
5 |
|
|
6 |
import javax.swing.Action; |
|
7 |
|
|
8 |
import org.gvsig.tools.dynform.JDynFormField; |
|
9 |
|
|
10 |
public class DynFormFieldAction implements Action{ |
|
11 |
|
|
12 |
private JDynFormField field; |
|
13 |
private Action action; |
|
14 |
|
|
15 |
public DynFormFieldAction(JDynFormField field, Action act){ |
|
16 |
this.field = field; |
|
17 |
this.action = act; |
|
18 |
} |
|
19 |
|
|
20 |
public Action getAction() { |
|
21 |
return this.action; |
|
22 |
} |
|
23 |
|
|
24 |
public void actionPerformed(ActionEvent arg0) { |
|
25 |
if(this.field != null) |
|
26 |
arg0.setSource(this.field); |
|
27 |
this.getAction().actionPerformed(arg0); |
|
28 |
} |
|
29 |
|
|
30 |
public String getName() { |
|
31 |
return (String) this.getAction().getValue(Action.NAME); |
|
32 |
} |
|
33 |
|
|
34 |
public void addPropertyChangeListener(PropertyChangeListener arg0) { |
|
35 |
this.action.addPropertyChangeListener(arg0); |
|
36 |
} |
|
37 |
|
|
38 |
public Object getValue(String arg0) { |
|
39 |
return this.action.getValue(arg0); |
|
40 |
} |
|
41 |
|
|
42 |
public boolean isEnabled() { |
|
43 |
return this.action.isEnabled(); |
|
44 |
} |
|
45 |
|
|
46 |
public void putValue(String arg0, Object arg1) { |
|
47 |
this.action.putValue(arg0,arg1); |
|
48 |
} |
|
49 |
|
|
50 |
public void removePropertyChangeListener(PropertyChangeListener arg0) { |
|
51 |
this.action.removePropertyChangeListener(arg0); |
|
52 |
} |
|
53 |
|
|
54 |
public void setEnabled(boolean arg0) { |
|
55 |
this.action.setEnabled(arg0); |
|
56 |
} |
|
57 |
|
|
58 |
} |
|
59 |
|
|
0 | 60 |
Also available in: Unified diff