|
@@ -1,77 +1,77 @@ |
1 |
|
- |
package org.litesoft.GWT.client.view; |
2 |
|
- |
|
3 |
|
- |
import org.litesoft.GWT.client.*; |
4 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
5 |
|
- |
import org.litesoft.GWT.forms.client.*; |
6 |
|
- |
import org.litesoft.bo.views.*; |
7 |
|
- |
import org.litesoft.commonfoundation.typeutils.*; |
8 |
|
- |
import org.litesoft.core.util.*; |
9 |
|
- |
import org.litesoft.security.*; |
10 |
|
- |
|
11 |
|
- |
import com.google.gwt.user.client.ui.*; |
12 |
|
- |
|
13 |
|
- |
public class NewUserConfirmDialog<T extends SecurityUserView<T>> extends AbstractNewUserDialog<T> { |
14 |
|
- |
public interface CallBack extends DialogCloseCallBack { |
15 |
|
- |
public void succeeded(); |
16 |
|
- |
} |
17 |
|
- |
|
18 |
|
- |
private FormBinder<T> mFormBinder; |
19 |
|
- |
private CallBack mCallBack; |
20 |
|
- |
|
21 |
|
- |
public NewUserConfirmDialog( String pLogonEmail, String pPhoneNumber, T pUserView, CallBack pCallBack, |
22 |
|
- |
QBEinputPanelAccessorFactory<T> pUserFieldsPanelFactory ) { |
23 |
|
- |
super( title( "Confirm User" ), pLogonEmail, pPhoneNumber, pUserView, pUserFieldsPanelFactory ); |
24 |
|
- |
Objects.assertNotNull( "CallBack", mCallBack = pCallBack ); |
25 |
|
- |
|
26 |
|
- |
mFormBinder = new FormBinder<T>( mFE, mUserViewMetaData ); |
27 |
|
- |
|
28 |
|
- |
add( new SizeableSpacer( 5 ).stretchable() ); |
29 |
|
- |
add( pUserFieldsPanelFactory.createQBEinputPanelAccessor().initialize( mFE, mFormBinder ) ); |
30 |
|
- |
add( new SizeableSpacer().stretchable() ); |
31 |
|
- |
} |
32 |
|
- |
|
33 |
|
- |
@Override |
34 |
|
- |
public void aboutToShow() { |
35 |
|
- |
super.aboutToShow(); |
36 |
|
- |
mFE.initialize(); |
37 |
|
- |
} |
38 |
|
- |
|
39 |
|
- |
@Override |
40 |
|
- |
protected void justLoaded() { |
41 |
|
- |
super.justLoaded(); |
42 |
|
- |
mFormBinder.setExistingObject( mUserView, FormEngine.Mode.ViewRegular ); |
43 |
|
- |
mFE.setFocus(); |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
@Override |
47 |
|
- |
protected void submitRequested() { |
48 |
|
- |
T zView = mUserView.copyInto( mDataProvider.createTransactionSet() ); |
49 |
|
- |
zView.setVisibleToCurrentRestrictedResource( Boolean.TRUE ); |
50 |
|
- |
mDataProvider.commit( zView, new CommitCallBack<T>() { |
51 |
|
- |
@Override |
52 |
|
- |
public void success( ImmutableArrayList<T> pRows ) { |
53 |
|
- |
close(); |
54 |
|
- |
mCallBack.succeeded(); |
55 |
|
- |
} |
56 |
|
- |
|
57 |
|
- |
@Override |
58 |
|
- |
public void error( String pError ) { |
59 |
|
- |
setDialogErrorMessage( pError ); |
60 |
|
- |
} |
61 |
|
- |
} ); |
62 |
|
- |
} |
63 |
|
- |
|
64 |
|
- |
@Override |
65 |
|
- |
public void cancel() { |
66 |
|
- |
super.cancel(); |
67 |
|
- |
mCallBack.dialogClosed(); |
68 |
|
- |
} |
69 |
|
- |
|
70 |
|
- |
@Override |
71 |
|
- |
public Widget getBottomBar() { |
72 |
|
- |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
73 |
|
- |
zActionPanel.addLeft( createCancelButton() ); |
74 |
|
- |
zActionPanel.addRight( createSubmitButton() ); |
75 |
|
- |
return zActionPanel; |
76 |
|
- |
} |
77 |
|
- |
} |
|
1 |
+ |
package org.litesoft.GWT.client.view; |
|
2 |
+ |
|
|
3 |
+ |
import org.litesoft.GWT.client.*; |
|
4 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
5 |
+ |
import org.litesoft.GWT.forms.client.*; |
|
6 |
+ |
import org.litesoft.bo.views.*; |
|
7 |
+ |
import org.litesoft.commonfoundation.base.*; |
|
8 |
+ |
import org.litesoft.core.util.*; |
|
9 |
+ |
import org.litesoft.security.*; |
|
10 |
+ |
|
|
11 |
+ |
import com.google.gwt.user.client.ui.*; |
|
12 |
+ |
|
|
13 |
+ |
public class NewUserConfirmDialog<T extends SecurityUserView<T>> extends AbstractNewUserDialog<T> { |
|
14 |
+ |
public interface CallBack extends DialogCloseCallBack { |
|
15 |
+ |
public void succeeded(); |
|
16 |
+ |
} |
|
17 |
+ |
|
|
18 |
+ |
private FormBinder<T> mFormBinder; |
|
19 |
+ |
private CallBack mCallBack; |
|
20 |
+ |
|
|
21 |
+ |
public NewUserConfirmDialog( String pLogonEmail, String pPhoneNumber, T pUserView, CallBack pCallBack, |
|
22 |
+ |
QBEinputPanelAccessorFactory<T> pUserFieldsPanelFactory ) { |
|
23 |
+ |
super( title( "Confirm User" ), pLogonEmail, pPhoneNumber, pUserView, pUserFieldsPanelFactory ); |
|
24 |
+ |
Confirm.isNotNull( "CallBack", mCallBack = pCallBack ); |
|
25 |
+ |
|
|
26 |
+ |
mFormBinder = new FormBinder<T>( mFE, mUserViewMetaData ); |
|
27 |
+ |
|
|
28 |
+ |
add( new SizeableSpacer( 5 ).stretchable() ); |
|
29 |
+ |
add( pUserFieldsPanelFactory.createQBEinputPanelAccessor().initialize( mFE, mFormBinder ) ); |
|
30 |
+ |
add( new SizeableSpacer().stretchable() ); |
|
31 |
+ |
} |
|
32 |
+ |
|
|
33 |
+ |
@Override |
|
34 |
+ |
public void aboutToShow() { |
|
35 |
+ |
super.aboutToShow(); |
|
36 |
+ |
mFE.initialize(); |
|
37 |
+ |
} |
|
38 |
+ |
|
|
39 |
+ |
@Override |
|
40 |
+ |
protected void justLoaded() { |
|
41 |
+ |
super.justLoaded(); |
|
42 |
+ |
mFormBinder.setExistingObject( mUserView, FormEngine.Mode.ViewRegular ); |
|
43 |
+ |
mFE.setFocus(); |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
@Override |
|
47 |
+ |
protected void submitRequested() { |
|
48 |
+ |
T zView = mUserView.copyInto( mDataProvider.createTransactionSet() ); |
|
49 |
+ |
zView.setVisibleToCurrentRestrictedResource( Boolean.TRUE ); |
|
50 |
+ |
mDataProvider.commit( zView, new CommitCallBack<T>() { |
|
51 |
+ |
@Override |
|
52 |
+ |
public void success( ImmutableArrayList<T> pRows ) { |
|
53 |
+ |
close(); |
|
54 |
+ |
mCallBack.succeeded(); |
|
55 |
+ |
} |
|
56 |
+ |
|
|
57 |
+ |
@Override |
|
58 |
+ |
public void error( String pError ) { |
|
59 |
+ |
setDialogErrorMessage( pError ); |
|
60 |
+ |
} |
|
61 |
+ |
} ); |
|
62 |
+ |
} |
|
63 |
+ |
|
|
64 |
+ |
@Override |
|
65 |
+ |
public void cancel() { |
|
66 |
+ |
super.cancel(); |
|
67 |
+ |
mCallBack.dialogClosed(); |
|
68 |
+ |
} |
|
69 |
+ |
|
|
70 |
+ |
@Override |
|
71 |
+ |
public Widget getBottomBar() { |
|
72 |
+ |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
|
73 |
+ |
zActionPanel.addLeft( createCancelButton() ); |
|
74 |
+ |
zActionPanel.addRight( createSubmitButton() ); |
|
75 |
+ |
return zActionPanel; |
|
76 |
+ |
} |
|
77 |
+ |
} |