gwt/3.3/examples/PubnubExample/src/com/pubnub/gwt/examples/client/PubnubExample.java
/**
     * This is the entry point method.
     */
This is the entry point method.
This is the entry point method .
public void onModuleLoad() {
        final Pubnub pubnub;
        pubnub = Pubnub.init();
        final Label errorLabel = new Label();
        RootPanel rootPanel = RootPanel.get("nameFieldContainer");
        RootPanel.get("errorLabelContainer").add(errorLabel);
        final TabPanel tabPanel = new TabPanel();
        rootPanel.add(tabPanel, 10, 66);
        final ExamplePanel panelHereNow = new ExamplePanel(new HTML("", true));
        final ExamplePanel panelSubscribe = new ExamplePanel(new HTML("", true));
        final ExamplePanel panelTimeUuid = new ExamplePanel(new HTML("", true));
        final ExamplePanel panelDetailedHistory = new ExamplePanel(new HTML("", true));
        final ExamplePanel panelHistory = new ExamplePanel(new HTML("", true));
        final ExamplePanel panelPublish = new ExamplePanel(new HTML("", true));
        tabPanel.add(panelPublish, "Publish", false);
        tabPanel.add(panelHistory, "History", false);
        tabPanel.add(panelDetailedHistory, "Detailed History", false);
        tabPanel.add(panelSubscribe, "Subscribe & Presence", false);
        tabPanel.add(panelHereNow, "Here Now", false);
        tabPanel.add(panelTimeUuid, "Time & UUID", false);
        HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
        rootPanel.add(horizontalPanel_1, 20, 16);
        horizontalPanel_1.setWidth("750px");
        horizontalPanel_1.setSpacing(10);
        Label lblNewLabel_1 = new Label("Channel");
        horizontalPanel_1.add(lblNewLabel_1);
        horizontalPanel_1.setCellVerticalAlignment(lblNewLabel_1, HasVerticalAlignment.ALIGN_MIDDLE);
        horizontalPanel_1.setCellHorizontalAlignment(lblNewLabel_1, HasHorizontalAlignment.ALIGN_CENTER);
        final TextBox txtChannel = new TextBox();
        txtChannel.setText("gwt_test");
        horizontalPanel_1.add(txtChannel);
        txtChannel.setWidth("175px");
        class ClearHandler implements ClickHandler {
            public void onClick(ClickEvent event) {
                for (int i = 0; i < tabPanel.getWidgetCount(); i++) {
                    ExamplePanel ep = (ExamplePanel)tabPanel.getWidget(i);
                    if (ep.isVisible()) {
                        ep.clearHTML();
                    }
                }
            }
        }
        Button btnClearConsole = new Button("Clear Console");
        horizontalPanel_1.add(btnClearConsole);
        btnClearConsole.addClickHandler(new ClearHandler());
        setupPublishPanel(pubnub, panelPublish, txtChannel);
        setupSubscribePanel(pubnub, panelSubscribe, txtChannel);
        setupHistoryPanel(pubnub, panelHistory, txtChannel);
        setupDetailedHistoryPanel(pubnub, panelDetailedHistory, txtChannel);
        setupHereNowPanel(pubnub, panelHereNow, txtChannel);
        setupTimeUuidPanel(pubnub, panelTimeUuid, txtChannel);
        tabPanel.selectTab(0);
    }
public void onModuleLoad ( ) { final Pubnub pubnub ; pubnub = Pubnub . init ( ) ; final Label errorLabel = new Label ( ) ; RootPanel rootPanel = RootPanel . get ( "nameFieldContainer" ) ; RootPanel . get ( "errorLabelContainer" ) . add ( errorLabel ) ; final TabPanel tabPanel = new TabPanel ( ) ; rootPanel . add ( tabPanel , 10 , 66 ) ; final ExamplePanel panelHereNow = new ExamplePanel ( new HTML ( "" , true ) ) ; final ExamplePanel panelSubscribe = new ExamplePanel ( new HTML ( "" , true ) ) ; final ExamplePanel panelTimeUuid = new ExamplePanel ( new HTML ( "" , true ) ) ; final ExamplePanel panelDetailedHistory = new ExamplePanel ( new HTML ( "" , true ) ) ; final ExamplePanel panelHistory = new ExamplePanel ( new HTML ( "" , true ) ) ; final ExamplePanel panelPublish = new ExamplePanel ( new HTML ( "" , true ) ) ; tabPanel . add ( panelPublish , "Publish" , false ) ; tabPanel . add ( panelHistory , "History" , false ) ; tabPanel . add ( panelDetailedHistory , "Detailed History" , false ) ; tabPanel . add ( panelSubscribe , "Subscribe & Presence" , false ) ; tabPanel . add ( panelHereNow , "Here Now" , false ) ; tabPanel . add ( panelTimeUuid , "Time & UUID" , false ) ; HorizontalPanel horizontalPanel_1 = new HorizontalPanel ( ) ; rootPanel . add ( horizontalPanel_1 , 20 , 16 ) ; horizontalPanel_1 . setWidth ( "750px" ) ; horizontalPanel_1 . setSpacing ( 10 ) ; Label lblNewLabel_1 = new Label ( "Channel" ) ; horizontalPanel_1 . add ( lblNewLabel_1 ) ; horizontalPanel_1 . setCellVerticalAlignment ( lblNewLabel_1 , HasVerticalAlignment . ALIGN_MIDDLE ) ; horizontalPanel_1 . setCellHorizontalAlignment ( lblNewLabel_1 , HasHorizontalAlignment . ALIGN_CENTER ) ; final TextBox txtChannel = new TextBox ( ) ; txtChannel . setText ( "gwt_test" ) ; horizontalPanel_1 . add ( txtChannel ) ; txtChannel . setWidth ( "175px" ) ; class ClearHandler implements ClickHandler { public void onClick ( ClickEvent event ) { for ( int i = 0 ; i < tabPanel . getWidgetCount ( ) ; i ++ ) { ExamplePanel ep = ( ExamplePanel ) tabPanel . getWidget ( i ) ; if ( ep . isVisible ( ) ) { ep . clearHTML ( ) ; } } } } Button btnClearConsole = new Button ( "Clear Console" ) ; horizontalPanel_1 . add ( btnClearConsole ) ; btnClearConsole . addClickHandler ( new ClearHandler ( ) ) ; setupPublishPanel ( pubnub , panelPublish , txtChannel ) ; setupSubscribePanel ( pubnub , panelSubscribe , txtChannel ) ; setupHistoryPanel ( pubnub , panelHistory , txtChannel ) ; setupDetailedHistoryPanel ( pubnub , panelDetailedHistory , txtChannel ) ; setupHereNowPanel ( pubnub , panelHereNow , txtChannel ) ; setupTimeUuidPanel ( pubnub , panelTimeUuid , txtChannel ) ; tabPanel . selectTab ( 0 ) ; }
This is the entry point method.
This is the entry point method .
// Add the nameField and sendButton to the RootPanel" // Use RootPanel.get() to get the entire body element