Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
package org.litesoft.datt.client.ui.views.stories;

import org.litesoft.GWT.client.view.*;
import org.litesoft.GWT.client.widgets.*;
import org.litesoft.GWT.client.widgets.Button;
import org.litesoft.GWT.client.widgets.datatables.*;
import org.litesoft.GWT.forms.client.*;
import org.litesoft.bo.views.*;
import org.litesoft.datt.client.*;
import org.litesoft.datt.client.boviews.*;
import org.litesoft.datt.client.support.*;
import org.litesoft.datt.client.ui.widgets.*;
import org.litesoft.uispecification.*;

import com.google.gwt.event.dom.client.*;
import com.google.gwt.user.client.ui.*;

import static org.litesoft.uispecification.FormWidgetCtrl.*;

public class StoryTasks extends ScreenView implements StoryFindable,
                                                      StoryViewNames,
                                                      TableRowRemoveCallBack<TaskView>,
                                                      TableRowEditCallBack<TaskView>,
                                                      TableRowMoveCallBack<TaskView>,
                                                      TaskDialog.CallBack {
//    private QBE_FormEngine mFE;

    //    private StoryViewDataProvider mDataProvider = StoryViewDataProvider.getInstance();
    private FormBinder<StoryView> mStoryFormBinder;

    private ObjectURL mStory = null;

    @Override
    protected UriFragmentIdParams createRefreshParams() {
        return StoryTasksFactory.encodeParams( mStory );
    }

    public StoryTasks( String pSection, ViewDef pViewDef, ObjectURL pEditing ) {
        super( title( pSection, pViewDef ) );

        mStory = pEditing;
        if ( mStory == null ) {
            backToHome( "Story Not Found" );
        }

        addStandardTitleBar();

        addLeft( BackButton.factory( "Change Story" ).add( ViewDefs.STORY_STORIES, new UriFragmentIdParams.ScreenParamsFactory() {
            @Override
            public UriFragmentIdParams create( ViewDef pTarget ) {
                return StoriesFactory.encodeParams( mStory );
            }
        } ).create() );

        SizeableVerticalPanel zUpperPanel = new SizeableVerticalPanel().stretchable();

        zUpperPanel.add( createSectionTitle( "Story" ) );
        zUpperPanel.add( new StoryInfoPanel( mStoryFormBinder = new FormBinder<StoryView>( new FormEngine( new WidgetCtrlMap( VISIBLE_BUT_DISABLED ), //
                                                                                                           FormEngine.Mode.ViewRegular, null ), //
                                                                                           StoryViewMetaData.getInstance() ) ) );

        Widget zTaskTable = createTaskTable();

        add( new SizeableVerticalSplitPairPanel().stretchable().add( zUpperPanel, zTaskTable ) );
    }

    private Widget createTaskTable() {
        ListTableModel<TaskView> zTableModel = new ListTableModel<TaskView>();
        UnSelectableRegularTable<TaskView> zTable = new UnSelectableRegularTable<TaskView>( zTableModel, new StoryTasksTableDef( this, this, this ) );
        SizeableHorizontalPanel zHorizontalPanel = new SizeableHorizontalPanel().stretchableHorizontally();
        zHorizontalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
        zHorizontalPanel.add( new OurLabel( "Tasks", false ).style( "LineFreeSectionTitleLabel" ) );
        zHorizontalPanel.add( new SizeableSpacer().stretchableHorizontally() );
        zHorizontalPanel.add( mAddNewTaskButton = Button.named( "Plus" ).blue().icon().disabled().add( new ClickHandler() {
            @Override
            public void onClick( ClickEvent event ) {
                new DialogViewDialog( new TaskDialog( mStoryFormBinder.getObject(), TaskDialog.EditType.Add, StoryTasks.this ) ).show();
            }
        } ).create() );
        SizeableVerticalPanel zVerticalPanel = new SizeableVerticalPanel().stretchable();
        zVerticalPanel.add( zHorizontalPanel );
        zVerticalPanel.add( zTable );
        return zVerticalPanel;
    }

    private ButtonBase mAddNewTaskButton;

    @Override
    public void aboutToShow() {
        super.aboutToShow();
        StoryScreenViewHelper.requestRequiredStory( this, mStory, 0 );
    }

    @Override
    public void foundStory( StoryView pStoryView, Integer pRequestID ) {
        mStoryFormBinder.setExistingObject( pStoryView, FormEngine.Mode.ViewRegular );
    }

//    @Override
//    protected void justLoaded()
//    {
//        super.justLoaded();
//        mFE.setFocus();
//    }

    @Override
    public Widget getBottomBar() {
        LeftCenterRightHorizontalPanel zActionPanel = new LeftCenterRightHorizontalPanel();

//        zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) );
//        zActionPanel.addCenter( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mTaskFormBinder, this ) ) );
//        zActionPanel.addRight( mFE.addExistingUnchangedNextButton( true, ViewDefs.STORY_MERGE_STORIES_STEP_THREE, new UriFragmentIdParams.ScreenParamsFactory()
//        {
//            @Override
//            public UriFragmentIdParams create( ViewDef pTarget )
//            {
//                return MergeStoriesStepThreeFactory.encodeParams( new TwoStoryURLs( mStory, mTask ) );
//            }
//        } ) );
        return zActionPanel;
    }

    @Override
    public void editRow( TaskView pRowValue ) {
        System.out.println( "StoryTasks.editRow: " + pRowValue );
    }

    @Override
    public void moveUp( TaskView pRowValue ) {
        System.out.println( "StoryTasks.moveUp: " + pRowValue );
    }

    @Override
    public void moveDown( TaskView pRowValue ) {
        System.out.println( "StoryTasks.moveDown: " + pRowValue );
    }

    @Override
    public void removeRow( TaskView pRowValue ) {
        System.out.println( "StoryTasks.removeRow: " + pRowValue );
    }

    public void saveTask( TaskView pTaskView )  // for TaskDialog add and update Tasks
    {

    }
}

Commits for litesoft/trunk/Java/DATT/src/org/litesoft/datt/client/ui/views/stories/StoryTasks.java

Diff revisions: vs.
Revision Author Commited Message
950 Diff Diff GeorgeS picture GeorgeS Thu 19 Jun, 2014 17:57:04 +0000

New Lines

948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

676 Diff Diff markcmarkc Mon 14 May, 2012 00:51:32 +0000
605 Diff Diff markcmarkc Mon 05 Mar, 2012 01:26:53 +0000

Latest

604 Diff Diff markcmarkc Sun 04 Mar, 2012 21:45:48 +0000

Latest

566 Diff Diff markcmarkc Mon 14 Nov, 2011 01:45:18 +0000
565 Diff Diff markcmarkc Sun 13 Nov, 2011 21:45:35 +0000
539 Diff Diff markcmarkc Mon 03 Oct, 2011 00:35:01 +0000
501 Diff Diff markcmarkc Sun 11 Sep, 2011 22:50:22 +0000

Added a customer

496 GeorgeS picture GeorgeS Sun 11 Sep, 2011 16:58:00 +0000