Subversion Repository Public Repository

litesoft

Diff Revisions 539 vs 948 for /trunk/Java/DATT/src/org/litesoft/datt/client/ui/views/admin/Users.java

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