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

import org.litesoft.GWT.client.pavsupport.*;
import org.litesoft.GWT.client.util.*;
import org.litesoft.GWT.client.widgets.*;
import org.litesoft.core.util.externalization.*;
import org.litesoft.sandbox.multimodule.client.foundation.places.*;
import org.litesoft.sandbox.multimodule.client.foundation.support.*;
import org.litesoft.sandbox.multimodule.client.main.home.*;

import com.google.gwt.core.client.*;
import com.google.gwt.user.client.*;
import com.google.gwt.user.client.ui.*;
import com.googlecode.gwtphonegap.client.*;

/**
 * Entry point classes define <code>onModuleLoad()</code>
 */
public class Main implements EntryPoint
{
    public static final String VERSION = "1.0";

    @Override
    public void onModuleLoad()
    {
        System.out.println( "Main.onModuleLoad" );
        MasterE13nResolverAccessor.setResolver( DefaultResolver.INSTANCE );

        ActivityFactoryRegistry.register( new CachedViewSynchronousActivityFactory<ClientFactory, HomeView, PlaceHome>( EnumPlaces.Home )
        {
            @Override
            public HomeView createView()
            {
                return new HomeViewImpl();
            }

            @Override
            public Activity createActivity( ClientFactory pCommonActivityParam, HomeView pView, PlaceHome pPlace )
            {
                return new HomeActivity( pCommonActivityParam, pView, pPlace );
            }
        } );

        GWT.setUncaughtExceptionHandler( new GWT.UncaughtExceptionHandler()
        {
            @Override
            public void onUncaughtException( Throwable e )
            {
                Window.alert( "uncaught: " + // e.getLocalizedMessage() );
                              e.getMessage() );
            }
        } );

        final PhoneGap phoneGap = GWT.create( PhoneGap.class );

        phoneGap.addHandler( new PhoneGapAvailableHandler()
        {
            @Override
            public void onPhoneGapAvailable( PhoneGapAvailableEvent event )
            {
                start( phoneGap );
            }
        } );

        phoneGap.addHandler( new PhoneGapTimeoutHandler()
        {
            @Override
            public void onPhoneGapTimeout( PhoneGapTimeoutEvent event )
            {
                Window.alert( "can not load Phone Gap\nvs " + VERSION );
            }
        } );

        phoneGap.initializePhoneGap();
    }

    private void start( PhoneGap pPhoneGap )
    {
        NeverEmptyHtmlEscapingLabel zMessageUserSinkLabel = new NeverEmptyHtmlEscapingLabel();
        SimplePanel zAppWidget = new SimplePanel();

        RootPanel.get( "CenteredContent" ).add( zAppWidget );
        RootPanel.get( "Message" ).add( zMessageUserSinkLabel );

        ClientFactoryImpl clientFactory = new ClientFactoryImpl( new StyledSafeTextMessageUserSink( zMessageUserSinkLabel ) );
        PlaceChangerWithCurrentUrlSupport pam = new PlaceActivityManager<ClientFactory>( zAppWidget, clientFactory );
        clientFactory.setPlaceChanger( pam );

        pam.goToCurrentUrl(); // Goes to the place represented on URL else default place
    }
}

Commits for litesoft/trunk/GWT_Sandbox/MultiModuleSingleSrc/main/src/org/litesoft/sandbox/multimodule/client/main/Main.java

Diff revisions: vs.
Revision Author Commited Message
778 Diff Diff GeorgeS picture GeorgeS Mon 16 Jul, 2012 00:55:41 +0000
749 Diff Diff GeorgeS picture GeorgeS Fri 06 Jul, 2012 00:11:43 +0000
733 Diff Diff GeorgeS picture GeorgeS Fri 22 Jun, 2012 04:27:16 +0000
713 Diff Diff GeorgeS picture GeorgeS Sat 09 Jun, 2012 22:47:07 +0000
695 Diff Diff GeorgeS picture GeorgeS Mon 28 May, 2012 16:41:00 +0000

Switch to PhoneGap

669 Diff Diff GeorgeS picture GeorgeS Sun 13 May, 2012 23:29:27 +0000
584 GeorgeS picture GeorgeS Fri 18 Nov, 2011 17:53:52 +0000