Subversion Repository Public Repository

litesoft

Diff Revisions 675 vs 676 for /trunk/Java/DATT/src/org/litesoft/datt/client/ui/views/stories/TaskDialog.java

Diff revisions: vs.
  @@ -1,13 +1,20 @@
1 1 package org.litesoft.datt.client.ui.views.stories;
2 2
3 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.GWT.forms.client.components.*;
4 7 import org.litesoft.datt.client.boviews.*;
5 8
9 + import com.google.gwt.user.client.ui.*;
10 +
11 + import static org.litesoft.uispecification.FormWidgetCtrl.VISIBLE_AND_ACTIVE_ENABLED;
12 +
6 13 public class TaskDialog extends DialogView
7 14 {
8 15 public interface CallBack
9 16 {
10 - public void saveTask( TaskView pTaskView ); // todo: change to SaveTask to apply to both Add and Update
17 + public void saveTask( TaskView pTaskView );
11 18 }
12 19
13 20 private CallBack mCallBack;
  @@ -20,11 +27,77 @@
20 27
21 28 private EditType mEditType;
22 29
23 - public TaskDialog( EditType pEditType, CallBack pCallBack )
30 + protected FormEngine mFE;
31 + private StoryView mStoryView;
32 + private TaskView mTaskView;
33 +
34 +
35 + public TaskDialog( StoryView pStoryView, EditType pEditType, CallBack pCallBack )
24 36 {
25 37 super( title( pEditType + " Task" ), Opaqueness.None );
26 38
27 39 mEditType = pEditType;
28 40 mCallBack = pCallBack;
41 + mStoryView = pStoryView;
42 +
43 + if (mEditType == EditType.Add)
44 + {
45 + finishBuilding( "New Task" );
46 + }
47 + }
48 +
49 + private void finishBuilding( String pLabel )
50 + {
51 + setViewTitle(pLabel);
52 +
53 + mFE = createFE( new WidgetCtrlMap( VISIBLE_AND_ACTIVE_ENABLED ) );
54 +
55 + add( createItemAndDescription() );
56 + // add( createRestoreDiscontinueOption() );
57 +
58 + mContent.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
59 +
60 + // String zOrderStatus;
61 + // if ( mAdditionalOrder )
62 + // {
63 + // zOrderStatus = "Additional";
64 + // }
65 + // else
66 + // {
67 + // zOrderStatus = "Initial";
68 + // }
69 + //
70 + // add( createOrderQuickCodePanel( zOrderStatus + " Order", pQuickCodeFieldLabel ) );
71 + add( new SizeableSpacer( 5 ).stretchable() );
29 72 }
73 +
74 + private FormEngine createFE( WidgetCtrlMap pWidgetCtrlMap )
75 + {
76 + return new FormEngine( pWidgetCtrlMap, FormEngine.Mode.EditRegular, null )
77 + {
78 + @Override
79 + protected void changeOccurredOn( String pName, IFormComponent pComponent, boolean pChanged )
80 + {
81 + super.changeOccurredOn( pName, pComponent, pChanged );
82 + changeOccured( pName, pComponent );
83 + }
84 + };
85 + }
86 +
87 + protected void changeOccured( String pName, IFormComponent pComponent )
88 + {
89 +
90 + }
91 +
92 + public Widget createItemAndDescription()
93 + {
94 + HorizontalPanel zPanel = new HorizontalPanel();
95 + zPanel.addStyleName( "EditDialogDescriptionPanel" );
96 + // zPanel.add( new Label( TaskView.getName() ) );
97 + zPanel.add( new Spacer( 10 ) );
98 + // zPanel.add( new Label( TaskView.getDescription() ) );
99 + return zPanel;
100 + }
101 +
102 +
30 103 }