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