Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/GWT_Sandbox/Prioritizer/src/org/litesoft/prioritizer/client/ui/views/stories/Stories.java

Diff revisions: vs.
  @@ -15,18 +15,15 @@
15 15 import static org.litesoft.uispecification.FormWidgetCtrl.*;
16 16
17 17 public class Stories extends ClickableViewObjectQBEscreenView<StoryView> implements StoryViewNames,
18 - ViewUpdatable<StoryView>
19 - {
18 + ViewUpdatable<StoryView> {
20 19 private ObjectURL mEditing = null;
21 20
22 21 @Override
23 - protected UriFragmentIdParams createRefreshParams()
24 - {
22 + protected UriFragmentIdParams createRefreshParams() {
25 23 return StoriesFactory.encodeParams( mEditing );
26 24 }
27 25
28 - public Stories( String pSection, ViewDef pViewDef, ObjectURL pEditing )
29 - {
26 + public Stories( String pSection, ViewDef pViewDef, ObjectURL pEditing ) {
30 27 super( title( pSection, pViewDef ), StoryViewDataProvider.getInstance() );
31 28
32 29 mEditing = pEditing;
  @@ -60,27 +57,21 @@
60 57 }
61 58
62 59 @Override
63 - public void aboutToShow()
64 - {
60 + public void aboutToShow() {
65 61 super.aboutToShow();
66 62 ObjectURL zEditing = mEditing;
67 63 modeSearch();
68 - if ( zEditing != null )
69 - {
70 - mDataProvider.requestRow( zEditing, new FetchRowDataProviderCallBack<StoryView>()
71 - {
64 + if ( zEditing != null ) {
65 + mDataProvider.requestRow( zEditing, new FetchRowDataProviderCallBack<StoryView>() {
72 66 @Override
73 - public void success( StoryView pRow )
74 - {
75 - if ( pRow != null )
76 - {
67 + public void success( StoryView pRow ) {
68 + if ( pRow != null ) {
77 69 modeEdit( pRow );
78 70 }
79 71 }
80 72
81 73 @Override
82 - public void error( String pError )
83 - {
74 + public void error( String pError ) {
84 75 getStatusMessageSinc().setErrorMessage( pError );
85 76 }
86 77 } );
  @@ -88,28 +79,22 @@
88 79 }
89 80
90 81 @Override
91 - protected void justLoaded()
92 - {
82 + protected void justLoaded() {
93 83 super.justLoaded();
94 84 mFE.setFocus();
95 85 }
96 86
97 87 @Override
98 - protected void processVO( StoryView pRowValue )
99 - {
100 - if ( pRowValue != null )
101 - {
88 + protected void processVO( StoryView pRowValue ) {
89 + if ( pRowValue != null ) {
102 90 modeEdit( pRowValue );
103 - }
104 - else
105 - {
91 + } else {
106 92 modeNew();
107 93 }
108 94 }
109 95
110 96 @Override
111 - public Widget getBottomBar()
112 - {
97 + public Widget getBottomBar() {
113 98 LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel();
114 99
115 100 zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) );
  @@ -120,25 +105,21 @@
120 105 }
121 106
122 107 @Override
123 - public void viewUpdated( StoryView pStoryView )
124 - {
108 + public void viewUpdated( StoryView pStoryView ) {
125 109 modeEdit( pStoryView );
126 110 }
127 111
128 - private void modeSearch()
129 - {
112 + private void modeSearch() {
130 113 mEditing = null;
131 114 mFE.setMode( FormEngine.Mode.Search );
132 115 }
133 116
134 - private void modeEdit( StoryView pStoryView )
135 - {
117 + private void modeEdit( StoryView pStoryView ) {
136 118 mEditing = pStoryView.getObjectURL();
137 119 mFormBinder.setExistingObject( mDataProvider.copyIntoNewTS( pStoryView ), FormEngine.Mode.EditFromSearch );
138 120 }
139 121
140 - private void modeNew()
141 - {
122 + private void modeNew() {
142 123 mEditing = null;
143 124 mFormBinder.setNewObject( StoryView.createNew() );
144 125 // mFE.setNamedComponentValueAsStory( aLogonEmail, pLogonEmail );
  @@ -146,39 +127,34 @@
146 127 }
147 128
148 129 private static class TableDef extends BoTableDefinition<StoryView> implements StoryViewNames,
149 - DataTableStyle
150 - {
151 - public TableDef()
152 - {
130 + DataTableStyle {
131 + public TableDef() {
153 132 StoryViewMetaData zMD = StoryViewMetaData.getInstance();
154 133
155 134 addColumn( zMD.getBoAttribute( aName ) ); // .initialWidth( FontSizer.get( TABLE_TEXT ).EMsPlus( 20, CELL_PADDING ) );
156 135 addColumn( zMD.getBoAttribute( aDescriptionThreeLines ), "Description" ); // .initialWidth( FontSizer.get( TABLE_TEXT ).EMsPlus( 40, CELL_PADDING ) );
157 136 addColumn( zMD.getBoAttribute( aIsDone ), "Done" ).initialWidth( FontSizer.get( TABLE_TEXT ).EMsPlus( 4, CELL_PADDING ) );
158 137 addColumn( zMD.getBoAttribute( aPriorityToDisplay ), "Priority" ); // .initialWidth( FontSizer.get( TABLE_TEXT ).EMsPlus( 20, CELL_PADDING ) );
159 - addColumn( zMD.getBoAttribute( aPriorityLastChangedBy ), "Prioritized By" ); // .initialWidth( FontSizer.get( TABLE_TEXT ).EMsPlus( 20, CELL_PADDING ) );
138 + addColumn( zMD.getBoAttribute( aPriorityLastChangedBy ),
139 + "Prioritized By" ); // .initialWidth( FontSizer.get( TABLE_TEXT ).EMsPlus( 20, CELL_PADDING ) );
160 140 }
161 141 }
162 142
163 - private static class StoryFieldsPanel extends SizeableVerticalSplitPairPanel implements StoryViewNames
164 - {
143 + private static class StoryFieldsPanel extends SizeableVerticalSplitPairPanel implements StoryViewNames {
165 144 private Widget mPointerField;
166 145
167 - public Widget getPointerField()
168 - {
146 + public Widget getPointerField() {
169 147 return mPointerField;
170 148 }
171 149
172 - public StoryFieldsPanel( FormBinder<StoryView> pFB )
173 - {
150 + public StoryFieldsPanel( FormBinder<StoryView> pFB ) {
174 151 stretchable();
175 152
176 153 add( createUpperWidget( pFB ) );
177 154 add( createLowerWidget( pFB ) );
178 155 }
179 156
180 - private Widget createUpperWidget( FormBinder<StoryView> pFB )
181 - {
157 + private Widget createUpperWidget( FormBinder<StoryView> pFB ) {
182 158 SizeableVerticalPanel zPanel = new SizeableVerticalPanel().stretchable();
183 159
184 160 zPanel.add( createNamePlus( pFB ) );
  @@ -187,8 +163,7 @@
187 163 return zPanel;
188 164 }
189 165
190 - private Widget createNamePlus( FormBinder<StoryView> pFB )
191 - {
166 + private Widget createNamePlus( FormBinder<StoryView> pFB ) {
192 167 SizeableHorizontalPanel zPanel = new SizeableHorizontalPanel().stretchableHorizontally();
193 168
194 169 zPanel.add( mPointerField = pFB.add( aName ) );
  @@ -198,8 +173,7 @@
198 173 return zPanel;
199 174 }
200 175
201 - private Widget createDoneWidget( FormBinder<StoryView> pFB )
202 - {
176 + private Widget createDoneWidget( FormBinder<StoryView> pFB ) {
203 177 VerticalPanel zPanel = new VerticalPanel();
204 178
205 179 zPanel.add( pFB.add( aShowDone ) );
  @@ -208,8 +182,7 @@
208 182 return zPanel;
209 183 }
210 184
211 - private Widget createLowerWidget( FormBinder<StoryView> pFB )
212 - {
185 + private Widget createLowerWidget( FormBinder<StoryView> pFB ) {
213 186 SizeableVerticalPanel zPanel = new SizeableVerticalPanel().stretchable();
214 187
215 188 zPanel.add( pFB.add( aChanges ) );
  @@ -218,8 +191,7 @@
218 191 return zPanel;
219 192 }
220 193
221 - private Widget createMiscWidget( FormBinder<StoryView> pFB )
222 - {
194 + private Widget createMiscWidget( FormBinder<StoryView> pFB ) {
223 195 SizeableHorizontalPanel zPanel = new SizeableHorizontalPanel().stretchableHorizontally();
224 196
225 197 zPanel.add( pFB.add( aCreatorFullName, "Created By" ) );