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
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.*;
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.user.client.ui.*;

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

public class MergeStories extends ClickableViewObjectQBEscreenView<StoryView> implements StoryFindable,
                                                                                         StoryViewNames {
    private ObjectURL mStory0 = null;
    private ObjectURL mStory1 = null;

    @Override
    protected UriFragmentIdParams createRefreshParams() {
        return MergeStoriesFactory.encodeParams( new TwoStoryURLs( mStory0, mStory1 ) );
    }

    public MergeStories( String pSection, ViewDef pViewDef, TwoStoryURLs pTwoStoryURLs ) {
        super( title( pSection, pViewDef ), StoryViewDataProvider.getInstance() );

        if ( pTwoStoryURLs != null ) {
            mStory0 = pTwoStoryURLs.getStory0();
            mStory1 = pTwoStoryURLs.getStory1();
        }

        addStandardTitleBar();

        SizeableQBEboxedPanel zQBEboxedPanel = getQBEboxedPanel();

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

        WidgetCtrlMap zWidgetCtrlMap = StoryFieldsPanel.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<StoryView>( mFE, StoryViewMetaData.getInstance() );

        add( mFE.createSectionTitle( "From Story" ) );

        StoryFieldsPanel zStoryFieldsPanel = new StoryFieldsPanel( mFormBinder, mFE, null );

        add( zStoryFieldsPanel );
//        add( new SizeableSpacer().stretchable() );

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

    @Override
    public void aboutToShow() {
        super.aboutToShow();
        ObjectURL zStory = mStory0;
        modeSearch();
        StoryScreenViewHelper.requestOptionalStory( this, zStory, null );
    }

    @Override
    public void foundStory( StoryView pStoryView, Integer pRequestID ) {
        modeView( pStoryView );
    }

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

    @Override
    protected void processVO( StoryView pRowValue ) {
        if ( pRowValue != null ) {
            modeView( pRowValue );
        }
    }

    @Override
    public Widget getBottomBar() {
        RightHorizontalPanel zActionPanel = new RightHorizontalPanel();
        zActionPanel.add( mFE.addExistingUnchangedNextButton( true, ViewDefs.STORY_MERGE_STORIES_STEP_TWO, new UriFragmentIdParams.ScreenParamsFactory() {
            @Override
            public UriFragmentIdParams create( ViewDef pTarget ) {
                return MergeStoriesFactory.encodeParams( new TwoStoryURLs( mStory0, mStory1 ) );
//                return MergeStoriesStepTwoFactory.encodeParams( new TwoStoryURLs( mStory0, mStory1 ) );
            }
        } ) );
        return zActionPanel;
    }

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

    private void modeView( StoryView pStoryView ) {
        mStory0 = pStoryView.getObjectURL();
        mFormBinder.setExistingObject( pStoryView, FormEngine.Mode.ViewFromSearch );
    }
}

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

Diff revisions: vs.
Revision Author Commited Message
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
501 Diff Diff markcmarkc Sun 11 Sep, 2011 22:50:22 +0000

Added a customer

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