01: package simpleorm.simplewebapp.core;
02:
03: /**
04: * A button that submits the form.
05: * nameValue is the name of the button that ends up being
06: * the text= in the html.
07: * (Buttons are always created name='W_SubmitButton')
08: */
09: public class WButton {
10: public static final String BUTTONS_NAME = "W_SubmitButton";
11:
12: /** Eg Udate, Delete, ... */
13: String nameValue;
14:
15: /** The pagelet for which this is defined. Must be specified. */
16:
17: WPagelet pagelet;
18:
19: boolean disabled = false;
20:
21: public String getExtraHtmlAttributes() {
22: return disabled ? "disabled=disabled" : "";
23: }
24:
25: ////// GENERATED ////////
26:
27: public WButton(String nameValue, WPagelet pagelet) {
28: this .nameValue = nameValue;
29: this .pagelet = pagelet;
30: }
31:
32: public String getNameValue() {
33: return nameValue;
34: }
35:
36: public boolean isDisabled() {
37: return disabled;
38: }
39:
40: public WButton setDisabled(boolean enabled) {
41: this .disabled = enabled;
42: return this ;
43: }
44:
45: public String toString() {
46: return "{WButton " + nameValue + "}";
47: }
48: }
|