twitter/src/main/java/org/apidesign/html/demo/twitter/TwitterMain.java
author Jaroslav Tulach <jtulach@netbeans.org>
Tue, 13 Aug 2013 21:11:28 +0200
changeset 44 e3305312184c
permissions -rw-r--r--
Simplified, rewritten to 0.4 and made compilable on JDK8
jtulach@44
     1
/**
jtulach@44
     2
 * The MIT License (MIT)
jtulach@44
     3
 *
jtulach@44
     4
 * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jtulach@44
     5
 *
jtulach@44
     6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
jtulach@44
     7
 * of this software and associated documentation files (the "Software"), to deal
jtulach@44
     8
 * in the Software without restriction, including without limitation the rights
jtulach@44
     9
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
jtulach@44
    10
 * copies of the Software, and to permit persons to whom the Software is
jtulach@44
    11
 * furnished to do so, subject to the following conditions:
jtulach@44
    12
 *
jtulach@44
    13
 * The above copyright notice and this permission notice shall be included in
jtulach@44
    14
 * all copies or substantial portions of the Software.
jtulach@44
    15
 *
jtulach@44
    16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jtulach@44
    17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jtulach@44
    18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
jtulach@44
    19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
jtulach@44
    20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
jtulach@44
    21
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
jtulach@44
    22
 * THE SOFTWARE.
jtulach@44
    23
 */
jtulach@44
    24
package org.apidesign.html.demo.twitter;
jtulach@44
    25
jtulach@44
    26
import net.java.html.boot.BrowserBuilder;
jtulach@44
    27
jtulach@44
    28
/** Boots browser and then performs initialization when the HTML page
jtulach@44
    29
 * is ready.
jtulach@44
    30
 *
jtulach@44
    31
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jtulach@44
    32
 */
jtulach@44
    33
public class TwitterMain {
jtulach@44
    34
    private TwitterMain() {
jtulach@44
    35
    }
jtulach@44
    36
    
jtulach@44
    37
    public static void main(String... args) {
jtulach@44
    38
        BrowserBuilder.newBrowser().loadPage("pages/index.html")
jtulach@44
    39
            .invoke("onPageLoad", args).loadClass(TwitterMain.class)
jtulach@44
    40
            .showAndWait();
jtulach@44
    41
        System.exit(0);
jtulach@44
    42
    }
jtulach@44
    43
    
jtulach@44
    44
    public static void onPageLoad(String... args) {
jtulach@44
    45
        TwitterClient.init();
jtulach@44
    46
    }
jtulach@44
    47
}