|
@@ -11,28 +11,24 @@ |
11 |
11 |
|
import static org.litesoft.uispecification.FormWidgetCtrl.*; |
12 |
12 |
|
|
13 |
13 |
|
public class UserFieldsPanel extends SizeableVerticalPanel implements UserViewNames, |
14 |
|
- |
QBEinputPanelAccessor<UserView> |
15 |
|
- |
{ |
|
14 |
+ |
QBEinputPanelAccessor<UserView> { |
16 |
15 |
|
private Widget mPointerField; |
17 |
16 |
|
private FormEngine mFE; |
18 |
17 |
|
private RestrictedResourceView mCurrentRestrictedResource; |
19 |
18 |
|
private boolean mShowAll; |
20 |
19 |
|
|
21 |
|
- |
public UserFieldsPanel( RestrictedResourceView pCurrentRestrictedResource, boolean pShowAll ) |
22 |
|
- |
{ |
|
20 |
+ |
public UserFieldsPanel( RestrictedResourceView pCurrentRestrictedResource, boolean pShowAll ) { |
23 |
21 |
|
mCurrentRestrictedResource = pCurrentRestrictedResource; |
24 |
22 |
|
mShowAll = pShowAll; |
25 |
23 |
|
stretchableHorizontally(); |
26 |
24 |
|
} |
27 |
25 |
|
|
28 |
26 |
|
@Override |
29 |
|
- |
public Widget initialize( FormEngine pFE, FormBinder<UserView> pFB ) |
30 |
|
- |
{ |
|
27 |
+ |
public Widget initialize( FormEngine pFE, FormBinder<UserView> pFB ) { |
31 |
28 |
|
mFE = pFE; |
32 |
29 |
|
|
33 |
30 |
|
add( createTopPanel( pFB ) ); |
34 |
|
- |
if ( mShowAll ) |
35 |
|
- |
{ |
|
31 |
+ |
if ( mShowAll ) { |
36 |
32 |
|
add( createPermissions( pFB, mCurrentRestrictedResource ) ); |
37 |
33 |
|
add( new Spacer( 40 ) ); |
38 |
34 |
|
add( pFB.add( aResetPassword ) ); |
|
@@ -40,8 +36,7 @@ |
40 |
36 |
|
return this; |
41 |
37 |
|
} |
42 |
38 |
|
|
43 |
|
- |
private Widget createTopPanel( FormBinder<UserView> pFB ) |
44 |
|
- |
{ |
|
39 |
+ |
private Widget createTopPanel( FormBinder<UserView> pFB ) { |
45 |
40 |
|
TightGrid zPanel = new TightGrid( 3, 2 ); |
46 |
41 |
|
zPanel.getCellFormatter().setAlignment( 2, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP ); |
47 |
42 |
|
zPanel.setWidget( 0, 0, mPointerField = pFB.add( aFirstName ) ); |
|
@@ -51,34 +46,30 @@ |
51 |
46 |
|
return zPanel; |
52 |
47 |
|
} |
53 |
48 |
|
|
54 |
|
- |
public Widget getPointerField() |
55 |
|
- |
{ |
|
49 |
+ |
public Widget getPointerField() { |
56 |
50 |
|
return mPointerField; |
57 |
51 |
|
} |
58 |
52 |
|
|
59 |
|
- |
private Widget createNameRest( FormBinder<UserView> pFB ) |
60 |
|
- |
{ |
|
53 |
+ |
private Widget createNameRest( FormBinder<UserView> pFB ) { |
61 |
54 |
|
HorizontalPanel zPanel = new HorizontalPanel(); |
62 |
55 |
|
zPanel.add( pFB.add( aMiddleInitial, MI ) ); |
63 |
56 |
|
zPanel.add( pFB.add( aLastName ) ); |
64 |
57 |
|
return zPanel; |
65 |
58 |
|
} |
66 |
59 |
|
|
67 |
|
- |
private Widget createPermissions( FormBinder<UserView> pFB, RestrictedResourceView pCurrentRestrictedResource ) |
68 |
|
- |
{ |
|
60 |
+ |
private Widget createPermissions( FormBinder<UserView> pFB, RestrictedResourceView pCurrentRestrictedResource ) { |
69 |
61 |
|
HorizontalPanel zPanel = new HorizontalPanel(); |
70 |
62 |
|
zPanel.add( createPermissionsLeft( pFB, pCurrentRestrictedResource ) ); |
71 |
63 |
|
zPanel.add( createPermissionsRight( pFB ) ); |
72 |
64 |
|
return mFE.addHideable( Visible( ViewOrEdit ).enable( Edit ), zPanel ); |
73 |
65 |
|
} |
74 |
66 |
|
|
75 |
|
- |
private Widget createPermissionsLeft( FormBinder<UserView> pFB, RestrictedResourceView pCurrentRestrictedResource ) |
76 |
|
- |
{ |
|
67 |
+ |
private Widget createPermissionsLeft( FormBinder<UserView> pFB, RestrictedResourceView pCurrentRestrictedResource ) { |
77 |
68 |
|
VerticalPanel zPanel = new VerticalPanel(); |
78 |
69 |
|
zPanel.add( new Spacer( 6 ) ); |
79 |
|
- |
if ( pCurrentRestrictedResource != null ) |
80 |
|
- |
{ |
81 |
|
- |
SizeableTitledBorderedVerticalPanel zRestrictedResourcePanel = new SizeableTitledBorderedVerticalPanel( "RestrictedResource: " + pCurrentRestrictedResource.getName(), null ); |
|
70 |
+ |
if ( pCurrentRestrictedResource != null ) { |
|
71 |
+ |
SizeableTitledBorderedVerticalPanel zRestrictedResourcePanel = |
|
72 |
+ |
new SizeableTitledBorderedVerticalPanel( "RestrictedResource: " + pCurrentRestrictedResource.getName(), null ); |
82 |
73 |
|
zRestrictedResourcePanel.add( new Spacer( 4 ) ); |
83 |
74 |
|
zRestrictedResourcePanel.add( createStatus( pFB ) ); |
84 |
75 |
|
// zRestrictedResourcePanel.add( new Spacer( 3 ) ); |
|
@@ -88,16 +79,14 @@ |
88 |
79 |
|
return zPanel; |
89 |
80 |
|
} |
90 |
81 |
|
|
91 |
|
- |
private Widget createStatus( FormBinder<UserView> pFB ) |
92 |
|
- |
{ |
|
82 |
+ |
private Widget createStatus( FormBinder<UserView> pFB ) { |
93 |
83 |
|
HorizontalPanel zPanel = new HorizontalPanel(); |
94 |
84 |
|
zPanel.add( new Spacer().width( 20 ) ); |
95 |
85 |
|
zPanel.add( pFB.add( aStatus, "" ) ); |
96 |
86 |
|
return zPanel; |
97 |
87 |
|
} |
98 |
88 |
|
|
99 |
|
- |
private Widget createPermissionsRight( FormBinder<UserView> pFB ) |
100 |
|
- |
{ |
|
89 |
+ |
private Widget createPermissionsRight( FormBinder<UserView> pFB ) { |
101 |
90 |
|
VerticalPanel zPanel = new VerticalPanel(); |
102 |
91 |
|
zPanel.add( new Spacer( 14 ) ); |
103 |
92 |
|
zPanel.add( pFB.add( aHelpDeskMember ) ); |