litesoft
Diff Revisions
125
vs
133
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/DefButtonNamedTypedFactory.java
|
@@ -3,10 +3,12 @@ |
3 |
3 |
|
|
4 |
4 |
|
import java.util.*; |
5 |
5 |
|
|
|
6 |
+ |
import org.litesoft.GWT.client.command.*; |
6 |
7 |
|
import org.litesoft.GWT.client.widgets.nonpublic.*; |
7 |
8 |
|
import org.litesoft.core.util.*; |
8 |
9 |
|
|
9 |
10 |
|
import com.google.gwt.event.dom.client.*; |
|
11 |
+ |
import com.google.gwt.user.client.*; |
10 |
12 |
|
|
11 |
13 |
|
public abstract class DefButtonNamedTypedFactory |
12 |
14 |
|
{ |
|
@@ -17,8 +19,8 @@ |
17 |
19 |
|
|
18 |
20 |
|
private final DefButtonNamedTyped mTyped; |
19 |
21 |
|
private final Form mForm; |
20 |
|
- |
private boolean mDisabled; |
21 |
|
- |
private String mEnabledToolTip, mDisabledToolTip; |
|
22 |
+ |
private String mCustomStyle,mEnabledToolTip, mDisabledToolTip; // initialized to null |
|
23 |
+ |
private boolean mDisabled = false; |
22 |
24 |
|
private List<ClickHandler> mClickHandlers; |
23 |
25 |
|
|
24 |
26 |
|
protected DefButtonNamedTypedFactory( DefButtonNamedTyped pTyped, Form pForm ) |
|
@@ -86,13 +88,34 @@ |
86 |
88 |
|
return this; |
87 |
89 |
|
} |
88 |
90 |
|
|
89 |
|
- |
public final DefButtonNamedTypedFactory setEnabledToolTip( String pEnabledToolTip ) |
|
91 |
+ |
public final DefButtonNamedTypedFactory add( CommandHandlerAdaptor pAdaptor ) |
|
92 |
+ |
{ |
|
93 |
+ |
return add( (ClickHandler) pAdaptor ); |
|
94 |
+ |
} |
|
95 |
+ |
|
|
96 |
+ |
public final DefButtonNamedTypedFactory add( Command pCommand ) |
|
97 |
+ |
{ |
|
98 |
+ |
return (pCommand == null) ? this : add( new ClickHandlerCommandAdaptor( pCommand ) ); |
|
99 |
+ |
} |
|
100 |
+ |
|
|
101 |
+ |
public String getCustomStyle() |
|
102 |
+ |
{ |
|
103 |
+ |
return mCustomStyle; |
|
104 |
+ |
} |
|
105 |
+ |
|
|
106 |
+ |
public DefButtonNamedTypedFactory customStyle( String pCustomStyle ) |
|
107 |
+ |
{ |
|
108 |
+ |
mCustomStyle = UtilsCommon.noEmpty( pCustomStyle ); |
|
109 |
+ |
return this; |
|
110 |
+ |
} |
|
111 |
+ |
|
|
112 |
+ |
public final DefButtonNamedTypedFactory enabledToolTip( String pEnabledToolTip ) |
90 |
113 |
|
{ |
91 |
114 |
|
mEnabledToolTip = UtilsCommon.noEmpty( pEnabledToolTip ); |
92 |
115 |
|
return this; |
93 |
116 |
|
} |
94 |
117 |
|
|
95 |
|
- |
public final DefButtonNamedTypedFactory setDisabledToolTip( String pDisabledToolTip ) |
|
118 |
+ |
public final DefButtonNamedTypedFactory disabledToolTip( String pDisabledToolTip ) |
96 |
119 |
|
{ |
97 |
120 |
|
mDisabledToolTip = (pDisabledToolTip == null) ? null : pDisabledToolTip.trim(); |
98 |
121 |
|
return this; |
|
@@ -119,6 +142,10 @@ |
119 |
142 |
|
{ |
120 |
143 |
|
sb.append( " Disabled" ); |
121 |
144 |
|
} |
|
145 |
+ |
if ( mCustomStyle != null ) |
|
146 |
+ |
{ |
|
147 |
+ |
sb.append( " + " ).append( mCustomStyle ); |
|
148 |
+ |
} |
122 |
149 |
|
sb.append( ": " ).append( mForm ).append( getFormDescription() ); |
123 |
150 |
|
if ( (mEnabledToolTip != null) || (mDisabledToolTip != null) ) |
124 |
151 |
|
{ |