|
@@ -8,47 +8,40 @@ |
8 |
8 |
|
|
9 |
9 |
|
import com.google.gwt.user.client.ui.*; |
10 |
10 |
|
|
11 |
|
- |
import static org.litesoft.uispecification.FormWidgetCtrl.VISIBLE_AND_ACTIVE_ENABLED; |
|
11 |
+ |
import static org.litesoft.uispecification.FormWidgetCtrl.*; |
12 |
12 |
|
|
13 |
|
- |
public class TaskDialog extends DialogView |
14 |
|
- |
{ |
15 |
|
- |
public interface CallBack |
16 |
|
- |
{ |
|
13 |
+ |
public class TaskDialog extends DialogView { |
|
14 |
+ |
public interface CallBack { |
17 |
15 |
|
public void saveTask( TaskView pTaskView ); |
18 |
16 |
|
} |
19 |
17 |
|
|
20 |
18 |
|
private CallBack mCallBack; |
21 |
19 |
|
|
22 |
|
- |
public enum EditType |
23 |
|
- |
{ |
|
20 |
+ |
public enum EditType { |
24 |
21 |
|
Add, |
25 |
22 |
|
Update |
26 |
23 |
|
} |
27 |
|
- |
|
|
24 |
+ |
|
28 |
25 |
|
private EditType mEditType; |
29 |
26 |
|
|
30 |
27 |
|
protected FormEngine mFE; |
31 |
28 |
|
private StoryView mStoryView; |
32 |
29 |
|
private TaskView mTaskView; |
33 |
|
- |
|
34 |
30 |
|
|
35 |
|
- |
public TaskDialog( StoryView pStoryView, EditType pEditType, CallBack pCallBack ) |
36 |
|
- |
{ |
|
31 |
+ |
public TaskDialog( StoryView pStoryView, EditType pEditType, CallBack pCallBack ) { |
37 |
32 |
|
super( title( pEditType + " Task" ), Opaqueness.None ); |
38 |
33 |
|
|
39 |
34 |
|
mEditType = pEditType; |
40 |
35 |
|
mCallBack = pCallBack; |
41 |
36 |
|
mStoryView = pStoryView; |
42 |
37 |
|
|
43 |
|
- |
if (mEditType == EditType.Add) |
44 |
|
- |
{ |
|
38 |
+ |
if ( mEditType == EditType.Add ) { |
45 |
39 |
|
finishBuilding( "New Task" ); |
46 |
40 |
|
} |
47 |
41 |
|
} |
48 |
42 |
|
|
49 |
|
- |
private void finishBuilding( String pLabel ) |
50 |
|
- |
{ |
51 |
|
- |
setViewTitle(pLabel); |
|
43 |
+ |
private void finishBuilding( String pLabel ) { |
|
44 |
+ |
setViewTitle( pLabel ); |
52 |
45 |
|
|
53 |
46 |
|
mFE = createFE( new WidgetCtrlMap( VISIBLE_AND_ACTIVE_ENABLED ) ); |
54 |
47 |
|
|
|
@@ -71,26 +64,21 @@ |
71 |
64 |
|
add( new SizeableSpacer( 5 ).stretchable() ); |
72 |
65 |
|
} |
73 |
66 |
|
|
74 |
|
- |
private FormEngine createFE( WidgetCtrlMap pWidgetCtrlMap ) |
75 |
|
- |
{ |
76 |
|
- |
return new FormEngine( pWidgetCtrlMap, FormEngine.Mode.EditRegular, null ) |
77 |
|
- |
{ |
|
67 |
+ |
private FormEngine createFE( WidgetCtrlMap pWidgetCtrlMap ) { |
|
68 |
+ |
return new FormEngine( pWidgetCtrlMap, FormEngine.Mode.EditRegular, null ) { |
78 |
69 |
|
@Override |
79 |
|
- |
protected void changeOccurredOn( String pName, IFormComponent pComponent, boolean pChanged ) |
80 |
|
- |
{ |
|
70 |
+ |
protected void changeOccurredOn( String pName, IFormComponent pComponent, boolean pChanged ) { |
81 |
71 |
|
super.changeOccurredOn( pName, pComponent, pChanged ); |
82 |
72 |
|
changeOccured( pName, pComponent ); |
83 |
73 |
|
} |
84 |
74 |
|
}; |
85 |
75 |
|
} |
86 |
76 |
|
|
87 |
|
- |
protected void changeOccured( String pName, IFormComponent pComponent ) |
88 |
|
- |
{ |
|
77 |
+ |
protected void changeOccured( String pName, IFormComponent pComponent ) { |
89 |
78 |
|
|
90 |
79 |
|
} |
91 |
80 |
|
|
92 |
|
- |
public Widget createItemAndDescription() |
93 |
|
- |
{ |
|
81 |
+ |
public Widget createItemAndDescription() { |
94 |
82 |
|
HorizontalPanel zPanel = new HorizontalPanel(); |
95 |
83 |
|
zPanel.addStyleName( "EditDialogDescriptionPanel" ); |
96 |
84 |
|
// zPanel.add( new Label( TaskView.getName() ) ); |
|
@@ -98,6 +86,4 @@ |
98 |
86 |
|
// zPanel.add( new Label( TaskView.getDescription() ) ); |
99 |
87 |
|
return zPanel; |
100 |
88 |
|
} |
101 |
|
- |
|
102 |
|
- |
|
103 |
89 |
|
} |