|
@@ -2,6 +2,7 @@ |
2 |
2 |
|
|
3 |
3 |
|
import org.litesoft.GWT.client.view.*; |
4 |
4 |
|
import org.litesoft.GWT.client.widgets.*; |
|
5 |
+ |
import org.litesoft.GWT.client.widgets.Button; |
5 |
6 |
|
import org.litesoft.GWT.client.widgets.datatables.*; |
6 |
7 |
|
import org.litesoft.GWT.forms.client.*; |
7 |
8 |
|
import org.litesoft.bo.views.*; |
|
@@ -16,13 +17,14 @@ |
16 |
17 |
|
import static org.litesoft.uispecification.FormWidgetCtrl.*; |
17 |
18 |
|
|
18 |
19 |
|
public class StoryTasks extends ScreenView implements StoryFindable, |
19 |
|
- |
StoryViewNames, |
20 |
|
- |
TableClickCommand<StoryView>, |
21 |
|
- |
ViewUpdatable<StoryView> |
|
20 |
+ |
StoryViewNames, |
|
21 |
+ |
TableRowRemoveCallBack<TaskView>, |
|
22 |
+ |
TableRowEditCallBack<TaskView>, |
|
23 |
+ |
TableRowMoveCallBack<TaskView> |
22 |
24 |
|
{ |
23 |
|
- |
private QBE_FormEngine mFE; |
|
25 |
+ |
// private QBE_FormEngine mFE; |
24 |
26 |
|
|
25 |
|
- |
private StoryViewDataProvider mDataProvider = StoryViewDataProvider.getInstance(); |
|
27 |
+ |
// private StoryViewDataProvider mDataProvider = StoryViewDataProvider.getInstance(); |
26 |
28 |
|
private FormBinder<StoryView> mStoryFormBinder; |
27 |
29 |
|
|
28 |
30 |
|
private ObjectURL mStory = null; |
|
@@ -38,11 +40,14 @@ |
38 |
40 |
|
super( title( pSection, pViewDef ) ); |
39 |
41 |
|
|
40 |
42 |
|
mStory = pEditing; |
41 |
|
- |
// todo: if mStory is not found than show and error and return back to Stories |
42 |
|
- |
|
|
43 |
+ |
if ( mStory == null ) |
|
44 |
+ |
{ |
|
45 |
+ |
backToHome( "Story Not Found" ); |
|
46 |
+ |
} |
|
47 |
+ |
|
43 |
48 |
|
addStandardTitleBar(); |
44 |
49 |
|
|
45 |
|
- |
addLeft( ChangeFromBackButton.factory().add( ViewDefs.STORY_STORIES, new UriFragmentIdParams.ScreenParamsFactory() |
|
50 |
+ |
addLeft( BackButton.factory( "Change Story" ).add( ViewDefs.STORY_STORIES, new UriFragmentIdParams.ScreenParamsFactory() |
46 |
51 |
|
{ |
47 |
52 |
|
@Override |
48 |
53 |
|
public UriFragmentIdParams create( ViewDef pTarget ) |
|
@@ -55,26 +60,31 @@ |
55 |
60 |
|
|
56 |
61 |
|
zUpperPanel.add( createSectionTitle( "Story" ) ); |
57 |
62 |
|
zUpperPanel.add( new StoryInfoPanel( mStoryFormBinder = new FormBinder<StoryView>( new FormEngine( new WidgetCtrlMap( VISIBLE_BUT_DISABLED ), // |
58 |
|
- |
FormEngine.Mode.ViewRegular, null ), // |
59 |
|
- |
StoryViewMetaData.getInstance() ) ) ); |
60 |
|
- |
|
61 |
|
- |
QBEscreenSupport zQBEscreenSupport = new QBEscreenSupport(); |
62 |
|
- |
SizeableVerticalPanel zFormPanel = zQBEscreenSupport.getQBEleft(); |
63 |
|
- |
SizeableQBEboxedPanel zQBEboxedPanel = zQBEscreenSupport.getQBEboxedPanel(); |
64 |
|
- |
|
65 |
|
- |
FilteringTableModel<StoryView> zFilter = new FilteringTableModel<StoryView>( mDataProvider, true, this, null, false ); // Second 'this' allows auto "New" |
66 |
|
- |
StoryViewTable zTable = new StoryViewTable( zFilter, this ); |
67 |
|
- |
zQBEboxedPanel.setWidget( zFilter.addReloadable( zTable ) ); |
|
63 |
+ |
FormEngine.Mode.ViewRegular, null ), // |
|
64 |
+ |
StoryViewMetaData.getInstance() ) ) ); |
68 |
65 |
|
|
69 |
|
- |
WidgetCtrlMap zWidgetCtrlMap = StoryFieldsPanel.createWidgetCtrlMap( VISIBLE_AND_ACTIVE_ENABLED ); |
|
66 |
+ |
Widget zTaskTable = createTaskTable(); |
70 |
67 |
|
|
71 |
|
- |
mFE = new QBE_FormEngine( zWidgetCtrlMap, null, zQBEboxedPanel, zFilter, zFilter ); |
72 |
|
- |
|
73 |
|
- |
zFormPanel.add( mFE.createSectionTitle( "Story to merge Into" ) );; |
|
68 |
+ |
add( new SizeableVerticalSplitPairPanel().stretchable().add( zUpperPanel, zTaskTable ) ); |
|
69 |
+ |
} |
74 |
70 |
|
|
75 |
|
- |
add( new SizeableVerticalSplitPairPanel().stretchable().add( zUpperPanel, zQBEscreenSupport ) ); |
|
71 |
+ |
private Widget createTaskTable() |
|
72 |
+ |
{ |
|
73 |
+ |
ListTableModel<TaskView> zTableModel = new ListTableModel<TaskView>(); |
|
74 |
+ |
UnSelectableRegularTable<TaskView> zTable = new UnSelectableRegularTable<TaskView>( zTableModel, new StoryTasksTableDef( this, this, this ) ); |
|
75 |
+ |
SizeableHorizontalPanel zHorizontalPanel = new SizeableHorizontalPanel().stretchableHorizontally(); |
|
76 |
+ |
zHorizontalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE ); |
|
77 |
+ |
zHorizontalPanel.add( new OurLabel( "Tasks", false ).style( "LineFreeSectionTitleLabel" ) ); |
|
78 |
+ |
zHorizontalPanel.add( new SizeableSpacer().stretchableHorizontally() ); |
|
79 |
+ |
zHorizontalPanel.add( mAddNewTaskButton = Button.named( "Plus" ).blue().icon().disabled().create() ); |
|
80 |
+ |
SizeableVerticalPanel zVerticalPanel = new SizeableVerticalPanel().stretchable(); |
|
81 |
+ |
zVerticalPanel.add( zHorizontalPanel ); |
|
82 |
+ |
zVerticalPanel.add( zTable ); |
|
83 |
+ |
return zVerticalPanel; |
76 |
84 |
|
} |
77 |
85 |
|
|
|
86 |
+ |
private ButtonBase mAddNewTaskButton; |
|
87 |
+ |
|
78 |
88 |
|
@Override |
79 |
89 |
|
public void aboutToShow() |
80 |
90 |
|
{ |
|
@@ -88,40 +98,19 @@ |
88 |
98 |
|
mStoryFormBinder.setExistingObject( pStoryView, FormEngine.Mode.ViewRegular ); |
89 |
99 |
|
} |
90 |
100 |
|
|
91 |
|
- |
@Override |
92 |
|
- |
protected void justLoaded() |
93 |
|
- |
{ |
94 |
|
- |
super.justLoaded(); |
95 |
|
- |
mFE.setFocus(); |
96 |
|
- |
} |
97 |
|
- |
|
98 |
|
- |
@Override |
99 |
|
- |
public void execute( StoryView pRowValue ) |
100 |
|
- |
{ |
101 |
|
- |
if ( pRowValue != null ) |
102 |
|
- |
{ |
103 |
|
- |
modeEdit( pRowValue ); |
104 |
|
- |
} |
105 |
|
- |
} |
106 |
|
- |
|
107 |
|
- |
private void modeSearch() |
108 |
|
- |
{ |
109 |
|
- |
// mTask = null; |
110 |
|
- |
// mFE.setMode( FormEngine.Mode.Search ); |
111 |
|
- |
} |
112 |
|
- |
|
113 |
|
- |
private void modeEdit( StoryView pStoryView ) |
114 |
|
- |
{ |
115 |
|
- |
// mTask = pStoryView.getObjectURL(); |
116 |
|
- |
// mTaskFormBinder.setExistingObject( mDataProvider.copyIntoNewTS( pStoryView ), FormEngine.Mode.EditFromSearch ); |
117 |
|
- |
} |
|
101 |
+ |
// @Override |
|
102 |
+ |
// protected void justLoaded() |
|
103 |
+ |
// { |
|
104 |
+ |
// super.justLoaded(); |
|
105 |
+ |
// mFE.setFocus(); |
|
106 |
+ |
// } |
118 |
107 |
|
|
119 |
108 |
|
@Override |
120 |
109 |
|
public Widget getBottomBar() |
121 |
110 |
|
{ |
122 |
111 |
|
LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel(); |
123 |
112 |
|
|
124 |
|
- |
zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
|
113 |
+ |
// zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) ); |
125 |
114 |
|
// zActionPanel.addCenter( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mTaskFormBinder, this ) ) ); |
126 |
115 |
|
// zActionPanel.addRight( mFE.addExistingUnchangedNextButton( true, ViewDefs.STORY_MERGE_STORIES_STEP_THREE, new UriFragmentIdParams.ScreenParamsFactory() |
127 |
116 |
|
// { |
|
@@ -135,8 +124,26 @@ |
135 |
124 |
|
} |
136 |
125 |
|
|
137 |
126 |
|
@Override |
138 |
|
- |
public void viewUpdated( StoryView pStoryView ) |
|
127 |
+ |
public void editRow( TaskView pRowValue ) |
|
128 |
+ |
{ |
|
129 |
+ |
System.out.println( "StoryTasks.editRow: " + pRowValue ); |
|
130 |
+ |
} |
|
131 |
+ |
|
|
132 |
+ |
@Override |
|
133 |
+ |
public void moveUp( TaskView pRowValue ) |
|
134 |
+ |
{ |
|
135 |
+ |
System.out.println( "StoryTasks.moveUp: " + pRowValue ); |
|
136 |
+ |
} |
|
137 |
+ |
|
|
138 |
+ |
@Override |
|
139 |
+ |
public void moveDown( TaskView pRowValue ) |
|
140 |
+ |
{ |
|
141 |
+ |
System.out.println( "StoryTasks.moveDown: " + pRowValue ); |
|
142 |
+ |
} |
|
143 |
+ |
|
|
144 |
+ |
@Override |
|
145 |
+ |
public void removeRow( TaskView pRowValue ) |
139 |
146 |
|
{ |
140 |
|
- |
modeEdit( pStoryView ); |
|
147 |
+ |
System.out.println( "StoryTasks.removeRow: " + pRowValue ); |
141 |
148 |
|
} |
142 |
149 |
|
} |