litesoft
@ 950
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 96 97 98 99 |
package org.litesoft.GWT.client.view; import org.litesoft.GWT.client.*; import org.litesoft.GWT.client.widgets.*; import org.litesoft.GWT.client.widgets.datatables.*; import org.litesoft.GWT.forms.client.*; import org.litesoft.bo.views.*; import org.litesoft.commonfoundation.base.*; import org.litesoft.security.*; import com.google.gwt.event.dom.client.*; import com.google.gwt.user.client.ui.*; import static org.litesoft.uispecification.FormWidgetAspectCtrl.*; import static org.litesoft.uispecification.FormWidgetCtrl.*; public class RestrictedResourcePickerDialogFactory<T extends SecurityRestrictedResourceView<T>> implements RestrictedResourcePickerDialogViewFactory { private String mTitle; private VoDataProvider<T> mDataProvider; private VoMetaData<T> mVoMetaData; private RestrictedResourceViewSupportFactory<T> mSupportFactory; public RestrictedResourcePickerDialogFactory( String pTitle, VoDataProvider<T> pDataProvider, VoMetaData<T> pVoMetaData, RestrictedResourceViewSupportFactory<T> pSupportFactory ) { mTitle = pTitle; mDataProvider = pDataProvider; mVoMetaData = pVoMetaData; mSupportFactory = pSupportFactory; } @Override public DialogView createDialog( Dialog.Opaqueness pOpaqueness, RestrictedResourceSwitcherCallBack pCallBack ) { return new RestrictedResourcePickerDialog( mTitle, pOpaqueness, mDataProvider, mVoMetaData, mSupportFactory, pCallBack ); } private static class RestrictedResourcePickerDialog<T extends SecurityRestrictedResourceView<T>> extends QBEdialogView<T> { private RestrictedResourceSwitcherCallBack mCallBack; private FormBinder<T> mFormBinder; private T mSelected = null; public RestrictedResourcePickerDialog( String pTitle, Opaqueness pOpaqueness, VoDataProvider<T> pDataProvider, VoMetaData<T> pVoMetaData, RestrictedResourceViewSupportFactory<T> pSupportFactory, RestrictedResourceSwitcherCallBack pCallBack ) { super( title( pTitle ), pOpaqueness, pDataProvider ); Confirm.isNotNull( "CallBack", mCallBack = pCallBack ); SizeableQBEboxedPanel zQBEboxedPanel = mQBEscreenSupport.getQBEboxedPanel(); FilteringTableModel<T> zFilter = new FilteringTableModel<T>( mDataProvider, true, this, null, false ); // Second 'this' allows auto "New" zQBEboxedPanel.setWidget( zFilter.addReloadable( pSupportFactory.createTable( zFilter, this ) ) ); QBEinputPanelAccessorWithCtrlMap<T> zFieldsPanel = pSupportFactory.createFieldPanel(); mFE = new QBE_FormEngine( zFieldsPanel.createCtrlMap(), null, zQBEboxedPanel, zFilter, zFilter ); mFormBinder = new FormBinder<T>( mFE, pVoMetaData ); add( mFE.createSectionTitle( "Queue" ) ); add( zFieldsPanel.initialize( mFE, mFormBinder ) ); add( new SizeableSpacer().stretchable() ); mFE.setPointerWidget( zFieldsPanel.getPointerField() ); } @Override protected void processVO( T pRowValue ) { if ( pRowValue != null ) { mFormBinder.setExistingObject( mSelected = pRowValue, FormEngine.Mode.ViewFromSearch ); } } @Override protected void modeSearch() { mSelected = null; mFE.setMode( FormEngine.Mode.Search ); } @Override public Widget getBottomBar() { LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); zActionPanel.addLeft( createCancelButton() ); zActionPanel.addRight( addViewEnabledButton( SelectButton.factory().add( new ClickHandler() { @Override public void onClick( ClickEvent event ) { close(); mCallBack.switchToRestrictedResource( mSelected ); } } ).create() ) ); return zActionPanel; } protected ButtonBase addViewEnabledButton( ButtonBase pButtonBase ) { return mFE.addButton( Visible( Yes ).enable( View ), pButtonBase ); } } } |
Commits for litesoft/trunk/Java/GWT/Client/src/org/litesoft/GWT/client/view/RestrictedResourcePickerDialogFactory.java
Revision | Author | Commited | Message |
---|---|---|---|
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 |
939 Diff | GeorgeS | Mon 02 Jun, 2014 21:30:31 +0000 | Extracting commonfoundation |
804 Diff | GeorgeS | Wed 15 Aug, 2012 12:48:51 +0000 | |
489 | GeorgeS | Fri 09 Sep, 2011 12:03:04 +0000 | Prioritizer Dup code minimized |