|
@@ -14,15 +14,14 @@ |
14 |
14 |
|
import static org.litesoft.uispecification.FormWidgetAspectCtrl.*; |
15 |
15 |
|
import static org.litesoft.uispecification.FormWidgetCtrl.*; |
16 |
16 |
|
|
17 |
|
- |
public class RestrictedResourcePickerDialogFactory<T extends SecurityRestrictedResourceView<T>> implements RestrictedResourcePickerDialogViewFactory |
18 |
|
- |
{ |
|
17 |
+ |
public class RestrictedResourcePickerDialogFactory<T extends SecurityRestrictedResourceView<T>> implements RestrictedResourcePickerDialogViewFactory { |
19 |
18 |
|
private String mTitle; |
20 |
19 |
|
private VoDataProvider<T> mDataProvider; |
21 |
20 |
|
private VoMetaData<T> mVoMetaData; |
22 |
21 |
|
private RestrictedResourceViewSupportFactory<T> mSupportFactory; |
23 |
22 |
|
|
24 |
|
- |
public RestrictedResourcePickerDialogFactory( String pTitle, VoDataProvider<T> pDataProvider, VoMetaData<T> pVoMetaData, RestrictedResourceViewSupportFactory<T> pSupportFactory ) |
25 |
|
- |
{ |
|
23 |
+ |
public RestrictedResourcePickerDialogFactory( String pTitle, VoDataProvider<T> pDataProvider, VoMetaData<T> pVoMetaData, |
|
24 |
+ |
RestrictedResourceViewSupportFactory<T> pSupportFactory ) { |
26 |
25 |
|
mTitle = pTitle; |
27 |
26 |
|
mDataProvider = pDataProvider; |
28 |
27 |
|
mVoMetaData = pVoMetaData; |
|
@@ -30,19 +29,17 @@ |
30 |
29 |
|
} |
31 |
30 |
|
|
32 |
31 |
|
@Override |
33 |
|
- |
public DialogView createDialog( Dialog.Opaqueness pOpaqueness, RestrictedResourceSwitcherCallBack pCallBack ) |
34 |
|
- |
{ |
|
32 |
+ |
public DialogView createDialog( Dialog.Opaqueness pOpaqueness, RestrictedResourceSwitcherCallBack pCallBack ) { |
35 |
33 |
|
return new RestrictedResourcePickerDialog( mTitle, pOpaqueness, mDataProvider, mVoMetaData, mSupportFactory, pCallBack ); |
36 |
34 |
|
} |
37 |
35 |
|
|
38 |
|
- |
private static class RestrictedResourcePickerDialog<T extends SecurityRestrictedResourceView<T>> extends QBEdialogView<T> |
39 |
|
- |
{ |
|
36 |
+ |
private static class RestrictedResourcePickerDialog<T extends SecurityRestrictedResourceView<T>> extends QBEdialogView<T> { |
40 |
37 |
|
private RestrictedResourceSwitcherCallBack mCallBack; |
41 |
38 |
|
private FormBinder<T> mFormBinder; |
42 |
39 |
|
private T mSelected = null; |
43 |
40 |
|
|
44 |
|
- |
public RestrictedResourcePickerDialog( String pTitle, Opaqueness pOpaqueness, VoDataProvider<T> pDataProvider, VoMetaData<T> pVoMetaData, RestrictedResourceViewSupportFactory<T> pSupportFactory, RestrictedResourceSwitcherCallBack pCallBack ) |
45 |
|
- |
{ |
|
41 |
+ |
public RestrictedResourcePickerDialog( String pTitle, Opaqueness pOpaqueness, VoDataProvider<T> pDataProvider, VoMetaData<T> pVoMetaData, |
|
42 |
+ |
RestrictedResourceViewSupportFactory<T> pSupportFactory, RestrictedResourceSwitcherCallBack pCallBack ) { |
46 |
43 |
|
super( title( pTitle ), pOpaqueness, pDataProvider ); |
47 |
44 |
|
|
48 |
45 |
|
Objects.assertNotNull( "CallBack", mCallBack = pCallBack ); |
|
@@ -66,32 +63,26 @@ |
66 |
63 |
|
} |
67 |
64 |
|
|
68 |
65 |
|
@Override |
69 |
|
- |
protected void processVO( T pRowValue ) |
70 |
|
- |
{ |
71 |
|
- |
if ( pRowValue != null ) |
72 |
|
- |
{ |
|
66 |
+ |
protected void processVO( T pRowValue ) { |
|
67 |
+ |
if ( pRowValue != null ) { |
73 |
68 |
|
mFormBinder.setExistingObject( mSelected = pRowValue, FormEngine.Mode.ViewFromSearch ); |
74 |
69 |
|
} |
75 |
70 |
|
} |
76 |
71 |
|
|
77 |
72 |
|
@Override |
78 |
|
- |
protected void modeSearch() |
79 |
|
- |
{ |
|
73 |
+ |
protected void modeSearch() { |
80 |
74 |
|
mSelected = null; |
81 |
75 |
|
mFE.setMode( FormEngine.Mode.Search ); |
82 |
76 |
|
} |
83 |
77 |
|
|
84 |
78 |
|
@Override |
85 |
|
- |
public Widget getBottomBar() |
86 |
|
- |
{ |
|
79 |
+ |
public Widget getBottomBar() { |
87 |
80 |
|
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
88 |
81 |
|
|
89 |
82 |
|
zActionPanel.addLeft( createCancelButton() ); |
90 |
|
- |
zActionPanel.addRight( addViewEnabledButton( SelectButton.factory().add( new ClickHandler() |
91 |
|
- |
{ |
|
83 |
+ |
zActionPanel.addRight( addViewEnabledButton( SelectButton.factory().add( new ClickHandler() { |
92 |
84 |
|
@Override |
93 |
|
- |
public void onClick( ClickEvent event ) |
94 |
|
- |
{ |
|
85 |
+ |
public void onClick( ClickEvent event ) { |
95 |
86 |
|
close(); |
96 |
87 |
|
|
97 |
88 |
|
mCallBack.switchToRestrictedResource( mSelected ); |
|
@@ -101,8 +92,7 @@ |
101 |
92 |
|
return zActionPanel; |
102 |
93 |
|
} |
103 |
94 |
|
|
104 |
|
- |
protected ButtonBase addViewEnabledButton( ButtonBase pButtonBase ) |
105 |
|
- |
{ |
|
95 |
+ |
protected ButtonBase addViewEnabledButton( ButtonBase pButtonBase ) { |
106 |
96 |
|
return mFE.addButton( Visible( Yes ).enable( View ), pButtonBase ); |
107 |
97 |
|
} |
108 |
98 |
|
} |