nbrwsr seems to work, merging to default branch
authorJaroslav Tulach <jtulach@netbeans.org>
Fri, 21 Mar 2014 15:03:56 +0100
changeset 1201f150d9e4815
parent 117 b5562abbf0f3
parent 119 11e5ac27a524
child 121 26c8dc62cb63
nbrwsr seems to work, merging to default branch
minesweeper/pom.xml
minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java
minesweeper/src/main/webapp/pages/index.html
     1.1 --- a/minesweeper/pom.xml	Thu Mar 20 14:31:28 2014 +0100
     1.2 +++ b/minesweeper/pom.xml	Fri Mar 21 15:03:56 2014 +0100
     1.3 @@ -74,6 +74,11 @@
     1.4      </dependency>
     1.5      <dependency>
     1.6          <groupId>org.netbeans.html</groupId>
     1.7 +        <artifactId>net.java.html</artifactId>
     1.8 +        <version>${net.java.html.version}</version>
     1.9 +    </dependency>
    1.10 +    <dependency>
    1.11 +        <groupId>org.netbeans.html</groupId>
    1.12          <artifactId>net.java.html.sound</artifactId>
    1.13          <version>${net.java.html.version}</version>
    1.14      </dependency>
    1.15 @@ -83,6 +88,12 @@
    1.16          <version>${net.java.html.version}</version>
    1.17      </dependency>
    1.18      <dependency>
    1.19 +      <groupId>org.netbeans.html</groupId>
    1.20 +      <artifactId>nbrwsr</artifactId>
    1.21 +      <version>${net.java.html.version}</version>
    1.22 +      <scope>provided</scope>
    1.23 +    </dependency>
    1.24 +    <dependency>
    1.25        <groupId>org.testng</groupId>
    1.26        <artifactId>testng</artifactId>
    1.27        <version>6.7</version>
    1.28 @@ -367,5 +378,91 @@
    1.29                </plugins>
    1.30            </build>
    1.31        </profile>
    1.32 +      <profile>
    1.33 +          <id>nbrwsr</id>
    1.34 +          <dependencies>
    1.35 +              <dependency>
    1.36 +                  <groupId>org.netbeans.html</groupId>
    1.37 +                  <artifactId>nbrwsr</artifactId>
    1.38 +                  <version>${net.java.html.version}</version>
    1.39 +                  <scope>compile</scope>
    1.40 +              </dependency>
    1.41 +          </dependencies>
    1.42 +          <build>
    1.43 +              <plugins>
    1.44 +                  <plugin>
    1.45 +                      <groupId>org.apache.maven.plugins</groupId>
    1.46 +                      <artifactId>maven-resources-plugin</artifactId>
    1.47 +                      <version>2.6</version>
    1.48 +                      <executions>
    1.49 +                          <execution>
    1.50 +                              <id>include-webpages</id>
    1.51 +                              <goals>
    1.52 +                                  <goal>copy-resources</goal>
    1.53 +                              </goals>
    1.54 +                              <phase>process-resources</phase>
    1.55 +                              <configuration>
    1.56 +                                  <outputDirectory>${basedir}/target/classes/org/apidesign/demo/minesweeper</outputDirectory>
    1.57 +                                  <overwrite>true</overwrite>
    1.58 +                                  <resources>          
    1.59 +                                      <resource>
    1.60 +                                          <directory>src/main/webapp/pages</directory>
    1.61 +                                      </resource>
    1.62 +                                  </resources>              
    1.63 +                              </configuration>   
    1.64 +                          </execution>
    1.65 +                      </executions>
    1.66 +                  </plugin>
    1.67 +                  <plugin>
    1.68 +                      <groupId>org.codehaus.mojo</groupId>
    1.69 +                      <artifactId>nbm-maven-plugin</artifactId>
    1.70 +                      <version>3.13</version>
    1.71 +                      <extensions>true</extensions>
    1.72 +                      <executions>
    1.73 +                          <execution>
    1.74 +                              <id>default-manifest</id>
    1.75 +                              <phase>process-classes</phase>
    1.76 +                              <goals>
    1.77 +                                  <goal>manifest</goal>
    1.78 +                              </goals>
    1.79 +                              <configuration>
    1.80 +                                  <useOSGiDependencies>true</useOSGiDependencies>
    1.81 +                                  <brandingToken>html4j4nb</brandingToken>
    1.82 +                                  <cluster>html4j4nb</cluster>
    1.83 +                                  <verifyIntegrity>false</verifyIntegrity>
    1.84 +                              </configuration>
    1.85 +                          </execution>                       
    1.86 +                          <execution>
    1.87 +                              <id>default-nbm</id>
    1.88 +                              <phase>package</phase>
    1.89 +                              <goals>
    1.90 +                                  <goal>nbm</goal>
    1.91 +                              </goals>
    1.92 +                              <configuration>
    1.93 +                                  <useOSGiDependencies>true</useOSGiDependencies>
    1.94 +                                  <cluster>html4j4nb</cluster>
    1.95 +                                  <verifyIntegrity>false</verifyIntegrity>
    1.96 +                              </configuration>
    1.97 +                          </execution>
    1.98 +                      </executions>
    1.99 +                      <configuration>
   1.100 +                          <useOSGiDependencies>true</useOSGiDependencies>
   1.101 +                          <brandingToken>html4j4nb</brandingToken>
   1.102 +                          <cluster>html4j4nb</cluster>
   1.103 +                          <verifyIntegrity>false</verifyIntegrity>
   1.104 +                      </configuration>
   1.105 +                  </plugin>                      
   1.106 +
   1.107 +                  <plugin>
   1.108 +                      <groupId>org.apache.maven.plugins</groupId>
   1.109 +                      <artifactId>maven-jar-plugin</artifactId>
   1.110 +                      <configuration>
   1.111 +                          <!-- to have the jar plugin pickup the nbm generated manifest -->
   1.112 +                          <useDefaultManifestFile>true</useDefaultManifestFile>
   1.113 +                      </configuration>
   1.114 +                  </plugin>
   1.115 +              </plugins>
   1.116 +          </build>
   1.117 +      </profile>      
   1.118    </profiles>  
   1.119  </project>
     2.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java	Thu Mar 20 14:31:28 2014 +0100
     2.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/Main.java	Fri Mar 21 15:03:56 2014 +0100
     2.3 @@ -24,6 +24,10 @@
     2.4  package org.apidesign.demo.minesweeper;
     2.5  
     2.6  import net.java.html.boot.BrowserBuilder;
     2.7 +import org.netbeans.api.nbrwsr.OpenHTMLRegistration;
     2.8 +import org.openide.awt.ActionID;
     2.9 +import org.openide.awt.ActionReference;
    2.10 +import org.openide.awt.ActionReferences;
    2.11  
    2.12  
    2.13  /** Bootstrap and initialization. */
    2.14 @@ -40,4 +44,32 @@
    2.15              showAndWait();
    2.16          System.exit(0);
    2.17      }
    2.18 +    
    2.19 +    //
    2.20 +    // the following annotations generate registration for NetBeans,
    2.21 +    // they are harmless in other packaging schemes
    2.22 +    //
    2.23 +    
    2.24 +    @ActionID(
    2.25 +            category = "Games",
    2.26 +            id = "org.apidesign.demo.minesweeper"
    2.27 +    )
    2.28 +    @OpenHTMLRegistration(
    2.29 +        url="index.html",
    2.30 +        displayName = "Play Minesweeper!",
    2.31 +        iconBase = "org/apidesign/demo/minesweeper/ko4j.png"
    2.32 +    )
    2.33 +    @ActionReferences({
    2.34 +        @ActionReference(path = "Menu/Window"),
    2.35 +        @ActionReference(path = "Toolbars/Games")
    2.36 +    })
    2.37 +    //
    2.38 +    // end of NetBeans actions registration
    2.39 +    //
    2.40 +    
    2.41 +    /** Called when page is ready */
    2.42 +    public static void onPageLoad() throws Exception {
    2.43 +        Mines m = new Mines();
    2.44 +        m.applyBindings();
    2.45 +    }
    2.46  }
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/minesweeper/src/main/resources/org/apidesign/demo/minesweeper/index.html	Fri Mar 21 15:03:56 2014 +0100
     3.3 @@ -0,0 +1,10 @@
     3.4 +<html>
     3.5 +    <head>
     3.6 +        <title>Dummy Page</title>
     3.7 +        <meta charset="UTF-8">
     3.8 +        <meta name="viewport" content="width=device-width, initial-scale=1.0">
     3.9 +    </head>
    3.10 +    <body>
    3.11 +        <div>Opps, this is not what you wanted to see!</div>
    3.12 +    </body>
    3.13 +</html>
     4.1 Binary file minesweeper/src/main/resources/org/apidesign/demo/minesweeper/ko4j.png has changed
     5.1 --- a/minesweeper/src/main/webapp/pages/index.html	Thu Mar 20 14:31:28 2014 +0100
     5.2 +++ b/minesweeper/src/main/webapp/pages/index.html	Fri Mar 21 15:03:56 2014 +0100
     5.3 @@ -26,7 +26,7 @@
     5.4  <!DOCTYPE html>
     5.5  <html>
     5.6      <head>
     5.7 -        <title></title>
     5.8 +        <title>Minesweeper</title>
     5.9          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    5.10          <link href="bootstrap.css" rel="stylesheet">
    5.11          <link href="bootstrap-responsive.css" rel="stylesheet">