KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > swing > JButtonImpl


1 // skeleton class automatically generated
2

3 package org.objectweb.fractal.swing;
4
5 import org.objectweb.fractal.api.control.BindingController;
6
7 import java.util.HashMap JavaDoc;
8 import java.util.Map JavaDoc;
9 import java.awt.event.ActionListener JavaDoc;
10
11 public class JButtonImpl
12   extends javax.swing.JButton JavaDoc
13   implements JButtonItf, JButtonAttributes, BindingController
14 {
15
16   // fields manually added
17
public final static String JavaDoc ACTION_LISTENERS_BINDING = "action-listeners";
18   private Map JavaDoc actionListeners = new HashMap JavaDoc();
19
20   public JButtonImpl () {
21     super();
22   }
23   public JButtonImpl (javax.swing.Icon JavaDoc arg0) {
24     super(arg0);
25   }
26   public JButtonImpl (String JavaDoc arg0) {
27     super(arg0);
28   }
29   public JButtonImpl (javax.swing.Action JavaDoc arg0) {
30     super(arg0);
31   }
32   public JButtonImpl (String JavaDoc arg0, javax.swing.Icon JavaDoc arg1) {
33     super(arg0,arg1);
34   }
35
36   public String JavaDoc[] listFc () {
37     // put your own code here
38
int size = actionListeners.size();
39     return (String JavaDoc[])actionListeners.keySet().toArray(new String JavaDoc[size]);
40   }
41
42   public Object JavaDoc lookupFc (String JavaDoc clientItfName) {
43     // put your own code here
44
if (clientItfName.startsWith(ACTION_LISTENERS_BINDING)) {
45       return actionListeners.get(clientItfName);
46     }
47     return null;
48   }
49
50   public void bindFc (String JavaDoc clientItfName, Object JavaDoc serverItf) {
51     // put your own code here
52
if (clientItfName.startsWith(ACTION_LISTENERS_BINDING)) {
53       actionListeners.put(clientItfName, serverItf);
54       super.addActionListener((java.awt.event.ActionListener JavaDoc)serverItf);
55     }
56   }
57
58   public void unbindFc (String JavaDoc clientItfName) {
59     // put your own code here
60
if (clientItfName.startsWith(ACTION_LISTENERS_BINDING)) {
61       ActionListener JavaDoc a = (ActionListener JavaDoc)actionListeners.get(clientItfName);
62       super.removeActionListener(a);
63     }
64   }
65
66 }
67
Popular Tags