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
package org.litesoft.sandbox.multimodule.groupback.client.back;

import org.litesoft.sandbox.infrastructure.client.*;
import org.litesoft.sandbox.infrastructure.client.widgets.*;
import org.litesoft.sandbox.multimodule.foundation.client.*;
import org.litesoft.sandbox.multimodule.foundation.client.support.*;
import org.litesoft.sandbox.multimodule.foundation.client.widgets.*;

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

public class BackViewImpl implements BackView,
                                     FaceSwitcher
{
    private final DieRotator mDieRotator = new DieRotator( this );
    private final Places mCenter = Places.Back;
    private final Widget mAsWidget;
    private Presenter mPresenter;
    private Long mLuckyId;

    public BackViewImpl()
    {
        String zSection = "BackGroup";
        VerticalPanel zPanel = new VerticalPanel();
        zPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
        zPanel.add( UtilsGwt.horizontal( new Label( "" + mCenter ), new Spacer().width( 10 ), new HelpWidget( zSection, "" + mCenter ) ) );
        zPanel.add( mDieRotator );
        zPanel.add( UtilsGwt.horizontal( new Spacer().width( 50 ), //
                                         new Button( "Home", createHomeClickHandler() ), //
                                         new Spacer().width( 220 ), //
                                         new HelpWidget( zSection, "Lucky" ), //
                                         new Spacer().width( 10 ), //
                                         new Button( "Feeling Lucky", createFeelingLuckyClickHandler() ) ) );
        mAsWidget = zPanel;
    }

    private ClickHandler createHomeClickHandler()
    {
        return new ClickHandler()
        {
            @Override
            public void onClick( ClickEvent event )
            {
                switchTo( Places.Home );
            }
        };
    }

    private ClickHandler createFeelingLuckyClickHandler()
    {
        return new ClickHandler()
        {
            @Override
            public void onClick( ClickEvent event )
            {
                switchTo( PlacesSupport.deNull( mLuckyId, mCenter.getOppositeFace() ) );
            }
        };
    }

    @Override
    public void setPresenter( Presenter pPresenter )
    {
        mDieRotator.setDie( (mPresenter = pPresenter).getDie() );
    }

    @Override
    public void setLuckyId( Long pLuckyId )
    {
        mLuckyId = pLuckyId;
    }

    @Override
    public Widget asWidget()
    {
        return mAsWidget;
    }

    @Override
    public void switchTo( Places pPlace )
    {
        mPresenter.goTo( PlacesSupport.createPlace( pPlace, (long) mCenter.getOppositeFace().ordinal() ) );
    }
}

Commits for litesoft/trunk/GWT_Sandbox/MultiModule/groupBack/src/org/litesoft/sandbox/multimodule/groupback/client/back/BackViewImpl.java

Diff revisions: vs.
Revision Author Commited Message
551 Diff Diff GeorgeS picture GeorgeS Tue 11 Oct, 2011 03:28:49 +0000
540 Diff Diff GeorgeS picture GeorgeS Mon 03 Oct, 2011 04:22:28 +0000
538 Diff Diff GeorgeS picture GeorgeS Sun 02 Oct, 2011 22:14:59 +0000
514 Diff Diff GeorgeS picture GeorgeS Thu 22 Sep, 2011 06:07:01 +0000
508 Diff Diff GeorgeS picture GeorgeS Sun 18 Sep, 2011 16:39:39 +0000

More progress on Multi

507 GeorgeS picture GeorgeS Thu 15 Sep, 2011 14:00:27 +0000