|
@@ -12,18 +12,15 @@ |
12 |
12 |
|
import com.google.gwt.user.client.ui.*; |
13 |
13 |
|
|
14 |
14 |
|
public class RestrictedResourceManagement extends ClickableViewObjectQBEscreenView<RestrictedResourceView> implements RestrictedResourceViewNames, |
15 |
|
- |
ViewUpdatable<RestrictedResourceView> |
16 |
|
- |
{ |
|
15 |
+ |
ViewUpdatable<RestrictedResourceView> { |
17 |
16 |
|
private ObjectURL mEditing = null; |
18 |
17 |
|
|
19 |
18 |
|
@Override |
20 |
|
- |
protected UriFragmentIdParams createRefreshParams() |
21 |
|
- |
{ |
|
19 |
+ |
protected UriFragmentIdParams createRefreshParams() { |
22 |
20 |
|
return RestrictedResourceManagementFactory.encodeParams( mEditing ); |
23 |
21 |
|
} |
24 |
22 |
|
|
25 |
|
- |
public RestrictedResourceManagement( String pSection, ViewDef pViewDef, ObjectURL pEditing ) |
26 |
|
- |
{ |
|
23 |
+ |
public RestrictedResourceManagement( String pSection, ViewDef pViewDef, ObjectURL pEditing ) { |
27 |
24 |
|
super( title( pSection, pViewDef ), RestrictedResourceViewDataProvider.getInstance() ); |
28 |
25 |
|
|
29 |
26 |
|
mEditing = pEditing; |
|
@@ -32,7 +29,8 @@ |
32 |
29 |
|
|
33 |
30 |
|
SizeableQBEboxedPanel zQBEboxedPanel = getQBEboxedPanel(); |
34 |
31 |
|
|
35 |
|
- |
FilteringTableModel<RestrictedResourceView> zFilter = new FilteringTableModel<RestrictedResourceView>( mDataProvider, true, this, this, true ); // Second 'this' allows "New" |
|
32 |
+ |
FilteringTableModel<RestrictedResourceView> zFilter = |
|
33 |
+ |
new FilteringTableModel<RestrictedResourceView>( mDataProvider, true, this, this, true ); // Second 'this' allows "New" |
36 |
34 |
|
RestrictedResourceViewTable zTable = new RestrictedResourceViewTable( zFilter, this ); |
37 |
35 |
|
zQBEboxedPanel.setWidget( zFilter.addReloadable( zTable ) ); |
38 |
36 |
|
|
|
@@ -51,27 +49,21 @@ |
51 |
49 |
|
} |
52 |
50 |
|
|
53 |
51 |
|
@Override |
54 |
|
- |
public void aboutToShow() |
55 |
|
- |
{ |
|
52 |
+ |
public void aboutToShow() { |
56 |
53 |
|
super.aboutToShow(); |
57 |
54 |
|
ObjectURL zEditing = mEditing; |
58 |
55 |
|
modeSearch(); |
59 |
|
- |
if ( zEditing != null ) |
60 |
|
- |
{ |
61 |
|
- |
mDataProvider.requestRow( zEditing, new FetchRowDataProviderCallBack<RestrictedResourceView>() |
62 |
|
- |
{ |
|
56 |
+ |
if ( zEditing != null ) { |
|
57 |
+ |
mDataProvider.requestRow( zEditing, new FetchRowDataProviderCallBack<RestrictedResourceView>() { |
63 |
58 |
|
@Override |
64 |
|
- |
public void success( RestrictedResourceView pRow ) |
65 |
|
- |
{ |
66 |
|
- |
if ( pRow != null ) |
67 |
|
- |
{ |
|
59 |
+ |
public void success( RestrictedResourceView pRow ) { |
|
60 |
+ |
if ( pRow != null ) { |
68 |
61 |
|
modeEdit( pRow ); |
69 |
62 |
|
} |
70 |
63 |
|
} |
71 |
64 |
|
|
72 |
65 |
|
@Override |
73 |
|
- |
public void error( String pError ) |
74 |
|
- |
{ |
|
66 |
+ |
public void error( String pError ) { |
75 |
67 |
|
getStatusMessageSinc().setErrorMessage( pError ); |
76 |
68 |
|
} |
77 |
69 |
|
} ); |
|
@@ -79,46 +71,37 @@ |
79 |
71 |
|
} |
80 |
72 |
|
|
81 |
73 |
|
@Override |
82 |
|
- |
protected void justLoaded() |
83 |
|
- |
{ |
|
74 |
+ |
protected void justLoaded() { |
84 |
75 |
|
super.justLoaded(); |
85 |
76 |
|
mFE.setFocus(); |
86 |
77 |
|
} |
87 |
78 |
|
|
88 |
79 |
|
@Override |
89 |
|
- |
protected void processVO( RestrictedResourceView pRowValue ) |
90 |
|
- |
{ |
91 |
|
- |
if ( pRowValue != null ) |
92 |
|
- |
{ |
|
80 |
+ |
protected void processVO( RestrictedResourceView pRowValue ) { |
|
81 |
+ |
if ( pRowValue != null ) { |
93 |
82 |
|
modeEdit( pRowValue ); |
94 |
|
- |
} |
95 |
|
- |
else |
96 |
|
- |
{ |
|
83 |
+ |
} else { |
97 |
84 |
|
modeNew(); |
98 |
85 |
|
} |
99 |
86 |
|
} |
100 |
87 |
|
|
101 |
|
- |
private void modeSearch() |
102 |
|
- |
{ |
|
88 |
+ |
private void modeSearch() { |
103 |
89 |
|
mEditing = null; |
104 |
90 |
|
mFE.setMode( FormEngine.Mode.Search ); |
105 |
91 |
|
} |
106 |
92 |
|
|
107 |
|
- |
private void modeEdit( RestrictedResourceView pRestrictedResourceView ) |
108 |
|
- |
{ |
|
93 |
+ |
private void modeEdit( RestrictedResourceView pRestrictedResourceView ) { |
109 |
94 |
|
mEditing = pRestrictedResourceView.getObjectURL(); |
110 |
95 |
|
mFormBinder.setExistingObject( mDataProvider.copyIntoNewTS( pRestrictedResourceView ), FormEngine.Mode.EditFromSearch ); |
111 |
96 |
|
} |
112 |
97 |
|
|
113 |
|
- |
private void modeNew() |
114 |
|
- |
{ |
|
98 |
+ |
private void modeNew() { |
115 |
99 |
|
mEditing = null; |
116 |
100 |
|
mFormBinder.setNewObject( RestrictedResourceView.createNew() ); |
117 |
101 |
|
} |
118 |
102 |
|
|
119 |
103 |
|
@Override |
120 |
|
- |
public Widget getBottomBar() |
121 |
|
- |
{ |
|
104 |
+ |
public Widget getBottomBar() { |
122 |
105 |
|
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
123 |
106 |
|
|
124 |
107 |
|
zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
|
@@ -129,8 +112,7 @@ |
129 |
112 |
|
} |
130 |
113 |
|
|
131 |
114 |
|
@Override |
132 |
|
- |
public void viewUpdated( RestrictedResourceView pRestrictedResourceView ) |
133 |
|
- |
{ |
|
115 |
+ |
public void viewUpdated( RestrictedResourceView pRestrictedResourceView ) { |
134 |
116 |
|
modeEdit( pRestrictedResourceView ); |
135 |
117 |
|
} |
136 |
118 |
|
} |