litesoft
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
|
package org.litesoft.datt.client.ui.views;
import org.litesoft.GWT.client.view.*;
import org.litesoft.GWT.client.widgets.*;
import org.litesoft.GWT.client.widgets.datatables.*;
import org.litesoft.GWT.forms.client.*;
import org.litesoft.core.util.*;
import org.litesoft.datt.client.*;
import org.litesoft.datt.client.boviews.*;
import org.litesoft.datt.client.ui.widgets.*;
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 RestrictedResourcePickerDialog extends QBEdialogView<RestrictedResourceView> implements RestrictedResourceViewNames
{
private RestrictedResourceSwitcher.CallBack mCallBack;
private FormBinder<RestrictedResourceView> mFormBinder;
private RestrictedResourceView mSelected = null;
public RestrictedResourcePickerDialog( Opaqueness pOpaqueness, RestrictedResourceSwitcher.CallBack pCallBack )
{
super( pOpaqueness, RestrictedResourceViewDataProvider.getInstance() );
UtilsCommon.assertNotNull( "CallBack", mCallBack = pCallBack );
setViewTitle( "Select Project" );
SizeableQBEboxedPanel zQBEboxedPanel = mQBEscreenSupport.getQBEboxedPanel();
FilteringTableModel<RestrictedResourceView> zFilter = new FilteringTableModel<RestrictedResourceView>( mDataProvider, true, this, null, false ); // Second 'this' allows auto "New"
RestrictedResourceViewTable zTable = new RestrictedResourceViewTable( zFilter, this );
zQBEboxedPanel.setWidget( zFilter.addReloadable( zTable ) );
AbstractRestrictedResourceFieldsPanel zFieldsPanel = new RestrictedResourcePickerFieldsPanel();
mFE = new QBE_FormEngine( zFieldsPanel.createCtrlMap(), null, zQBEboxedPanel, zFilter, zFilter );
mFormBinder = new FormBinder<RestrictedResourceView>( mFE, RestrictedResourceViewMetaData.getInstance() );
add( mFE.createSectionTitle( "Project" ) );
add( zFieldsPanel.initialize( mFE, mFormBinder ) );
add( new SizeableSpacer().stretchable() );
mFE.setPointerWidget( zFieldsPanel.getPointerField() );
}
@Override
protected void processVO( RestrictedResourceView 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( View ).enable( View ), pButtonBase );
}
}
|
Revision |
Author |
Commited |
Message |
430
|
GeorgeS
|
Sat 20 Aug, 2011 19:46:21 +0000 |
|