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
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.datatables.*;
import org.litesoft.GWT.forms.client.*;
import org.litesoft.bo.views.*;
import org.litesoft.datt.client.boviews.*;
import org.litesoft.datt.client.ui.widgets.*;
import org.litesoft.uispecification.*;

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

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

public class TasksDialog extends ClickableViewObjectQBEscreenView<TaskView> implements TaskViewNames,
                                                                                       ViewUpdatable<TaskView> {
    private ObjectURL mEditing = null;

    @Override
    protected UriFragmentIdParams createRefreshParams() {
        return StoriesFactory.encodeParams( mEditing );
    }

    @SuppressWarnings({"UnusedParameters"})
    public TasksDialog( String pSection, ViewDef pViewDef, ObjectURL pEditing ) {
        super( title( pViewDef ), TaskViewDataProvider.getInstance() );

        mEditing = pEditing;

        addStandardTitleBar();

        SizeableQBEboxedPanel zQBEboxedPanel = getQBEboxedPanel();

        FilteringTableModel<TaskView> zFilter = new FilteringTableModel<TaskView>( mDataProvider, true, this, this, true ); // Second 'this' allows "New"
        TaskViewTable zTable = new TaskViewTable( zFilter, this );
        zQBEboxedPanel.setWidget( zFilter.addReloadable( zTable ) );

        WidgetCtrlMap zWidgetCtrlMap = TaskFieldsPanel.createWidgetCtrlMap( VISIBLE_AND_ACTIVE_ENABLED );

        mFE = new QBE_FormEngine( zWidgetCtrlMap, null, zQBEboxedPanel, zFilter, zFilter );
        mFE.setFilterTransformer( new ShowBooleanUpdateFilterTransformer( mFE.getFilterTransformer(), aShowDone, aIsDone, null, false ) );

        mFormBinder = new FormBinder<TaskView>( mFE, TaskViewMetaData.getInstance() );

        add( mFE.createSectionTitle( "Task" ) );

        TaskFieldsPanel zTaskFieldsPanel = new TaskFieldsPanel( mFormBinder );

        add( zTaskFieldsPanel );

        mFE.setPointerWidget( zTaskFieldsPanel.getPointerField() );
    }

    @Override
    public void aboutToShow() {
        super.aboutToShow();
        ObjectURL zEditing = mEditing;
        modeSearch();
        if ( zEditing != null ) {
            mDataProvider.requestRow( zEditing, new FetchRowDataProviderCallBack<TaskView>() {
                @Override
                public void success( TaskView pRow ) {
                    if ( pRow != null ) {
                        modeEdit( pRow );
                    }
                }

                @Override
                public void error( String pError ) {
                    getStatusMessageSinc().setErrorMessage( pError );
                }
            } );
        }
    }

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

    @Override
    protected void processVO( TaskView pRowValue ) {
        if ( pRowValue != null ) {
            modeEdit( pRowValue );
        } else {
            modeNew();
        }
    }

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

        zActionPanel.addLeft( mFE.addEditRevertButton( createRevertButton() ) );
        zActionPanel.addCenter( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mFormBinder, this ) ) );
        zActionPanel.addRight( mFE.addEditSubmitButton( createSubmitButton( mDataProvider, mFormBinder, ViewDef.HOME ) ) );

        return zActionPanel;
    }

    @Override
    public void viewUpdated( TaskView pTaskView ) {
        modeEdit( pTaskView );
    }

    private void modeSearch() {
        mEditing = null;
        mFE.setMode( FormEngine.Mode.Search );
    }

    private void modeEdit( TaskView pTaskView ) {
        mEditing = pTaskView.getObjectURL();
        mFormBinder.setExistingObject( mDataProvider.copyIntoNewTS( pTaskView ), FormEngine.Mode.EditFromSearch );
    }

    private void modeNew() {
        mEditing = null;
        mFE.setNamedComponentValue( aCreatorFullName, null );
        mFormBinder.setNewObject( TaskView.createNew() );
    }
}

Commits for litesoft/trunk/Java/DATT/src/org/litesoft/datt/client/ui/views/stories/TasksDialog.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

565 Diff Diff markcmarkc Sun 13 Nov, 2011 21:45:35 +0000
539 Diff Diff markcmarkc Mon 03 Oct, 2011 00:35:01 +0000
496 Diff Diff GeorgeS picture GeorgeS Sun 11 Sep, 2011 16:58:00 +0000
430 GeorgeS picture GeorgeS Sat 20 Aug, 2011 19:46:21 +0000