JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / src / javajs / swing / JComponent.java
1 package javajs.swing;\r
2 \r
3 import javajs.awt.Container;\r
4 \r
5 public abstract class JComponent extends Container {\r
6 \r
7   protected boolean autoScrolls;\r
8   protected String actionCommand;\r
9   protected Object actionListener;\r
10 \r
11   protected JComponent(String type) {\r
12     super(type);\r
13   }\r
14   \r
15   public void setAutoscrolls(boolean b) {\r
16     autoScrolls = b;\r
17   }\r
18   \r
19   /** \r
20    * Note that it will be the job of the JavaScript on the \r
21    * page to do with actionListener what is desired.\r
22    * \r
23    * In javax.swing, these methods are in AbstractButton, but\r
24    * this is better for javajs.swing, reducing the duplication\r
25    * of JTextField's actionListener business. \r
26    * \r
27    * @param listener \r
28    * \r
29    */\r
30   public void addActionListener(Object listener) {\r
31     actionListener = listener;\r
32   }\r
33 \r
34   public String getActionCommand() {\r
35     return actionCommand;\r
36   }\r
37 \r
38   public void setActionCommand(String actionCommand) {\r
39     this.actionCommand = actionCommand;\r
40   }\r
41 \r
42 \r
43 \r
44   \r
45 }\r