|
@@ -1,147 +1,147 @@ |
1 |
|
- |
package org.litesoft.datt.client.ui.views.stories; |
2 |
|
- |
|
3 |
|
- |
import org.litesoft.GWT.client.view.*; |
4 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
5 |
|
- |
import org.litesoft.GWT.client.widgets.Button; |
6 |
|
- |
import org.litesoft.GWT.client.widgets.datatables.*; |
7 |
|
- |
import org.litesoft.GWT.forms.client.*; |
8 |
|
- |
import org.litesoft.bo.views.*; |
9 |
|
- |
import org.litesoft.datt.client.*; |
10 |
|
- |
import org.litesoft.datt.client.boviews.*; |
11 |
|
- |
import org.litesoft.datt.client.support.*; |
12 |
|
- |
import org.litesoft.datt.client.ui.widgets.*; |
13 |
|
- |
import org.litesoft.uispecification.*; |
14 |
|
- |
|
15 |
|
- |
import com.google.gwt.event.dom.client.*; |
16 |
|
- |
import com.google.gwt.user.client.ui.*; |
17 |
|
- |
|
18 |
|
- |
import static org.litesoft.uispecification.FormWidgetCtrl.*; |
19 |
|
- |
|
20 |
|
- |
public class StoryTasks extends ScreenView implements StoryFindable, |
21 |
|
- |
StoryViewNames, |
22 |
|
- |
TableRowRemoveCallBack<TaskView>, |
23 |
|
- |
TableRowEditCallBack<TaskView>, |
24 |
|
- |
TableRowMoveCallBack<TaskView>, |
25 |
|
- |
TaskDialog.CallBack { |
26 |
|
- |
// private QBE_FormEngine mFE; |
27 |
|
- |
|
28 |
|
- |
// private StoryViewDataProvider mDataProvider = StoryViewDataProvider.getInstance(); |
29 |
|
- |
private FormBinder<StoryView> mStoryFormBinder; |
30 |
|
- |
|
31 |
|
- |
private ObjectURL mStory = null; |
32 |
|
- |
|
33 |
|
- |
@Override |
34 |
|
- |
protected UriFragmentIdParams createRefreshParams() { |
35 |
|
- |
return StoryTasksFactory.encodeParams( mStory ); |
36 |
|
- |
} |
37 |
|
- |
|
38 |
|
- |
public StoryTasks( String pSection, ViewDef pViewDef, ObjectURL pEditing ) { |
39 |
|
- |
super( title( pSection, pViewDef ) ); |
40 |
|
- |
|
41 |
|
- |
mStory = pEditing; |
42 |
|
- |
if ( mStory == null ) { |
43 |
|
- |
backToHome( "Story Not Found" ); |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
addStandardTitleBar(); |
47 |
|
- |
|
48 |
|
- |
addLeft( BackButton.factory( "Change Story" ).add( ViewDefs.STORY_STORIES, new UriFragmentIdParams.ScreenParamsFactory() { |
49 |
|
- |
@Override |
50 |
|
- |
public UriFragmentIdParams create( ViewDef pTarget ) { |
51 |
|
- |
return StoriesFactory.encodeParams( mStory ); |
52 |
|
- |
} |
53 |
|
- |
} ).create() ); |
54 |
|
- |
|
55 |
|
- |
SizeableVerticalPanel zUpperPanel = new SizeableVerticalPanel().stretchable(); |
56 |
|
- |
|
57 |
|
- |
zUpperPanel.add( createSectionTitle( "Story" ) ); |
58 |
|
- |
zUpperPanel.add( new StoryInfoPanel( mStoryFormBinder = new FormBinder<StoryView>( new FormEngine( new WidgetCtrlMap( VISIBLE_BUT_DISABLED ), // |
59 |
|
- |
FormEngine.Mode.ViewRegular, null ), // |
60 |
|
- |
StoryViewMetaData.getInstance() ) ) ); |
61 |
|
- |
|
62 |
|
- |
Widget zTaskTable = createTaskTable(); |
63 |
|
- |
|
64 |
|
- |
add( new SizeableVerticalSplitPairPanel().stretchable().add( zUpperPanel, zTaskTable ) ); |
65 |
|
- |
} |
66 |
|
- |
|
67 |
|
- |
private Widget createTaskTable() { |
68 |
|
- |
ListTableModel<TaskView> zTableModel = new ListTableModel<TaskView>(); |
69 |
|
- |
UnSelectableRegularTable<TaskView> zTable = new UnSelectableRegularTable<TaskView>( zTableModel, new StoryTasksTableDef( this, this, this ) ); |
70 |
|
- |
SizeableHorizontalPanel zHorizontalPanel = new SizeableHorizontalPanel().stretchableHorizontally(); |
71 |
|
- |
zHorizontalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE ); |
72 |
|
- |
zHorizontalPanel.add( new OurLabel( "Tasks", false ).style( "LineFreeSectionTitleLabel" ) ); |
73 |
|
- |
zHorizontalPanel.add( new SizeableSpacer().stretchableHorizontally() ); |
74 |
|
- |
zHorizontalPanel.add( mAddNewTaskButton = Button.named( "Plus" ).blue().icon().disabled().add( new ClickHandler() { |
75 |
|
- |
@Override |
76 |
|
- |
public void onClick( ClickEvent event ) { |
77 |
|
- |
new DialogViewDialog( new TaskDialog( mStoryFormBinder.getObject(), TaskDialog.EditType.Add, StoryTasks.this ) ).show(); |
78 |
|
- |
} |
79 |
|
- |
} ).create() ); |
80 |
|
- |
SizeableVerticalPanel zVerticalPanel = new SizeableVerticalPanel().stretchable(); |
81 |
|
- |
zVerticalPanel.add( zHorizontalPanel ); |
82 |
|
- |
zVerticalPanel.add( zTable ); |
83 |
|
- |
return zVerticalPanel; |
84 |
|
- |
} |
85 |
|
- |
|
86 |
|
- |
private ButtonBase mAddNewTaskButton; |
87 |
|
- |
|
88 |
|
- |
@Override |
89 |
|
- |
public void aboutToShow() { |
90 |
|
- |
super.aboutToShow(); |
91 |
|
- |
StoryScreenViewHelper.requestRequiredStory( this, mStory, 0 ); |
92 |
|
- |
} |
93 |
|
- |
|
94 |
|
- |
@Override |
95 |
|
- |
public void foundStory( StoryView pStoryView, Integer pRequestID ) { |
96 |
|
- |
mStoryFormBinder.setExistingObject( pStoryView, FormEngine.Mode.ViewRegular ); |
97 |
|
- |
} |
98 |
|
- |
|
99 |
|
- |
// @Override |
100 |
|
- |
// protected void justLoaded() |
101 |
|
- |
// { |
102 |
|
- |
// super.justLoaded(); |
103 |
|
- |
// mFE.setFocus(); |
104 |
|
- |
// } |
105 |
|
- |
|
106 |
|
- |
@Override |
107 |
|
- |
public Widget getBottomBar() { |
108 |
|
- |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
109 |
|
- |
|
110 |
|
- |
// zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
111 |
|
- |
// zActionPanel.addCenter( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mTaskFormBinder, this ) ) ); |
112 |
|
- |
// zActionPanel.addRight( mFE.addExistingUnchangedNextButton( true, ViewDefs.STORY_MERGE_STORIES_STEP_THREE, new UriFragmentIdParams.ScreenParamsFactory() |
113 |
|
- |
// { |
114 |
|
- |
// @Override |
115 |
|
- |
// public UriFragmentIdParams create( ViewDef pTarget ) |
116 |
|
- |
// { |
117 |
|
- |
// return MergeStoriesStepThreeFactory.encodeParams( new TwoStoryURLs( mStory, mTask ) ); |
118 |
|
- |
// } |
119 |
|
- |
// } ) ); |
120 |
|
- |
return zActionPanel; |
121 |
|
- |
} |
122 |
|
- |
|
123 |
|
- |
@Override |
124 |
|
- |
public void editRow( TaskView pRowValue ) { |
125 |
|
- |
System.out.println( "StoryTasks.editRow: " + pRowValue ); |
126 |
|
- |
} |
127 |
|
- |
|
128 |
|
- |
@Override |
129 |
|
- |
public void moveUp( TaskView pRowValue ) { |
130 |
|
- |
System.out.println( "StoryTasks.moveUp: " + pRowValue ); |
131 |
|
- |
} |
132 |
|
- |
|
133 |
|
- |
@Override |
134 |
|
- |
public void moveDown( TaskView pRowValue ) { |
135 |
|
- |
System.out.println( "StoryTasks.moveDown: " + pRowValue ); |
136 |
|
- |
} |
137 |
|
- |
|
138 |
|
- |
@Override |
139 |
|
- |
public void removeRow( TaskView pRowValue ) { |
140 |
|
- |
System.out.println( "StoryTasks.removeRow: " + pRowValue ); |
141 |
|
- |
} |
142 |
|
- |
|
143 |
|
- |
public void saveTask( TaskView pTaskView ) // for TaskDialog add and update Tasks |
144 |
|
- |
{ |
145 |
|
- |
|
146 |
|
- |
} |
147 |
|
- |
} |
|
1 |
+ |
package org.litesoft.datt.client.ui.views.stories; |
|
2 |
+ |
|
|
3 |
+ |
import org.litesoft.GWT.client.view.*; |
|
4 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
5 |
+ |
import org.litesoft.GWT.client.widgets.Button; |
|
6 |
+ |
import org.litesoft.GWT.client.widgets.datatables.*; |
|
7 |
+ |
import org.litesoft.GWT.forms.client.*; |
|
8 |
+ |
import org.litesoft.bo.views.*; |
|
9 |
+ |
import org.litesoft.datt.client.*; |
|
10 |
+ |
import org.litesoft.datt.client.boviews.*; |
|
11 |
+ |
import org.litesoft.datt.client.support.*; |
|
12 |
+ |
import org.litesoft.datt.client.ui.widgets.*; |
|
13 |
+ |
import org.litesoft.uispecification.*; |
|
14 |
+ |
|
|
15 |
+ |
import com.google.gwt.event.dom.client.*; |
|
16 |
+ |
import com.google.gwt.user.client.ui.*; |
|
17 |
+ |
|
|
18 |
+ |
import static org.litesoft.uispecification.FormWidgetCtrl.*; |
|
19 |
+ |
|
|
20 |
+ |
public class StoryTasks extends ScreenView implements StoryFindable, |
|
21 |
+ |
StoryViewNames, |
|
22 |
+ |
TableRowRemoveCallBack<TaskView>, |
|
23 |
+ |
TableRowEditCallBack<TaskView>, |
|
24 |
+ |
TableRowMoveCallBack<TaskView>, |
|
25 |
+ |
TaskDialog.CallBack { |
|
26 |
+ |
// private QBE_FormEngine mFE; |
|
27 |
+ |
|
|
28 |
+ |
// private StoryViewDataProvider mDataProvider = StoryViewDataProvider.getInstance(); |
|
29 |
+ |
private FormBinder<StoryView> mStoryFormBinder; |
|
30 |
+ |
|
|
31 |
+ |
private ObjectURL mStory = null; |
|
32 |
+ |
|
|
33 |
+ |
@Override |
|
34 |
+ |
protected UriFragmentIdParams createRefreshParams() { |
|
35 |
+ |
return StoryTasksFactory.encodeParams( mStory ); |
|
36 |
+ |
} |
|
37 |
+ |
|
|
38 |
+ |
public StoryTasks( String pSection, ViewDef pViewDef, ObjectURL pEditing ) { |
|
39 |
+ |
super( title( pSection, pViewDef ) ); |
|
40 |
+ |
|
|
41 |
+ |
mStory = pEditing; |
|
42 |
+ |
if ( mStory == null ) { |
|
43 |
+ |
backToHome( "Story Not Found" ); |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
addStandardTitleBar(); |
|
47 |
+ |
|
|
48 |
+ |
addLeft( BackButton.factory( "Change Story" ).add( ViewDefs.STORY_STORIES, new UriFragmentIdParams.ScreenParamsFactory() { |
|
49 |
+ |
@Override |
|
50 |
+ |
public UriFragmentIdParams create( ViewDef pTarget ) { |
|
51 |
+ |
return StoriesFactory.encodeParams( mStory ); |
|
52 |
+ |
} |
|
53 |
+ |
} ).create() ); |
|
54 |
+ |
|
|
55 |
+ |
SizeableVerticalPanel zUpperPanel = new SizeableVerticalPanel().stretchable(); |
|
56 |
+ |
|
|
57 |
+ |
zUpperPanel.add( createSectionTitle( "Story" ) ); |
|
58 |
+ |
zUpperPanel.add( new StoryInfoPanel( mStoryFormBinder = new FormBinder<StoryView>( new FormEngine( new WidgetCtrlMap( VISIBLE_BUT_DISABLED ), // |
|
59 |
+ |
FormEngine.Mode.ViewRegular, null ), // |
|
60 |
+ |
StoryViewMetaData.getInstance() ) ) ); |
|
61 |
+ |
|
|
62 |
+ |
Widget zTaskTable = createTaskTable(); |
|
63 |
+ |
|
|
64 |
+ |
add( new SizeableVerticalSplitPairPanel().stretchable().add( zUpperPanel, zTaskTable ) ); |
|
65 |
+ |
} |
|
66 |
+ |
|
|
67 |
+ |
private Widget createTaskTable() { |
|
68 |
+ |
ListTableModel<TaskView> zTableModel = new ListTableModel<TaskView>(); |
|
69 |
+ |
UnSelectableRegularTable<TaskView> zTable = new UnSelectableRegularTable<TaskView>( zTableModel, new StoryTasksTableDef( this, this, this ) ); |
|
70 |
+ |
SizeableHorizontalPanel zHorizontalPanel = new SizeableHorizontalPanel().stretchableHorizontally(); |
|
71 |
+ |
zHorizontalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE ); |
|
72 |
+ |
zHorizontalPanel.add( new OurLabel( "Tasks", false ).style( "LineFreeSectionTitleLabel" ) ); |
|
73 |
+ |
zHorizontalPanel.add( new SizeableSpacer().stretchableHorizontally() ); |
|
74 |
+ |
zHorizontalPanel.add( mAddNewTaskButton = Button.named( "Plus" ).blue().icon().disabled().add( new ClickHandler() { |
|
75 |
+ |
@Override |
|
76 |
+ |
public void onClick( ClickEvent event ) { |
|
77 |
+ |
new DialogViewDialog( new TaskDialog( mStoryFormBinder.getObject(), TaskDialog.EditType.Add, StoryTasks.this ) ).show(); |
|
78 |
+ |
} |
|
79 |
+ |
} ).create() ); |
|
80 |
+ |
SizeableVerticalPanel zVerticalPanel = new SizeableVerticalPanel().stretchable(); |
|
81 |
+ |
zVerticalPanel.add( zHorizontalPanel ); |
|
82 |
+ |
zVerticalPanel.add( zTable ); |
|
83 |
+ |
return zVerticalPanel; |
|
84 |
+ |
} |
|
85 |
+ |
|
|
86 |
+ |
private ButtonBase mAddNewTaskButton; |
|
87 |
+ |
|
|
88 |
+ |
@Override |
|
89 |
+ |
public void aboutToShow() { |
|
90 |
+ |
super.aboutToShow(); |
|
91 |
+ |
StoryScreenViewHelper.requestRequiredStory( this, mStory, 0 ); |
|
92 |
+ |
} |
|
93 |
+ |
|
|
94 |
+ |
@Override |
|
95 |
+ |
public void foundStory( StoryView pStoryView, Integer pRequestID ) { |
|
96 |
+ |
mStoryFormBinder.setExistingObject( pStoryView, FormEngine.Mode.ViewRegular ); |
|
97 |
+ |
} |
|
98 |
+ |
|
|
99 |
+ |
// @Override |
|
100 |
+ |
// protected void justLoaded() |
|
101 |
+ |
// { |
|
102 |
+ |
// super.justLoaded(); |
|
103 |
+ |
// mFE.setFocus(); |
|
104 |
+ |
// } |
|
105 |
+ |
|
|
106 |
+ |
@Override |
|
107 |
+ |
public Widget getBottomBar() { |
|
108 |
+ |
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
|
109 |
+ |
|
|
110 |
+ |
// zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
|
111 |
+ |
// zActionPanel.addCenter( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mTaskFormBinder, this ) ) ); |
|
112 |
+ |
// zActionPanel.addRight( mFE.addExistingUnchangedNextButton( true, ViewDefs.STORY_MERGE_STORIES_STEP_THREE, new UriFragmentIdParams.ScreenParamsFactory() |
|
113 |
+ |
// { |
|
114 |
+ |
// @Override |
|
115 |
+ |
// public UriFragmentIdParams create( ViewDef pTarget ) |
|
116 |
+ |
// { |
|
117 |
+ |
// return MergeStoriesStepThreeFactory.encodeParams( new TwoStoryURLs( mStory, mTask ) ); |
|
118 |
+ |
// } |
|
119 |
+ |
// } ) ); |
|
120 |
+ |
return zActionPanel; |
|
121 |
+ |
} |
|
122 |
+ |
|
|
123 |
+ |
@Override |
|
124 |
+ |
public void editRow( TaskView pRowValue ) { |
|
125 |
+ |
System.out.println( "StoryTasks.editRow: " + pRowValue ); |
|
126 |
+ |
} |
|
127 |
+ |
|
|
128 |
+ |
@Override |
|
129 |
+ |
public void moveUp( TaskView pRowValue ) { |
|
130 |
+ |
System.out.println( "StoryTasks.moveUp: " + pRowValue ); |
|
131 |
+ |
} |
|
132 |
+ |
|
|
133 |
+ |
@Override |
|
134 |
+ |
public void moveDown( TaskView pRowValue ) { |
|
135 |
+ |
System.out.println( "StoryTasks.moveDown: " + pRowValue ); |
|
136 |
+ |
} |
|
137 |
+ |
|
|
138 |
+ |
@Override |
|
139 |
+ |
public void removeRow( TaskView pRowValue ) { |
|
140 |
+ |
System.out.println( "StoryTasks.removeRow: " + pRowValue ); |
|
141 |
+ |
} |
|
142 |
+ |
|
|
143 |
+ |
public void saveTask( TaskView pTaskView ) // for TaskDialog add and update Tasks |
|
144 |
+ |
{ |
|
145 |
+ |
|
|
146 |
+ |
} |
|
147 |
+ |
} |