|
@@ -1,71 +1,71 @@ |
1 |
|
- |
package org.litesoft.sandbox.multimodule.client.main.home; |
2 |
|
- |
|
3 |
|
- |
import org.litesoft.GWT.client.pavsupport.*; |
4 |
|
- |
import org.litesoft.GWT.client.util.*; |
5 |
|
- |
import org.litesoft.GWT.client.util.externalization.*; |
6 |
|
- |
import org.litesoft.sandbox.multimodule.client.foundation.places.*; |
7 |
|
- |
import org.litesoft.sandbox.multimodule.client.foundation.support.*; |
8 |
|
- |
|
9 |
|
- |
import com.google.gwt.event.dom.client.*; |
10 |
|
- |
import com.google.gwt.user.client.ui.*; |
11 |
|
- |
|
12 |
|
- |
import java.util.*; |
13 |
|
- |
|
14 |
|
- |
public class HomeViewImpl extends AbstractViewImpl<HomeView.Presenter> implements HomeView, |
15 |
|
- |
FaceSwitcher { |
16 |
|
- |
private final List<Widget> mButtons = new ArrayList<Widget>(); |
17 |
|
- |
private final Widget mAsWidget; |
18 |
|
- |
|
19 |
|
- |
public HomeViewImpl() { |
20 |
|
- |
Grid zPanel = new Grid( 6, 3 ) { |
21 |
|
- |
@Override |
22 |
|
- |
protected void onAttach() { |
23 |
|
- |
super.onAttach(); |
24 |
|
- |
SameSize.these( mButtons ); |
25 |
|
- |
} |
26 |
|
- |
}; |
27 |
|
- |
zPanel.setCellSpacing( 5 ); |
28 |
|
- |
|
29 |
|
- |
zPanel.setWidget( 0, 1, createButton( EnumPlaces.Top ) ); |
30 |
|
- |
|
31 |
|
- |
zPanel.setWidget( 1, 0, createButton( EnumPlaces.Left ) ); |
32 |
|
- |
zPanel.setWidget( 1, 1, createButton( EnumPlaces.Front ) ); |
33 |
|
- |
zPanel.setWidget( 1, 2, createButton( EnumPlaces.Right ) ); |
34 |
|
- |
|
35 |
|
- |
zPanel.setWidget( 2, 1, createButton( EnumPlaces.Bottom ) ); |
36 |
|
- |
|
37 |
|
- |
zPanel.setWidget( 3, 1, createButton( EnumPlaces.Back ) ); |
38 |
|
- |
|
39 |
|
- |
zPanel.setWidget( 3, 1, new HTML( " " ) ); |
40 |
|
- |
zPanel.setWidget( 3, 1, new Label( ExternalizedText.getInstance().get( "Xyzzy", "WTF" ) ) ); |
41 |
|
- |
|
42 |
|
- |
mAsWidget = zPanel; |
43 |
|
- |
} |
44 |
|
- |
|
45 |
|
- |
private Widget createButton( final EnumPlaces pPlaceId ) { |
46 |
|
- |
Button zButton = new Button( pPlaceId.name(), new ClickHandler() { |
47 |
|
- |
@Override |
48 |
|
- |
public void onClick( ClickEvent event ) { |
49 |
|
- |
switchTo( pPlaceId ); |
50 |
|
- |
} |
51 |
|
- |
} ); |
52 |
|
- |
mButtons.add( zButton ); |
53 |
|
- |
return zButton; |
54 |
|
- |
} |
55 |
|
- |
|
56 |
|
- |
@Override |
57 |
|
- |
public Widget asWidget() { |
58 |
|
- |
return mAsWidget; |
59 |
|
- |
} |
60 |
|
- |
|
61 |
|
- |
@Override |
62 |
|
- |
public void switchTo( EnumPlaces pPlace ) { |
63 |
|
- |
mPresenter.goForwardTo( EnumPlaces.createPlace( pPlace, null ) ); |
64 |
|
- |
// System.out.println( "HomeViewImpl.switchTo: " + mSample.locale() ); |
65 |
|
- |
// System.out.println( " helloWorld: " + mSample.getString( "helloWorld" ) ); |
66 |
|
- |
// System.out.println( " goodbyeWorld: " + mSample.getString( "goodbyeWorld" ) ); |
67 |
|
- |
new TextBox().setName( "xxx" ); |
68 |
|
- |
} |
69 |
|
- |
// |
70 |
|
- |
// private Sample mSample = GWT.create( Sample.class ); |
71 |
|
- |
} |
|
1 |
+ |
package org.litesoft.sandbox.multimodule.client.main.home; |
|
2 |
+ |
|
|
3 |
+ |
import org.litesoft.GWT.client.pavsupport.*; |
|
4 |
+ |
import org.litesoft.GWT.client.util.*; |
|
5 |
+ |
import org.litesoft.GWT.client.util.externalization.*; |
|
6 |
+ |
import org.litesoft.sandbox.multimodule.client.foundation.places.*; |
|
7 |
+ |
import org.litesoft.sandbox.multimodule.client.foundation.support.*; |
|
8 |
+ |
|
|
9 |
+ |
import com.google.gwt.event.dom.client.*; |
|
10 |
+ |
import com.google.gwt.user.client.ui.*; |
|
11 |
+ |
|
|
12 |
+ |
import java.util.*; |
|
13 |
+ |
|
|
14 |
+ |
public class HomeViewImpl extends AbstractViewImpl<HomeView.Presenter> implements HomeView, |
|
15 |
+ |
FaceSwitcher { |
|
16 |
+ |
private final List<Widget> mButtons = new ArrayList<Widget>(); |
|
17 |
+ |
private final Widget mAsWidget; |
|
18 |
+ |
|
|
19 |
+ |
public HomeViewImpl() { |
|
20 |
+ |
Grid zPanel = new Grid( 6, 3 ) { |
|
21 |
+ |
@Override |
|
22 |
+ |
protected void onAttach() { |
|
23 |
+ |
super.onAttach(); |
|
24 |
+ |
SameSize.these( mButtons ); |
|
25 |
+ |
} |
|
26 |
+ |
}; |
|
27 |
+ |
zPanel.setCellSpacing( 5 ); |
|
28 |
+ |
|
|
29 |
+ |
zPanel.setWidget( 0, 1, createButton( EnumPlaces.Top ) ); |
|
30 |
+ |
|
|
31 |
+ |
zPanel.setWidget( 1, 0, createButton( EnumPlaces.Left ) ); |
|
32 |
+ |
zPanel.setWidget( 1, 1, createButton( EnumPlaces.Front ) ); |
|
33 |
+ |
zPanel.setWidget( 1, 2, createButton( EnumPlaces.Right ) ); |
|
34 |
+ |
|
|
35 |
+ |
zPanel.setWidget( 2, 1, createButton( EnumPlaces.Bottom ) ); |
|
36 |
+ |
|
|
37 |
+ |
zPanel.setWidget( 3, 1, createButton( EnumPlaces.Back ) ); |
|
38 |
+ |
|
|
39 |
+ |
zPanel.setWidget( 3, 1, new HTML( " " ) ); |
|
40 |
+ |
zPanel.setWidget( 3, 1, new Label( ExternalizedText.getInstance().get( "Xyzzy", "WTF" ) ) ); |
|
41 |
+ |
|
|
42 |
+ |
mAsWidget = zPanel; |
|
43 |
+ |
} |
|
44 |
+ |
|
|
45 |
+ |
private Widget createButton( final EnumPlaces pPlaceId ) { |
|
46 |
+ |
Button zButton = new Button( pPlaceId.name(), new ClickHandler() { |
|
47 |
+ |
@Override |
|
48 |
+ |
public void onClick( ClickEvent event ) { |
|
49 |
+ |
switchTo( pPlaceId ); |
|
50 |
+ |
} |
|
51 |
+ |
} ); |
|
52 |
+ |
mButtons.add( zButton ); |
|
53 |
+ |
return zButton; |
|
54 |
+ |
} |
|
55 |
+ |
|
|
56 |
+ |
@Override |
|
57 |
+ |
public Widget asWidget() { |
|
58 |
+ |
return mAsWidget; |
|
59 |
+ |
} |
|
60 |
+ |
|
|
61 |
+ |
@Override |
|
62 |
+ |
public void switchTo( EnumPlaces pPlace ) { |
|
63 |
+ |
mPresenter.goForwardTo( EnumPlaces.createPlace( pPlace, null ) ); |
|
64 |
+ |
// System.out.println( "HomeViewImpl.switchTo: " + mSample.locale() ); |
|
65 |
+ |
// System.out.println( " helloWorld: " + mSample.getString( "helloWorld" ) ); |
|
66 |
+ |
// System.out.println( " goodbyeWorld: " + mSample.getString( "goodbyeWorld" ) ); |
|
67 |
+ |
new TextBox().setName( "xxx" ); |
|
68 |
+ |
} |
|
69 |
+ |
// |
|
70 |
+ |
// private Sample mSample = GWT.create( Sample.class ); |
|
71 |
+ |
} |