minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java
branchibrwsr
changeset 124 533c2be1747c
parent 123 17aafe5116d5
parent 120 1f150d9e4815
child 125 d7b40912b16d
     1.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java	Thu Mar 27 09:57:14 2014 +0100
     1.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java	Thu Mar 27 15:14:48 2014 +0100
     1.3 @@ -24,7 +24,10 @@
     1.4  package org.apidesign.demo.minesweeper;
     1.5  
     1.6  import net.java.html.boot.BrowserBuilder;
     1.7 -import org.apidesign.brwsr.IBrwsrPrsntr;
     1.8 +import org.netbeans.api.nbrwsr.OpenHTMLRegistration;
     1.9 +import org.openide.awt.ActionID;
    1.10 +import org.openide.awt.ActionReference;
    1.11 +import org.openide.awt.ActionReferences;
    1.12  
    1.13  
    1.14  /** Bootstrap and initialization. */
    1.15 @@ -34,14 +37,36 @@
    1.16  
    1.17      /** Launches the browser */
    1.18      public static void main(String... args) throws Exception {
    1.19 -        BrowserBuilder.newBrowser(new IBrwsrPrsntr()).
    1.20 +        BrowserBuilder.newBrowser(new org.apidesign.brwsr.IBrwsrPrsntr()).
    1.21              loadPage("pages/index.html").
    1.22 -            loadClass(Main.class).
    1.23 -            invoke("onPageLoad", args).
    1.24 +            loadClass(MinesModel.class).
    1.25 +            invoke("main", args).
    1.26              showAndWait();
    1.27          System.exit(0);
    1.28      }
    1.29      
    1.30 +    //
    1.31 +    // the following annotations generate registration for NetBeans,
    1.32 +    // they are harmless in other packaging schemes
    1.33 +    //
    1.34 +    
    1.35 +    @ActionID(
    1.36 +            category = "Games",
    1.37 +            id = "org.apidesign.demo.minesweeper"
    1.38 +    )
    1.39 +    @OpenHTMLRegistration(
    1.40 +        url="index.html",
    1.41 +        displayName = "Play Minesweeper!",
    1.42 +        iconBase = "org/apidesign/demo/minesweeper/ko4j.png"
    1.43 +    )
    1.44 +    @ActionReferences({
    1.45 +        @ActionReference(path = "Menu/Window"),
    1.46 +        @ActionReference(path = "Toolbars/Games")
    1.47 +    })
    1.48 +    //
    1.49 +    // end of NetBeans actions registration
    1.50 +    //
    1.51 +    
    1.52      /** Called when page is ready */
    1.53      public static void onPageLoad() throws Exception {
    1.54          Mines m = new Mines();