|
@@ -19,18 +19,15 @@ |
19 |
19 |
|
|
20 |
20 |
|
public class Users extends ClickableViewObjectQBEscreenView<UserView> implements UserViewNames, |
21 |
21 |
|
NewUserEmailDialog.CallBack<UserView>, |
22 |
|
- |
ViewUpdatable<UserView> |
23 |
|
- |
{ |
|
22 |
+ |
ViewUpdatable<UserView> { |
24 |
23 |
|
private ObjectURL mEditing = null; |
25 |
24 |
|
|
26 |
25 |
|
@Override |
27 |
|
- |
protected UriFragmentIdParams createRefreshParams() |
28 |
|
- |
{ |
|
26 |
+ |
protected UriFragmentIdParams createRefreshParams() { |
29 |
27 |
|
return UsersFactory.encodeParams( mEditing ); |
30 |
28 |
|
} |
31 |
29 |
|
|
32 |
|
- |
public Users( String pSection, ViewDef pViewDef, ObjectURL pEditing ) |
33 |
|
- |
{ |
|
30 |
+ |
public Users( String pSection, ViewDef pViewDef, ObjectURL pEditing ) { |
34 |
31 |
|
super( title( pSection, pViewDef ), UserViewDataProvider.getInstance() ); |
35 |
32 |
|
|
36 |
33 |
|
mEditing = pEditing; |
|
@@ -59,7 +56,8 @@ |
59 |
56 |
|
|
60 |
57 |
|
add( mFE.createSectionTitle( "User" ) ); |
61 |
58 |
|
|
62 |
|
- |
UserFieldsPanel zUserFieldsPanel = new UserFieldsPanel( ClientContext.get().get( CurrentRestrictedResourceViewAccessor.class ).getRestrictedResource(), true ); |
|
59 |
+ |
UserFieldsPanel zUserFieldsPanel = |
|
60 |
+ |
new UserFieldsPanel( ClientContext.get().get( CurrentRestrictedResourceViewAccessor.class ).getRestrictedResource(), true ); |
63 |
61 |
|
|
64 |
62 |
|
add( zUserFieldsPanel.initialize( mFE, mFormBinder ) ); |
65 |
63 |
|
add( new SizeableSpacer().stretchable() ); |
|
@@ -68,27 +66,21 @@ |
68 |
66 |
|
} |
69 |
67 |
|
|
70 |
68 |
|
@Override |
71 |
|
- |
public void aboutToShow() |
72 |
|
- |
{ |
|
69 |
+ |
public void aboutToShow() { |
73 |
70 |
|
super.aboutToShow(); |
74 |
71 |
|
ObjectURL zEditing = mEditing; |
75 |
72 |
|
modeSearch(); |
76 |
|
- |
if ( zEditing != null ) |
77 |
|
- |
{ |
78 |
|
- |
mDataProvider.requestRow( zEditing, new FetchRowDataProviderCallBack<UserView>() |
79 |
|
- |
{ |
|
73 |
+ |
if ( zEditing != null ) { |
|
74 |
+ |
mDataProvider.requestRow( zEditing, new FetchRowDataProviderCallBack<UserView>() { |
80 |
75 |
|
@Override |
81 |
|
- |
public void success( UserView pRow ) |
82 |
|
- |
{ |
83 |
|
- |
if ( pRow != null ) |
84 |
|
- |
{ |
|
76 |
+ |
public void success( UserView pRow ) { |
|
77 |
+ |
if ( pRow != null ) { |
85 |
78 |
|
modeEdit( pRow ); |
86 |
79 |
|
} |
87 |
80 |
|
} |
88 |
81 |
|
|
89 |
82 |
|
@Override |
90 |
|
- |
public void error( String pError ) |
91 |
|
- |
{ |
|
83 |
+ |
public void error( String pError ) { |
92 |
84 |
|
getStatusMessageSinc().setErrorMessage( pError ); |
93 |
85 |
|
} |
94 |
86 |
|
} ); |
|
@@ -96,28 +88,22 @@ |
96 |
88 |
|
} |
97 |
89 |
|
|
98 |
90 |
|
@Override |
99 |
|
- |
protected void justLoaded() |
100 |
|
- |
{ |
|
91 |
+ |
protected void justLoaded() { |
101 |
92 |
|
super.justLoaded(); |
102 |
93 |
|
mFE.setFocus(); |
103 |
94 |
|
} |
104 |
95 |
|
|
105 |
96 |
|
@Override |
106 |
|
- |
protected void processVO( UserView pRowValue ) |
107 |
|
- |
{ |
108 |
|
- |
if ( pRowValue != null ) |
109 |
|
- |
{ |
|
97 |
+ |
protected void processVO( UserView pRowValue ) { |
|
98 |
+ |
if ( pRowValue != null ) { |
110 |
99 |
|
modeEdit( pRowValue ); |
111 |
|
- |
} |
112 |
|
- |
else |
113 |
|
- |
{ |
|
100 |
+ |
} else { |
114 |
101 |
|
modeNew(); |
115 |
102 |
|
} |
116 |
103 |
|
} |
117 |
104 |
|
|
118 |
105 |
|
@Override |
119 |
|
- |
public Widget getBottomBar() |
120 |
|
- |
{ |
|
106 |
+ |
public Widget getBottomBar() { |
121 |
107 |
|
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
122 |
108 |
|
|
123 |
109 |
|
zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
|
@@ -128,65 +114,55 @@ |
128 |
114 |
|
} |
129 |
115 |
|
|
130 |
116 |
|
@Override |
131 |
|
- |
public void viewUpdated( UserView pUserView ) |
132 |
|
- |
{ |
|
117 |
+ |
public void viewUpdated( UserView pUserView ) { |
133 |
118 |
|
modeEdit( pUserView ); |
134 |
119 |
|
} |
135 |
120 |
|
|
136 |
|
- |
private void modeSearch() |
137 |
|
- |
{ |
|
121 |
+ |
private void modeSearch() { |
138 |
122 |
|
mEditing = null; |
139 |
123 |
|
mFE.setMode( FormEngine.Mode.Search ); |
140 |
124 |
|
} |
141 |
125 |
|
|
142 |
|
- |
private void modeEdit( UserView pUserView ) |
143 |
|
- |
{ |
|
126 |
+ |
private void modeEdit( UserView pUserView ) { |
144 |
127 |
|
mEditing = pUserView.getObjectURL(); |
145 |
128 |
|
mFormBinder.setExistingObject( mDataProvider.copyIntoNewTS( pUserView ), FormEngine.Mode.EditFromSearch ); |
146 |
129 |
|
} |
147 |
130 |
|
|
148 |
|
- |
private void modeNew() |
149 |
|
- |
{ |
|
131 |
+ |
private void modeNew() { |
150 |
132 |
|
mEditing = null; |
151 |
133 |
|
mFormBinder.setNewObject( UserView.createNew() ); |
152 |
134 |
|
|
153 |
135 |
|
new DialogViewDialog( new NewUserEmailDialog<UserView>( (String) mFE.getNamedComponentValue( aLogonEmail ), // |
154 |
136 |
|
(String) mFE.getNamedComponentValue( aPhoneNumber ), // |
155 |
137 |
|
this, // |
156 |
|
- |
new QBEinputPanelAccessorFactory<UserView>() |
157 |
|
- |
{ |
158 |
|
- |
@Override public QBEinputPanelAccessor<UserView> createQBEinputPanelAccessor() |
159 |
|
- |
{ |
160 |
|
- |
return new UserFieldsPanel( ClientContext.get().get( CurrentRestrictedResourceViewAccessor.class ).getRestrictedResource(), false ); |
|
138 |
+ |
new QBEinputPanelAccessorFactory<UserView>() { |
|
139 |
+ |
@Override |
|
140 |
+ |
public QBEinputPanelAccessor<UserView> createQBEinputPanelAccessor() { |
|
141 |
+ |
return new UserFieldsPanel( |
|
142 |
+ |
ClientContext.get().get( CurrentRestrictedResourceViewAccessor.class ) |
|
143 |
+ |
.getRestrictedResource(), false ); |
161 |
144 |
|
} |
162 |
145 |
|
} ) ).show(); |
163 |
146 |
|
} |
164 |
147 |
|
|
165 |
148 |
|
@Override |
166 |
|
- |
public void dialogClosed() |
167 |
|
- |
{ |
|
149 |
+ |
public void dialogClosed() { |
168 |
150 |
|
modeSearch(); |
169 |
151 |
|
} |
170 |
152 |
|
|
171 |
153 |
|
@Override |
172 |
|
- |
public void succeeded( String pLogonEmail, UserView pUserView ) |
173 |
|
- |
{ |
174 |
|
- |
if ( pUserView != null ) |
175 |
|
- |
{ |
|
154 |
+ |
public void succeeded( String pLogonEmail, UserView pUserView ) { |
|
155 |
+ |
if ( pUserView != null ) { |
176 |
156 |
|
modeEdit( pUserView ); |
177 |
|
- |
} |
178 |
|
- |
else |
179 |
|
- |
{ |
|
157 |
+ |
} else { |
180 |
158 |
|
mFE.setNamedComponentValueAsUser( aLogonEmail, pLogonEmail ); |
181 |
159 |
|
mFE.setFocus(); |
182 |
160 |
|
} |
183 |
161 |
|
} |
184 |
162 |
|
|
185 |
163 |
|
private static class TableDef extends BoTableDefinition<UserView> implements UserViewNames, |
186 |
|
- |
DataTableStyle |
187 |
|
- |
{ |
188 |
|
- |
public TableDef() |
189 |
|
- |
{ |
|
164 |
+ |
DataTableStyle { |
|
165 |
+ |
public TableDef() { |
190 |
166 |
|
UserViewMetaData zMD = UserViewMetaData.getInstance(); |
191 |
167 |
|
|
192 |
168 |
|
addColumn( zMD.getBoAttribute( aFirstName ), "First" ).initialWidth( FontSizer.get( TABLE_TEXT ).EMsPlus( 12, CELL_PADDING ) ); |