01: package org.dbbrowser.ui.widget;
02:
03: import java.awt.event.ActionListener;
04: import javax.swing.Icon;
05:
06: /**
07: * A class which represents a button. Build a button and add it to the buttons panel.
08: * @author amangat
09: */
10: public class Button {
11: private String name = null;
12: private ActionListener listener = null;
13: private String label = null;
14: private Icon icon = null;
15: private Boolean defaultFocussedButton = null;
16:
17: /**
18: * Constructer
19: * @param name
20: * @param listener
21: * @param label
22: * @param icon
23: * @param defaultFocussedButton
24: */
25: public Button(String name, ActionListener listener, String label,
26: Icon icon, Boolean defaultFocussedButton) {
27: this .name = name;
28: this .listener = listener;
29: this .label = label;
30: this .icon = icon;
31: this .defaultFocussedButton = defaultFocussedButton;
32: }
33:
34: /**
35: * Returns the name
36: * @return
37: */
38: public String getName() {
39: return this .name;
40: }
41:
42: /**
43: * Returns the action listener
44: * @return
45: */
46: public ActionListener getListener() {
47: return this .listener;
48: }
49:
50: /**
51: * Returns the label for the button
52: * @return
53: */
54: public String getLabel() {
55: return this .label;
56: }
57:
58: /**
59: * Returns the icon for the button
60: * @return
61: */
62: public Icon getIcon() {
63: return this .icon;
64: }
65:
66: /**
67: * Returns true if this button in the group should be selected by default
68: * @return
69: */
70: public Boolean isDefaultFocussedButton() {
71: return this.defaultFocussedButton;
72: }
73: }
|