|
@@ -6,14 +6,12 @@ |
6 |
6 |
|
|
7 |
7 |
|
import com.google.gwt.user.client.ui.*; |
8 |
8 |
|
|
9 |
|
- |
public class FormButtonAdapter extends AbstractFormActionAdapter implements ClickListener |
10 |
|
- |
{ |
|
9 |
+ |
public class FormButtonAdapter extends AbstractFormActionAdapter implements ClickListener { |
11 |
10 |
|
private ButtonBase mButton; |
12 |
11 |
|
|
13 |
12 |
|
public FormButtonAdapter( FormInstanceComponentHandler pComponentHandler, // |
14 |
13 |
|
String pActionID, AbstractSharedMetaData pMD, // |
15 |
|
- |
UiActionable pDef ) |
16 |
|
- |
{ |
|
14 |
+ |
UiActionable pDef ) { |
17 |
15 |
|
super( pComponentHandler, pActionID, pDef ); |
18 |
16 |
|
|
19 |
17 |
|
initButton( pMD ); |
|
@@ -21,8 +19,7 @@ |
21 |
19 |
|
|
22 |
20 |
|
public FormButtonAdapter( FormInstanceComponentHandler pComponentHandler, // |
23 |
21 |
|
String pActionID, AbstractSharedMetaData pMD, // |
24 |
|
- |
Boolean pInputChangeStateEnablement, Boolean pInputErrorStateEnablement ) |
25 |
|
- |
{ |
|
22 |
+ |
Boolean pInputChangeStateEnablement, Boolean pInputErrorStateEnablement ) { |
26 |
23 |
|
super( pComponentHandler, pActionID, pInputChangeStateEnablement, pInputErrorStateEnablement ); |
27 |
24 |
|
|
28 |
25 |
|
initButton( pMD ); |
|
@@ -31,16 +28,14 @@ |
31 |
28 |
|
public FormButtonAdapter( FormInstanceComponentHandler pComponentHandler, // |
32 |
29 |
|
String pActionID, AbstractSharedMetaData pMD, // |
33 |
30 |
|
Boolean pInputChangeStateEnablement, Boolean pInputErrorStateEnablement, |
34 |
|
- |
ButtonBase pButton ) |
35 |
|
- |
{ |
|
31 |
+ |
ButtonBase pButton ) { |
36 |
32 |
|
super( pComponentHandler, pActionID, pInputChangeStateEnablement, pInputErrorStateEnablement ); |
37 |
33 |
|
|
38 |
34 |
|
Objects.assertNotNull( "Button", mButton = pButton ); |
39 |
35 |
|
initButtonToolTip( pMD ); |
40 |
36 |
|
} |
41 |
37 |
|
|
42 |
|
- |
private void initButton( AbstractSharedMetaData pMD ) |
43 |
|
- |
{ |
|
38 |
+ |
private void initButton( AbstractSharedMetaData pMD ) { |
44 |
39 |
|
mButton = new Button(); |
45 |
40 |
|
mButton.addStyleName( "litesoft-FormButton" ); |
46 |
41 |
|
mButton.setText( pMD.getExternalText() ); |
|
@@ -48,42 +43,35 @@ |
48 |
43 |
|
initButtonToolTip( pMD ); |
49 |
44 |
|
} |
50 |
45 |
|
|
51 |
|
- |
private void initButtonToolTip( AbstractSharedMetaData pMD ) |
52 |
|
- |
{ |
|
46 |
+ |
private void initButtonToolTip( AbstractSharedMetaData pMD ) { |
53 |
47 |
|
mButton.setTitle( Strings.deNull( pMD.getTooltip() ) ); |
54 |
48 |
|
} |
55 |
49 |
|
|
56 |
|
- |
protected Widget initWidget() |
57 |
|
- |
{ |
|
50 |
+ |
protected Widget initWidget() { |
58 |
51 |
|
mButton.addClickListener( this ); |
59 |
52 |
|
HorizontalPanel zPanel = new HorizontalPanel(); |
60 |
53 |
|
zPanel.add( mButton ); |
61 |
54 |
|
return zPanel; |
62 |
55 |
|
} |
63 |
56 |
|
|
64 |
|
- |
public boolean isVisible() |
65 |
|
- |
{ |
|
57 |
+ |
public boolean isVisible() { |
66 |
58 |
|
return mButton.isVisible(); |
67 |
59 |
|
} |
68 |
60 |
|
|
69 |
|
- |
public boolean setFocus() |
70 |
|
- |
{ |
|
61 |
+ |
public boolean setFocus() { |
71 |
62 |
|
mButton.setFocus( true ); |
72 |
63 |
|
return true; |
73 |
64 |
|
} |
74 |
65 |
|
|
75 |
|
- |
public boolean isEnabled() |
76 |
|
- |
{ |
|
66 |
+ |
public boolean isEnabled() { |
77 |
67 |
|
return mButton.isEnabled(); |
78 |
68 |
|
} |
79 |
69 |
|
|
80 |
|
- |
protected void setWidgetEnabled( boolean pEnabled ) |
81 |
|
- |
{ |
|
70 |
+ |
protected void setWidgetEnabled( boolean pEnabled ) { |
82 |
71 |
|
mButton.setEnabled( pEnabled ); |
83 |
72 |
|
} |
84 |
73 |
|
|
85 |
|
- |
public void onClick( Widget sender ) |
86 |
|
- |
{ |
|
74 |
+ |
public void onClick( Widget sender ) { |
87 |
75 |
|
actionRequested( false ); |
88 |
76 |
|
} |
89 |
77 |
|
} |