litesoft
@ 957
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
package org.litesoft.GWT.client.view; import org.litesoft.GWT.client.*; import org.litesoft.GWT.client.widgets.*; import org.litesoft.bo.views.*; import org.litesoft.commonfoundation.base.*; import org.litesoft.core.util.*; import org.litesoft.security.*; import com.google.gwt.user.client.ui.*; public class NewUserEmailDialog<T extends SecurityUserView<T>> extends AbstractNewUserDialog<T> implements NewUserPhoneConfirmationDialog.CallBack { public interface CallBack<T extends SecurityUserView<T>> extends DialogCloseCallBack { public void succeeded( String pLogonEmail, T pUserView ); } private CallBack mCallBack; public NewUserEmailDialog( String pLogonEmail, String pPhoneNumber, CallBack pCallBack, QBEinputPanelAccessorFactory<T> pUserFieldsPanelFactory ) { super( title( "New User" ), pLogonEmail, pPhoneNumber, null, pUserFieldsPanelFactory ); Confirm.isNotNull( "CallBack", mCallBack = pCallBack ); initializeFormInfrastructure( null ); add( new SizeableSpacer( 5 ).stretchable() ); add( createLogonEmail() ); add( new SizeableSpacer( 5 ).stretchable() ); } @Override public void aboutToShow() { super.aboutToShow(); mFE.setNamedComponentValueAsUser( SecurityUserViewNames.aLogonEmail, mLogonEmail ); } private Widget createLogonEmail() { return mFormBinder.add( SecurityUserViewNames.aLogonEmail ); } @Override protected void submitRequested() { String zLogonEmail = ConstrainTo.significantOrNull( (String) mFE.getNamedComponentValue( SecurityUserViewNames.aLogonEmail ) ); if ( zLogonEmail != null ) { mDataProvider.validateLogonEmailAvailable( zLogonEmail, new FetchRowDataProviderCallBack<SecurityUserView>() { @Override public void error( String pError ) { setDialogErrorMessage( pError ); } @Override public void success( SecurityUserView pRow ) { if ( pRow == null ) // No row found, Go on to Add User { close(); mCallBack.succeeded( (String) mFE.getNamedComponentValue( SecurityUserViewNames.aLogonEmail ), null ); return; } if ( mPhoneNumber.equals( pRow.getPhoneNumber() ) ) // User found with same Logon & same entered PhoneNumber: Go on to Add User { close(); mCallBack.succeeded( (String) mFE.getNamedComponentValue( SecurityUserViewNames.aLogonEmail ), pRow ); return; } mUserView = (T) pRow; new DialogViewDialog( new NewUserPhoneConfirmationDialog( mLogonEmail, mPhoneNumber, mUserView, NewUserEmailDialog.this, mUserFieldsPanelFactory ) ).show(); } } ); } } @Override public void succeeded() { close(); mCallBack.succeeded( (String) mFE.getNamedComponentValue( SecurityUserViewNames.aLogonEmail ), mUserView ); } @Override public void cancel() { super.cancel(); mCallBack.dialogClosed(); } protected static String cursoryEmailCheck( String pEmail, String pWhat ) { try { new EmailAddress( pEmail ); return null; } catch ( IllegalArgumentException e ) { return DeCamelizer.resolve( pWhat ) + " is unacceptable: " + e.getMessage(); } } } |
Commits for litesoft/trunk/Java/GWT/Client/src/org/litesoft/GWT/client/view/NewUserEmailDialog.java
Revision | Author | Commited | Message |
---|---|---|---|
957 Diff | GeorgeS | Tue 24 Jun, 2014 12:30:01 +0000 | Dialog Code Shareing |
950 Diff | GeorgeS | Thu 19 Jun, 2014 17:57:04 +0000 | New Lines |
948 Diff | GeorgeS | Sat 07 Jun, 2014 23:42:39 +0000 | Jusefuls Formatter Updated to New Code Format |
942 Diff | GeorgeS | Mon 02 Jun, 2014 23:41:46 +0000 | Extracting commonfoundation |
939 Diff | GeorgeS | Mon 02 Jun, 2014 21:30:31 +0000 | Extracting commonfoundation |
804 Diff | GeorgeS | Wed 15 Aug, 2012 12:48:51 +0000 | |
801 Diff | GeorgeS | Wed 15 Aug, 2012 03:59:02 +0000 | |
487 Diff | GeorgeS | Thu 08 Sep, 2011 12:06:30 +0000 | More elimination of uniqueness |
486 Diff | GeorgeS | Tue 06 Sep, 2011 03:00:59 +0000 | |
480 | GeorgeS | Sun 04 Sep, 2011 02:38:20 +0000 | Progress on common User Support... |