|
@@ -1,76 +1,76 @@ |
1 |
|
- |
package org.litesoft.datt.client.ui.views.admin; |
2 |
|
- |
|
3 |
|
- |
import org.litesoft.GWT.client.view.*; |
4 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
5 |
|
- |
import org.litesoft.GWT.forms.client.*; |
6 |
|
- |
import org.litesoft.bo.views.*; |
7 |
|
- |
import org.litesoft.core.*; |
8 |
|
- |
import org.litesoft.datt.client.accessors.*; |
9 |
|
- |
import org.litesoft.datt.client.boviews.*; |
10 |
|
- |
import org.litesoft.datt.client.ui.widgets.*; |
11 |
|
- |
import org.litesoft.uispecification.*; |
12 |
|
- |
|
13 |
|
- |
import com.google.gwt.user.client.ui.*; |
14 |
|
- |
|
15 |
|
- |
public class RestrictedResourceEditor extends ScreenView implements RestrictedResourceViewNames, |
16 |
|
- |
ViewUpdatable<RestrictedResourceView>, |
17 |
|
- |
FetchRowDataProviderCallBack<RestrictedResourceView> { |
18 |
|
- |
private FormEngine mFE; |
19 |
|
- |
|
20 |
|
- |
private RestrictedResourceViewDataProvider mDataProvider = RestrictedResourceViewDataProvider.getInstance(); |
21 |
|
- |
private FormBinder<RestrictedResourceView> mFormBinder; |
22 |
|
- |
|
23 |
|
- |
@Override |
24 |
|
- |
protected UriFragmentIdParams createRefreshParams() { |
25 |
|
- |
return null; |
26 |
|
- |
} |
27 |
|
- |
|
28 |
|
- |
public RestrictedResourceEditor( String pSection, ViewDef pViewDef ) { |
29 |
|
- |
super( title( pSection, pViewDef ) ); |
30 |
|
- |
|
31 |
|
- |
addStandardTitleBar(); |
32 |
|
- |
|
33 |
|
- |
RestrictedResourceAbstractFieldsPanel zFieldsPanel = new RestrictedResourceFieldsPanel(); |
34 |
|
- |
|
35 |
|
- |
mFE = new FormEngine( zFieldsPanel.createCtrlMap(), FormEngine.Mode.EditRegular, null ); |
36 |
|
- |
mFormBinder = new FormBinder<RestrictedResourceView>( mFE, RestrictedResourceViewMetaData.getInstance() ); |
37 |
|
- |
|
38 |
|
- |
add( new QBEformConstrainingVerticalPanel( zFieldsPanel.initialize( mFE, mFormBinder ), // |
39 |
|
- |
new SizeableSpacer().stretchable() ) ); |
40 |
|
- |
|
41 |
|
- |
add( new SizeableSpacer().stretchable() ); |
42 |
|
- |
|
43 |
|
- |
mDataProvider.requestRow( ClientContext.get().get( CurrentRestrictedResourceViewAccessor.class ).getRestrictedResource().getObjectURL(), this ); |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
@Override |
47 |
|
- |
public void success( RestrictedResourceView pRow ) { |
48 |
|
- |
modeEdit( pRow ); |
49 |
|
- |
} |
50 |
|
- |
|
51 |
|
- |
private void modeEdit( RestrictedResourceView pRestrictedResource ) { |
52 |
|
- |
mFormBinder.setExistingObject( mDataProvider.copyIntoNewTS( pRestrictedResource ), FormEngine.Mode.EditRegular ); |
53 |
|
- |
} |
54 |
|
- |
|
55 |
|
- |
@Override |
56 |
|
- |
public void aboutToShow() { |
57 |
|
- |
super.aboutToShow(); |
58 |
|
- |
mFE.initialize(); |
59 |
|
- |
} |
60 |
|
- |
|
61 |
|
- |
@Override |
62 |
|
- |
public Widget getBottomBar() { |
63 |
|
- |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
64 |
|
- |
|
65 |
|
- |
zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
66 |
|
- |
zActionPanel.addCenter( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mFormBinder, this ) ) ); |
67 |
|
- |
zActionPanel.addRight( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mFormBinder, ViewDef.HOME ) ) ); |
68 |
|
- |
|
69 |
|
- |
return zActionPanel; |
70 |
|
- |
} |
71 |
|
- |
|
72 |
|
- |
@Override |
73 |
|
- |
public void viewUpdated( RestrictedResourceView pRestrictedResourceView ) { |
74 |
|
- |
modeEdit( pRestrictedResourceView ); |
75 |
|
- |
} |
76 |
|
- |
} |
|
1 |
+ |
package org.litesoft.datt.client.ui.views.admin; |
|
2 |
+ |
|
|
3 |
+ |
import org.litesoft.GWT.client.view.*; |
|
4 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
5 |
+ |
import org.litesoft.GWT.forms.client.*; |
|
6 |
+ |
import org.litesoft.bo.views.*; |
|
7 |
+ |
import org.litesoft.core.*; |
|
8 |
+ |
import org.litesoft.datt.client.accessors.*; |
|
9 |
+ |
import org.litesoft.datt.client.boviews.*; |
|
10 |
+ |
import org.litesoft.datt.client.ui.widgets.*; |
|
11 |
+ |
import org.litesoft.uispecification.*; |
|
12 |
+ |
|
|
13 |
+ |
import com.google.gwt.user.client.ui.*; |
|
14 |
+ |
|
|
15 |
+ |
public class RestrictedResourceEditor extends ScreenView implements RestrictedResourceViewNames, |
|
16 |
+ |
ViewUpdatable<RestrictedResourceView>, |
|
17 |
+ |
FetchRowDataProviderCallBack<RestrictedResourceView> { |
|
18 |
+ |
private FormEngine mFE; |
|
19 |
+ |
|
|
20 |
+ |
private RestrictedResourceViewDataProvider mDataProvider = RestrictedResourceViewDataProvider.getInstance(); |
|
21 |
+ |
private FormBinder<RestrictedResourceView> mFormBinder; |
|
22 |
+ |
|
|
23 |
+ |
@Override |
|
24 |
+ |
protected UriFragmentIdParams createRefreshParams() { |
|
25 |
+ |
return null; |
|
26 |
+ |
} |
|
27 |
+ |
|
|
28 |
+ |
public RestrictedResourceEditor( String pSection, ViewDef pViewDef ) { |
|
29 |
+ |
super( title( pSection, pViewDef ) ); |
|
30 |
+ |
|
|
31 |
+ |
addStandardTitleBar(); |
|
32 |
+ |
|
|
33 |
+ |
RestrictedResourceAbstractFieldsPanel zFieldsPanel = new RestrictedResourceFieldsPanel(); |
|
34 |
+ |
|
|
35 |
+ |
mFE = new FormEngine( zFieldsPanel.createCtrlMap(), FormEngine.Mode.EditRegular, null ); |
|
36 |
+ |
mFormBinder = new FormBinder<RestrictedResourceView>( mFE, RestrictedResourceViewMetaData.getInstance() ); |
|
37 |
+ |
|
|
38 |
+ |
add( new QBEformConstrainingVerticalPanel( zFieldsPanel.initialize( mFE, mFormBinder ), // |
|
39 |
+ |
new SizeableSpacer().stretchable() ) ); |
|
40 |
+ |
|
|
41 |
+ |
add( new SizeableSpacer().stretchable() ); |
|
42 |
+ |
|
|
43 |
+ |
mDataProvider.requestRow( ClientContext.get().get( CurrentRestrictedResourceViewAccessor.class ).getRestrictedResource().getObjectURL(), this ); |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
@Override |
|
47 |
+ |
public void success( RestrictedResourceView pRow ) { |
|
48 |
+ |
modeEdit( pRow ); |
|
49 |
+ |
} |
|
50 |
+ |
|
|
51 |
+ |
private void modeEdit( RestrictedResourceView pRestrictedResource ) { |
|
52 |
+ |
mFormBinder.setExistingObject( mDataProvider.copyIntoNewTS( pRestrictedResource ), FormEngine.Mode.EditRegular ); |
|
53 |
+ |
} |
|
54 |
+ |
|
|
55 |
+ |
@Override |
|
56 |
+ |
public void aboutToShow() { |
|
57 |
+ |
super.aboutToShow(); |
|
58 |
+ |
mFE.initialize(); |
|
59 |
+ |
} |
|
60 |
+ |
|
|
61 |
+ |
@Override |
|
62 |
+ |
public Widget getBottomBar() { |
|
63 |
+ |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
|
64 |
+ |
|
|
65 |
+ |
zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
|
66 |
+ |
zActionPanel.addCenter( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mFormBinder, this ) ) ); |
|
67 |
+ |
zActionPanel.addRight( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mFormBinder, ViewDef.HOME ) ) ); |
|
68 |
+ |
|
|
69 |
+ |
return zActionPanel; |
|
70 |
+ |
} |
|
71 |
+ |
|
|
72 |
+ |
@Override |
|
73 |
+ |
public void viewUpdated( RestrictedResourceView pRestrictedResourceView ) { |
|
74 |
+ |
modeEdit( pRestrictedResourceView ); |
|
75 |
+ |
} |
|
76 |
+ |
} |