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