Adjusting to new naming scheme (which includes netbeans name) NbHtml4J
authorJaroslav Tulach <jtulach@netbeans.org>
Sun, 12 Jan 2014 23:25:42 +0100
branchNbHtml4J
changeset 579984b9f7d8c6
parent 56 68cecf6c3113
child 58 7036237a58cb
Adjusting to new naming scheme (which includes netbeans name)
chat/client/pom.xml
chat/client/src/main/java/org/apidesign/html/chatserver/client/ChatClient.java
chat/client/src/test/java/org/apidesign/html/chatserver/client/ChatClientTest.java
chat/model/pom.xml
chat/model/src/test/java/org/apidesign/html/chatserver/model/MessageImplTest.java
chat/pom.xml
chat/server/pom.xml
chat/server/src/main/java/org/apidesign/bck2brwsr/demo/chatserver/impl/ChatServerResource.java
chess/pom.xml
pom.xml
spinningcube/pom.xml
spinningcube/src/main/java/org/apidesign/demo/spinningcube/DataModel.java
twitter/nbactions.xml
twitter/pom.xml
twitter/src/main/assembly/fxbrwsr.xml
twitter/src/main/java/org/apidesign/html/demo/twitter/TwitterClient.java
twitter/src/main/java/org/apidesign/html/demo/twitter/TwitterMain.java
twitter/src/main/webapp/pages/index.html
twitter/src/main/webapp/pages/twitterExample.css
twitter/src/test/java/org/apidesign/html/demo/twitter/TwitterClientTest.java
words/pom.xml
     1.1 --- a/chat/client/pom.xml	Fri Dec 20 08:24:57 2013 +0100
     1.2 +++ b/chat/client/pom.xml	Sun Jan 12 23:25:42 2014 +0100
     1.3 @@ -79,7 +79,7 @@
     1.4  
     1.5    <dependencies>
     1.6      <dependency>
     1.7 -      <groupId>org.apidesign.html</groupId>
     1.8 +      <groupId>org.netbeans.html</groupId>
     1.9        <artifactId>net.java.html.json</artifactId>
    1.10        <version>${net.java.html.version}</version>
    1.11        <type>jar</type>
    1.12 @@ -112,9 +112,9 @@
    1.13          <scope>provided</scope>
    1.14      </dependency>
    1.15      <dependency>
    1.16 -        <groupId>org.apidesign.html</groupId>
    1.17 +        <groupId>org.apidesign.bck2brwsr</groupId>
    1.18          <artifactId>ko-bck2brwsr</artifactId>
    1.19 -        <version>${net.java.html.version}</version>
    1.20 +        <version>${bck2brwsr.version}</version>
    1.21          <scope>runtime</scope>
    1.22      </dependency>
    1.23    </dependencies>
     2.1 --- a/chat/client/src/main/java/org/apidesign/html/chatserver/client/ChatClient.java	Fri Dec 20 08:24:57 2013 +0100
     2.2 +++ b/chat/client/src/main/java/org/apidesign/html/chatserver/client/ChatClient.java	Sun Jan 12 23:25:42 2014 +0100
     2.3 @@ -24,7 +24,6 @@
     2.4  package org.apidesign.html.chatserver.client;
     2.5  
     2.6  import net.java.html.json.ComputedProperty;
     2.7 -import net.java.html.json.Context;
     2.8  import net.java.html.json.Function;
     2.9  import net.java.html.json.Model;
    2.10  import net.java.html.json.OnReceive;
    2.11 @@ -53,7 +52,7 @@
    2.12          if (!sendEnabled(m.getUser(), m.getComment())) {
    2.13              return;
    2.14          }
    2.15 -        Message msg = new Message(CNTX);
    2.16 +        Message msg = new Message();
    2.17          msg.setUser(m.getUser());
    2.18          msg.setComment(m.getComment());
    2.19          m.postComment(msg);
    2.20 @@ -89,10 +88,9 @@
    2.21          m.updateMsgs("" + (now + 1));
    2.22      }
    2.23      
    2.24 -    static final Context CNTX = Context.findDefault(ChatClient.class);
    2.25      static {
    2.26 -        ChatModel chm = new ChatModel(CNTX);
    2.27 -        Message m = new Message(CNTX);
    2.28 +        ChatModel chm = new ChatModel();
    2.29 +        Message m = new Message();
    2.30          m.setComment("Waiting for messages from the server...");
    2.31          m.setUser("system");
    2.32          chm.getMsgs().add(m);
     3.1 --- a/chat/client/src/test/java/org/apidesign/html/chatserver/client/ChatClientTest.java	Fri Dec 20 08:24:57 2013 +0100
     3.2 +++ b/chat/client/src/test/java/org/apidesign/html/chatserver/client/ChatClientTest.java	Sun Jan 12 23:25:42 2014 +0100
     3.3 @@ -23,7 +23,6 @@
     3.4   */
     3.5  package org.apidesign.html.chatserver.client;
     3.6  
     3.7 -import net.java.html.json.Context;
     3.8  import static org.testng.Assert.*;
     3.9  import org.testng.annotations.Test;
    3.10  
    3.11 @@ -36,7 +35,7 @@
    3.12      }
    3.13      
    3.14      @Test public void hasSendEnabled() {
    3.15 -        ChatModel m = new ChatModel(Context.EMPTY);
    3.16 +        ChatModel m = new ChatModel();
    3.17          assertFalse(m.isSendEnabled(), "By default disabled");
    3.18          m.setComment("some msg");
    3.19          m.setUser("by me");
     4.1 --- a/chat/model/pom.xml	Fri Dec 20 08:24:57 2013 +0100
     4.2 +++ b/chat/model/pom.xml	Sun Jan 12 23:25:42 2014 +0100
     4.3 @@ -17,7 +17,7 @@
     4.4    </properties>
     4.5    <dependencies>
     4.6      <dependency>
     4.7 -      <groupId>org.apidesign.html</groupId>
     4.8 +      <groupId>org.netbeans.html</groupId>
     4.9        <artifactId>net.java.html.json</artifactId>
    4.10        <version>${net.java.html.version}</version>
    4.11        <type>jar</type>
     5.1 --- a/chat/model/src/test/java/org/apidesign/html/chatserver/model/MessageImplTest.java	Fri Dec 20 08:24:57 2013 +0100
     5.2 +++ b/chat/model/src/test/java/org/apidesign/html/chatserver/model/MessageImplTest.java	Sun Jan 12 23:25:42 2014 +0100
     5.3 @@ -23,7 +23,6 @@
     5.4   */
     5.5  package org.apidesign.html.chatserver.model;
     5.6  
     5.7 -import net.java.html.json.Context;
     5.8  import static org.testng.Assert.*;
     5.9  import org.testng.annotations.Test;
    5.10  
    5.11 @@ -34,12 +33,12 @@
    5.12  public class MessageImplTest {
    5.13      
    5.14      @Test public void properlyConvertedToSeconds() {
    5.15 -        Message msg = new Message(Context.EMPTY);
    5.16 +        Message msg = new Message();
    5.17          msg.setSince(5143);
    5.18          assertEquals(msg.getAt(), "5s");
    5.19      }
    5.20      @Test public void properlyConvertedToMinutes() {
    5.21 -        Message msg = new Message(Context.EMPTY);
    5.22 +        Message msg = new Message();
    5.23          msg.setSince(63564);
    5.24          assertEquals(msg.getAt(), "1min");
    5.25      }
     6.1 --- a/chat/pom.xml	Fri Dec 20 08:24:57 2013 +0100
     6.2 +++ b/chat/pom.xml	Sun Jan 12 23:25:42 2014 +0100
     6.3 @@ -13,8 +13,8 @@
     6.4    <name>Chat Server with Jersey and Bck2Brwsr</name>
     6.5    <properties>
     6.6        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     6.7 -      <net.java.html.version>0.3</net.java.html.version>
     6.8 -      <bck2brwsr.version>0.7.2</bck2brwsr.version>
     6.9 +      <net.java.html.version>0.7-SNAPSHOT</net.java.html.version>
    6.10 +      <bck2brwsr.version>0.9-SNAPSHOT</bck2brwsr.version>
    6.11        <bck2brwsr.obfuscationlevel>MINIMAL</bck2brwsr.obfuscationlevel>
    6.12    </properties>
    6.13    <modules>
     7.1 --- a/chat/server/pom.xml	Fri Dec 20 08:24:57 2013 +0100
     7.2 +++ b/chat/server/pom.xml	Sun Jan 12 23:25:42 2014 +0100
     7.3 @@ -62,7 +62,7 @@
     7.4    </build>
     7.5    <dependencies>
     7.6      <dependency>
     7.7 -      <groupId>org.apidesign.html</groupId>
     7.8 +      <groupId>org.netbeans.html</groupId>
     7.9        <artifactId>net.java.html.json</artifactId>
    7.10        <version>${net.java.html.version}</version>
    7.11        <type>jar</type>
    7.12 @@ -70,7 +70,7 @@
    7.13      <dependency>
    7.14        <groupId>org.glassfish.jersey.media</groupId>
    7.15        <artifactId>html-json</artifactId>
    7.16 -      <version>2.1</version>
    7.17 +      <version>2.6-SNAPSHOT</version>
    7.18        <scope>runtime</scope>
    7.19      </dependency>
    7.20      <dependency>
    7.21 @@ -82,18 +82,18 @@
    7.22      <dependency>
    7.23        <groupId>org.glassfish.jersey.connectors</groupId>
    7.24        <artifactId>jersey-grizzly-connector</artifactId>
    7.25 -      <version>2.1</version>
    7.26 +      <version>2.4.1</version>
    7.27      </dependency>
    7.28      <dependency>
    7.29        <groupId>org.glassfish.jersey.containers</groupId>
    7.30        <artifactId>jersey-container-grizzly2-http</artifactId>
    7.31 -      <version>2.1</version>
    7.32 +      <version>2.6-SNAPSHOT</version>
    7.33        <type>jar</type>
    7.34      </dependency>
    7.35      <dependency>
    7.36        <groupId>org.glassfish.grizzly</groupId>
    7.37        <artifactId>grizzly-http-server</artifactId>
    7.38 -      <version>2.3.1</version>
    7.39 +      <version>2.3.8</version>
    7.40      </dependency>
    7.41      <dependency>
    7.42        <groupId>org.apidesign.html.demo</groupId>
    7.43 @@ -105,7 +105,7 @@
    7.44        <artifactId>javax.ws.rs-api</artifactId>
    7.45        <groupId>javax.ws.rs</groupId>
    7.46        <type>jar</type>
    7.47 -      <version>2.0-rc3</version>
    7.48 +      <version>2.0</version>
    7.49      </dependency>
    7.50    </dependencies>
    7.51  </project>
     8.1 --- a/chat/server/src/main/java/org/apidesign/bck2brwsr/demo/chatserver/impl/ChatServerResource.java	Fri Dec 20 08:24:57 2013 +0100
     8.2 +++ b/chat/server/src/main/java/org/apidesign/bck2brwsr/demo/chatserver/impl/ChatServerResource.java	Sun Jan 12 23:25:42 2014 +0100
     8.3 @@ -39,7 +39,6 @@
     8.4  import javax.ws.rs.container.AsyncResponse;
     8.5  import javax.ws.rs.container.Suspended;
     8.6  import javax.ws.rs.core.MediaType;
     8.7 -import net.java.html.json.Context;
     8.8  import org.apidesign.html.chatserver.model.Message;
     8.9  import org.apidesign.html.chatserver.model.Query;
    8.10  
    8.11 @@ -51,7 +50,7 @@
    8.12      
    8.13      private List<Message> msgs = new ArrayList<>();
    8.14      {
    8.15 -        Message welcome = new Message(Context.findDefault(Message.class));
    8.16 +        Message welcome = new Message();
    8.17          welcome.setUser("system");
    8.18          welcome.setComment("Welcome and enjoy!");
    8.19          welcome.setSince(10);
    8.20 @@ -65,7 +64,7 @@
    8.21          @QueryParam("since") @DefaultValue("0") long since,
    8.22          @Suspended AsyncResponse ar
    8.23      ) {
    8.24 -        Query q = new Query(Context.findDefault(ChatServerResource.class));
    8.25 +        Query q = new Query();
    8.26          for (Message m : msgs) {
    8.27              if (m.getSince()>= since) {
    8.28                  q.getMessages().add(m);
     9.1 --- a/chess/pom.xml	Fri Dec 20 08:24:57 2013 +0100
     9.2 +++ b/chess/pom.xml	Sun Jan 12 23:25:42 2014 +0100
     9.3 @@ -2,8 +2,8 @@
     9.4  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     9.5    <modelVersion>4.0.0</modelVersion>
     9.6      <parent>
     9.7 -    <artifactId>demo</artifactId>
     9.8 -    <groupId>org.apidesign.html</groupId>
     9.9 +        <artifactId>demo</artifactId>
    9.10 +        <groupId>org.apidesign.html</groupId>
    9.11          <version>1.0-SNAPSHOT</version>
    9.12      </parent>
    9.13  
    9.14 @@ -34,9 +34,9 @@
    9.15    <properties>
    9.16      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    9.17      <netbeans.compile.on.save>none</netbeans.compile.on.save>
    9.18 -    <net.java.html.version>0.6</net.java.html.version>
    9.19 -    <bck2brwsr.version>0.8</bck2brwsr.version>
    9.20 -    <bck2brwsr.launcher.version>0.8</bck2brwsr.launcher.version>
    9.21 +    <net.java.html.version>0.7-SNAPSHOT</net.java.html.version>
    9.22 +    <bck2brwsr.version>0.9-SNAPSHOT</bck2brwsr.version>
    9.23 +    <bck2brwsr.launcher.version>0.9-SNAPSHOT</bck2brwsr.launcher.version>
    9.24      <bck2brwsr.obfuscationlevel>MINIMAL</bck2brwsr.obfuscationlevel>
    9.25      <brwsr.startpage>pages/index.html</brwsr.startpage>
    9.26    </properties>
    9.27 @@ -58,7 +58,7 @@
    9.28                <configuration>
    9.29                    <archive>
    9.30                        <manifest>
    9.31 -                          <mainClass>org.apidesign.html.demo.chess.Main</mainClass>
    9.32 +                          <mainClass>org.netbeans.html.demo.chess.Main</mainClass>
    9.33                            <addClasspath>true</addClasspath>
    9.34                            <classpathPrefix>lib/</classpathPrefix>
    9.35                        </manifest>
    9.36 @@ -76,7 +76,7 @@
    9.37                            <value>${basedir}/src/main/webapp/</value>
    9.38                        </systemProperty>
    9.39                    </systemProperties>
    9.40 -                  <mainClass>org.apidesign.html.demo.chess.Main</mainClass>
    9.41 +                  <mainClass>org.netbeans.html.demo.chess.Main</mainClass>
    9.42                </configuration>
    9.43            </plugin>      
    9.44            <plugin>
    9.45 @@ -115,12 +115,12 @@
    9.46    </build>
    9.47    <dependencies>
    9.48      <dependency>
    9.49 -        <groupId>org.apidesign.html</groupId>
    9.50 +        <groupId>org.netbeans.html</groupId>
    9.51          <artifactId>net.java.html.json</artifactId>
    9.52          <version>${net.java.html.version}</version>
    9.53      </dependency>
    9.54      <dependency>
    9.55 -        <groupId>org.apidesign.html</groupId>
    9.56 +        <groupId>org.netbeans.html</groupId>
    9.57          <artifactId>net.java.html.boot</artifactId>
    9.58          <version>${net.java.html.version}</version>
    9.59      </dependency>
    9.60 @@ -131,7 +131,7 @@
    9.61        <scope>test</scope>
    9.62      </dependency>
    9.63      <dependency>
    9.64 -      <groupId>org.apidesign.html</groupId>
    9.65 +      <groupId>org.netbeans.html</groupId>
    9.66        <artifactId>net.java.html.sound</artifactId>
    9.67        <version>${net.java.html.version}</version>
    9.68        <type>jar</type>
    9.69 @@ -152,19 +152,19 @@
    9.70            </activation>
    9.71            <dependencies>
    9.72                <dependency>
    9.73 -                  <groupId>org.apidesign.html</groupId>
    9.74 -                  <artifactId>ko-fx</artifactId>
    9.75 +                  <groupId>org.netbeans.html</groupId>
    9.76 +                  <artifactId>ko4j</artifactId>
    9.77                    <version>${net.java.html.version}</version>
    9.78                    <scope>runtime</scope>
    9.79                </dependency>
    9.80                <dependency>
    9.81 -                  <groupId>org.apidesign.html</groupId>
    9.82 -                  <artifactId>boot-fx</artifactId>
    9.83 +                  <groupId>org.netbeans.html</groupId>
    9.84 +                  <artifactId>net.java.html.boot.fx</artifactId>
    9.85                    <version>${net.java.html.version}</version>
    9.86                    <scope>runtime</scope>
    9.87                </dependency>
    9.88                <dependency>
    9.89 -                  <groupId>org.apidesign.html</groupId>
    9.90 +                  <groupId>org.netbeans.html</groupId>
    9.91                    <artifactId>ko-ws-tyrus</artifactId>
    9.92                    <scope>runtime</scope>
    9.93                    <version>${net.java.html.version}</version>
    10.1 --- a/pom.xml	Fri Dec 20 08:24:57 2013 +0100
    10.2 +++ b/pom.xml	Sun Jan 12 23:25:42 2014 +0100
    10.3 @@ -13,11 +13,10 @@
    10.4    </parent>  
    10.5    <properties>
    10.6        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    10.7 -      <bck2brwsr.version>0.7</bck2brwsr.version>
    10.8 +      <bck2brwsr.version>0.9-SNAPSHOT</bck2brwsr.version>
    10.9        <license>COPYING</license>
   10.10    </properties>
   10.11    <modules>
   10.12 -    <module>twitter</module>
   10.13      <module>chat</module>
   10.14      <module>chess</module>
   10.15      <module>spinningcube</module>
    11.1 --- a/spinningcube/pom.xml	Fri Dec 20 08:24:57 2013 +0100
    11.2 +++ b/spinningcube/pom.xml	Sun Jan 12 23:25:42 2014 +0100
    11.3 @@ -26,7 +26,7 @@
    11.4  
    11.5    <properties>
    11.6      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    11.7 -    <net.java.html.version>0.4</net.java.html.version>
    11.8 +    <net.java.html.version>0.7-SNAPSHOT</net.java.html.version>
    11.9      <project.mainclass>org.apidesign.demo.spinningcube.Main</project.mainclass>
   11.10      <netbeans.compile.on.save>none</netbeans.compile.on.save>
   11.11    </properties>
   11.12 @@ -91,24 +91,24 @@
   11.13    </build>
   11.14    <dependencies>
   11.15      <dependency>
   11.16 -        <groupId>org.apidesign.html</groupId>
   11.17 +        <groupId>org.netbeans.html</groupId>
   11.18          <artifactId>net.java.html.json</artifactId>
   11.19          <version>${net.java.html.version}</version>
   11.20      </dependency>
   11.21      <dependency>
   11.22 -        <groupId>org.apidesign.html</groupId>
   11.23 +        <groupId>org.netbeans.html</groupId>
   11.24          <artifactId>net.java.html.boot</artifactId>
   11.25          <version>${net.java.html.version}</version>
   11.26      </dependency>
   11.27      <dependency>
   11.28 -        <groupId>org.apidesign.html</groupId>
   11.29 -        <artifactId>ko-fx</artifactId>
   11.30 +        <groupId>org.netbeans.html</groupId>
   11.31 +        <artifactId>ko4j</artifactId>
   11.32          <version>${net.java.html.version}</version>
   11.33          <scope>runtime</scope>
   11.34      </dependency>
   11.35      <dependency>
   11.36 -        <groupId>org.apidesign.html</groupId>
   11.37 -        <artifactId>boot-fx</artifactId>
   11.38 +        <groupId>org.netbeans.html</groupId>
   11.39 +        <artifactId>net.java.html.boot.fx</artifactId>
   11.40          <version>${net.java.html.version}</version>
   11.41          <scope>runtime</scope>
   11.42      </dependency>
    12.1 --- a/spinningcube/src/main/java/org/apidesign/demo/spinningcube/DataModel.java	Fri Dec 20 08:24:57 2013 +0100
    12.2 +++ b/spinningcube/src/main/java/org/apidesign/demo/spinningcube/DataModel.java	Sun Jan 12 23:25:42 2014 +0100
    12.3 @@ -23,6 +23,8 @@
    12.4   */
    12.5  package org.apidesign.demo.spinningcube;
    12.6  
    12.7 +import java.util.Arrays;
    12.8 +import java.util.List;
    12.9  import net.java.html.json.ComputedProperty;
   12.10  import net.java.html.json.Model;
   12.11  import net.java.html.json.Property;
   12.12 @@ -35,12 +37,12 @@
   12.13      @Property(name = "message", type = String.class),
   12.14  })
   12.15  final class DataModel {
   12.16 -    @ComputedProperty static String[] sides(String message) {
   12.17 +    @ComputedProperty static List<String> sides(String message) {
   12.18          String[] arr = new String[6];
   12.19          String[] words = message == null ? new String[0] : message.split(" ", 6);
   12.20          for (int i = 0; i < 6; i++) {
   12.21              arr[i] = words.length > i ? words[i] : "!";
   12.22          }
   12.23 -        return arr;
   12.24 +        return Arrays.asList(arr);
   12.25      }
   12.26  }
    13.1 --- a/twitter/nbactions.xml	Fri Dec 20 08:24:57 2013 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,45 +0,0 @@
    13.4 -<?xml version="1.0" encoding="UTF-8"?>
    13.5 -<!--
    13.6 -
    13.7 -    The MIT License (MIT)
    13.8 -
    13.9 -    Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
   13.10 -
   13.11 -    Permission is hereby granted, free of charge, to any person obtaining a copy
   13.12 -    of this software and associated documentation files (the "Software"), to deal
   13.13 -    in the Software without restriction, including without limitation the rights
   13.14 -    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   13.15 -    copies of the Software, and to permit persons to whom the Software is
   13.16 -    furnished to do so, subject to the following conditions:
   13.17 -
   13.18 -    The above copyright notice and this permission notice shall be included in
   13.19 -    all copies or substantial portions of the Software.
   13.20 -
   13.21 -    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   13.22 -    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   13.23 -    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   13.24 -    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   13.25 -    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   13.26 -    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   13.27 -    THE SOFTWARE.
   13.28 -
   13.29 --->
   13.30 -<actions>
   13.31 -    <action>
   13.32 -        <actionName>run</actionName>
   13.33 -        <goals>
   13.34 -            <goal>package</goal>
   13.35 -            <goal>exec:java</goal>
   13.36 -        </goals>
   13.37 -    </action>
   13.38 -    <action>
   13.39 -        <actionName>debug</actionName>
   13.40 -        <goals>
   13.41 -            <goal>package</goal>
   13.42 -            <goal>exec:java</goal>
   13.43 -        </goals>
   13.44 -        <properties>
   13.45 -            <jpda.listen>maven</jpda.listen>
   13.46 -        </properties>
   13.47 -    </action>
   13.48 -</actions>
    14.1 --- a/twitter/pom.xml	Fri Dec 20 08:24:57 2013 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,126 +0,0 @@
    14.4 -<?xml version="1.0" encoding="UTF-8"?>
    14.5 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    14.6 -  <modelVersion>4.0.0</modelVersion>
    14.7 -
    14.8 -  <groupId>org.apidesign.html.demo</groupId>
    14.9 -  <artifactId>twitter</artifactId>
   14.10 -  <version>1.0-SNAPSHOT</version>
   14.11 -  <packaging>jar</packaging>
   14.12 -  <parent>
   14.13 -      <groupId>org.apidesign.html</groupId>
   14.14 -      <artifactId>demo</artifactId>
   14.15 -      <version>1.0-SNAPSHOT</version>
   14.16 -  </parent>
   14.17 -
   14.18 -  <name>KO4Java's Twttr</name>
   14.19 -  <description>
   14.20 -      Rewrite of knockout.js example to use model written in Java displayed
   14.21 -      by HTML.
   14.22 -  </description>
   14.23 -
   14.24 -  <properties>
   14.25 -    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   14.26 -    <net.java.html.version>0.6</net.java.html.version>
   14.27 -    <project.mainclass>org.apidesign.html.demo.twitter.TwitterMain</project.mainclass>
   14.28 -  </properties>
   14.29 -
   14.30 -  <pluginRepositories>
   14.31 -      <pluginRepository>
   14.32 -          <id>java.net</id>
   14.33 -          <name>Java.net</name>
   14.34 -          <url>https://maven.java.net/content/repositories/releases/</url>
   14.35 -      </pluginRepository>
   14.36 -  </pluginRepositories>
   14.37 -
   14.38 -  <build>
   14.39 -      <plugins>
   14.40 -          <plugin>
   14.41 -              <groupId>org.apache.maven.plugins</groupId>
   14.42 -              <artifactId>maven-compiler-plugin</artifactId>
   14.43 -              <version>2.3.2</version>
   14.44 -              <configuration>
   14.45 -                  <source>1.7</source>
   14.46 -                  <target>1.7</target>
   14.47 -              </configuration>
   14.48 -          </plugin>
   14.49 -          <plugin>
   14.50 -              <groupId>org.apache.maven.plugins</groupId>
   14.51 -              <artifactId>maven-surefire-plugin</artifactId>
   14.52 -              <version>2.14.1</version>
   14.53 -              <configuration>
   14.54 -                  <systemPropertyVariables>
   14.55 -                      <vmtest.brwsrs>${brwsr}</vmtest.brwsrs>
   14.56 -                  </systemPropertyVariables>
   14.57 -              </configuration>
   14.58 -          </plugin>
   14.59 -          <plugin>
   14.60 -              <groupId>org.codehaus.mojo</groupId>
   14.61 -              <artifactId>exec-maven-plugin</artifactId>
   14.62 -              <version>1.2.1</version>
   14.63 -              <configuration>
   14.64 -                  <systemProperties>
   14.65 -                      <systemProperty>
   14.66 -                          <key>browser.rootdir</key>
   14.67 -                          <value>${basedir}/src/main/webapp/</value>
   14.68 -                      </systemProperty>
   14.69 -                  </systemProperties>
   14.70 -                  <mainClass>${project.mainclass}</mainClass>
   14.71 -              </configuration>
   14.72 -          </plugin>      
   14.73 -          <plugin>
   14.74 -              <groupId>org.apache.maven.plugins</groupId>
   14.75 -              <artifactId>maven-jar-plugin</artifactId>
   14.76 -              <version>2.4</version>
   14.77 -              <configuration>
   14.78 -                  <archive>
   14.79 -                      <manifest>
   14.80 -                          <addClasspath>true</addClasspath>
   14.81 -                          <classpathPrefix>lib/</classpathPrefix>
   14.82 -                      </manifest>
   14.83 -                  </archive>
   14.84 -              </configuration>
   14.85 -          </plugin>
   14.86 -          <plugin>
   14.87 -              <groupId>org.apache.maven.plugins</groupId>
   14.88 -              <artifactId>maven-deploy-plugin</artifactId>
   14.89 -              <version>2.7</version>
   14.90 -              <configuration>
   14.91 -                  <skip>true</skip>
   14.92 -              </configuration>
   14.93 -          </plugin>      
   14.94 -      </plugins>
   14.95 -  </build>
   14.96 -
   14.97 -  <dependencies>
   14.98 -    <dependency>
   14.99 -      <groupId>org.testng</groupId>
  14.100 -      <artifactId>testng</artifactId>
  14.101 -      <version>6.5.2</version>
  14.102 -      <scope>test</scope>
  14.103 -    </dependency>
  14.104 -    <dependency>
  14.105 -      <groupId>org.apidesign.html</groupId>
  14.106 -      <artifactId>net.java.html.json</artifactId>
  14.107 -      <version>${net.java.html.version}</version>
  14.108 -      <type>jar</type>
  14.109 -    </dependency>
  14.110 -    <dependency>
  14.111 -      <groupId>org.apidesign.html</groupId>
  14.112 -      <artifactId>net.java.html.boot</artifactId>
  14.113 -      <version>${net.java.html.version}</version>
  14.114 -      <type>jar</type>
  14.115 -    </dependency>
  14.116 -    <dependency>
  14.117 -      <groupId>org.apidesign.html</groupId>
  14.118 -      <artifactId>boot-fx</artifactId>
  14.119 -      <version>${net.java.html.version}</version>
  14.120 -      <scope>runtime</scope>
  14.121 -    </dependency>
  14.122 -    <dependency>
  14.123 -      <groupId>org.apidesign.html</groupId>
  14.124 -      <artifactId>ko-fx</artifactId>
  14.125 -      <version>${net.java.html.version}</version>
  14.126 -      <scope>runtime</scope>
  14.127 -    </dependency>
  14.128 -  </dependencies>
  14.129 -</project>
    15.1 --- a/twitter/src/main/assembly/fxbrwsr.xml	Fri Dec 20 08:24:57 2013 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,48 +0,0 @@
    15.4 -<?xml version="1.0"?>
    15.5 -<!--
    15.6 -
    15.7 -    The MIT License (MIT)
    15.8 -
    15.9 -    Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
   15.10 -
   15.11 -    Permission is hereby granted, free of charge, to any person obtaining a copy
   15.12 -    of this software and associated documentation files (the "Software"), to deal
   15.13 -    in the Software without restriction, including without limitation the rights
   15.14 -    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   15.15 -    copies of the Software, and to permit persons to whom the Software is
   15.16 -    furnished to do so, subject to the following conditions:
   15.17 -
   15.18 -    The above copyright notice and this permission notice shall be included in
   15.19 -    all copies or substantial portions of the Software.
   15.20 -
   15.21 -    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   15.22 -    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   15.23 -    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   15.24 -    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   15.25 -    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   15.26 -    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   15.27 -    THE SOFTWARE.
   15.28 -
   15.29 --->
   15.30 -<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   15.31 -  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
   15.32 -  
   15.33 -  <id>fxbrwsr</id>
   15.34 -  <formats>
   15.35 -      <format>zip</format>
   15.36 -  </formats>
   15.37 -  <baseDirectory>${project.build.finalName}-fxbrwsr</baseDirectory>
   15.38 -  <dependencySets>
   15.39 -    <dependencySet>
   15.40 -        <useProjectArtifact>false</useProjectArtifact>
   15.41 -        <scope>runtime</scope>
   15.42 -        <outputDirectory>lib</outputDirectory>
   15.43 -    </dependencySet>
   15.44 -  </dependencySets> 
   15.45 -  <files>
   15.46 -    <file>
   15.47 -      <source>${project.build.directory}/${project.build.finalName}.jar</source>
   15.48 -      <outputDirectory>/</outputDirectory>
   15.49 -    </file>
   15.50 -  </files>
   15.51 -</assembly>
   15.52 \ No newline at end of file
    16.1 --- a/twitter/src/main/java/org/apidesign/html/demo/twitter/TwitterClient.java	Fri Dec 20 08:24:57 2013 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,205 +0,0 @@
    16.4 -/**
    16.5 - * The MIT License (MIT)
    16.6 - *
    16.7 - * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
    16.8 - *
    16.9 - * Permission is hereby granted, free of charge, to any person obtaining a copy
   16.10 - * of this software and associated documentation files (the "Software"), to deal
   16.11 - * in the Software without restriction, including without limitation the rights
   16.12 - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   16.13 - * copies of the Software, and to permit persons to whom the Software is
   16.14 - * furnished to do so, subject to the following conditions:
   16.15 - *
   16.16 - * The above copyright notice and this permission notice shall be included in
   16.17 - * all copies or substantial portions of the Software.
   16.18 - *
   16.19 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   16.20 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   16.21 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   16.22 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   16.23 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   16.24 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   16.25 - * THE SOFTWARE.
   16.26 - */
   16.27 -package org.apidesign.html.demo.twitter;
   16.28 -
   16.29 -import java.util.Arrays;
   16.30 -import java.util.List;
   16.31 -import net.java.html.json.ComputedProperty;
   16.32 -import net.java.html.json.Function;
   16.33 -import net.java.html.json.Model;
   16.34 -import net.java.html.json.OnPropertyChange;
   16.35 -import net.java.html.json.OnReceive;
   16.36 -import net.java.html.json.Property;
   16.37 -
   16.38 -/** Controller class for access to Twitter.
   16.39 - * 
   16.40 - * @author Jaroslav Tulach
   16.41 - */
   16.42 -@Model(className="TwitterModel", properties={
   16.43 -    @Property(name="savedLists", type=Tweeters.class, array = true),
   16.44 -    @Property(name="activeTweetersName", type=String.class),
   16.45 -    @Property(name="activeTweeters", type=String.class, array = true),
   16.46 -    @Property(name="userNameToAdd", type=String.class),
   16.47 -    @Property(name="currentTweets", type=Tweet.class, array = true),
   16.48 -    @Property(name="loading", type=boolean.class)
   16.49 -})
   16.50 -final class TwitterClient {
   16.51 -    @Model(className = "Tweeters", properties = {
   16.52 -        @Property(name="name", type = String.class),
   16.53 -        @Property(name="userNames", type = String.class, array = true)
   16.54 -    })
   16.55 -    static class Twttrs {
   16.56 -    }
   16.57 -    @Model(className = "Tweet", properties = {
   16.58 -        @Property(name = "from_user", type = String.class),
   16.59 -        @Property(name = "from_user_id", type = int.class),
   16.60 -        @Property(name = "profile_image_url", type = String.class),
   16.61 -        @Property(name = "text", type = String.class),
   16.62 -        @Property(name = "created_at", type = String.class),
   16.63 -    })
   16.64 -    static final class Twt {
   16.65 -        @ComputedProperty static String html(String text) {
   16.66 -            StringBuilder sb = new StringBuilder(320);
   16.67 -            for (int pos = 0;;) {
   16.68 -                int http = text.indexOf("http", pos);
   16.69 -                if (http == -1) {
   16.70 -                    sb.append(text.substring(pos));
   16.71 -                    return sb.toString();
   16.72 -                }
   16.73 -                int spc = text.indexOf(' ', http);
   16.74 -                if (spc == -1) {
   16.75 -                    spc = text.length();
   16.76 -                }
   16.77 -                sb.append(text.substring(pos, http));
   16.78 -                String url = text.substring(http, spc);
   16.79 -                sb.append("<a href='").append(url).append("'>").append(url).append("</a>");
   16.80 -                pos = spc;
   16.81 -            }
   16.82 -        }
   16.83 -        
   16.84 -        @ComputedProperty static String userUrl(String from_user) {
   16.85 -            return "http://twitter.com/" + from_user;
   16.86 -        }
   16.87 -    }
   16.88 -    @Model(className = "TwitterQuery", properties = {
   16.89 -        @Property(array = true, name = "results", type = Twt.class)
   16.90 -    })
   16.91 -    public static final class TwttrQr {
   16.92 -    }
   16.93 -    
   16.94 -    @OnReceive(url="{root}/search.json?{query}&callback={me}", jsonp="me")
   16.95 -    static void queryTweets(TwitterModel page, TwitterQuery q) {
   16.96 -        page.getCurrentTweets().clear();
   16.97 -        page.getCurrentTweets().addAll(q.getResults());
   16.98 -        page.setLoading(false);
   16.99 -    }
  16.100 -    
  16.101 -    @OnPropertyChange("activeTweetersName")
  16.102 -    static void changeTweetersList(TwitterModel model) {
  16.103 -        Tweeters people = findByName(model.getSavedLists(), model.getActiveTweetersName());        
  16.104 -        model.getActiveTweeters().clear();
  16.105 -        model.getActiveTweeters().addAll(people.getUserNames());
  16.106 -    }
  16.107 -    
  16.108 -    @OnPropertyChange({ "activeTweeters", "activeTweetersCount" })
  16.109 -    static void refreshTweets(TwitterModel model) {
  16.110 -        StringBuilder sb = new StringBuilder();
  16.111 -        sb.append("rpp=25&q=");
  16.112 -        String sep = "";
  16.113 -        for (String p : model.getActiveTweeters()) {
  16.114 -            sb.append(sep);
  16.115 -            sb.append("from:");
  16.116 -            sb.append(p);
  16.117 -            sep = " OR ";
  16.118 -        }
  16.119 -        model.setLoading(true);
  16.120 -        model.queryTweets("http://search.twitter.com", sb.toString());
  16.121 -    }
  16.122 -    
  16.123 -    static void init() {
  16.124 -        final TwitterModel model = new TwitterModel();
  16.125 -        final List<Tweeters> svdLst = model.getSavedLists();
  16.126 -        svdLst.add(newTweeters("API Design", "JaroslavTulach"));
  16.127 -        svdLst.add(newTweeters("Celebrities", "JohnCleese", "MCHammer", "StephenFry", "algore", "StevenSanderson"));
  16.128 -        svdLst.add(newTweeters("Microsoft people", "BillGates", "shanselman", "ScottGu"));
  16.129 -        svdLst.add(newTweeters("NetBeans", "GeertjanW","monacotoni", "NetBeans", "petrjiricka"));
  16.130 -        svdLst.add(newTweeters("Tech pundits", "Scobleizer", "LeoLaporte", "techcrunch", "BoingBoing", "timoreilly", "codinghorror"));
  16.131 -
  16.132 -        model.setActiveTweetersName("NetBeans");
  16.133 -
  16.134 -        model.applyBindings();
  16.135 -    }
  16.136 -    
  16.137 -    @ComputedProperty
  16.138 -    static boolean hasUnsavedChanges(List<String> activeTweeters, List<Tweeters> savedLists, String activeTweetersName) {
  16.139 -        Tweeters tw = findByName(savedLists, activeTweetersName);
  16.140 -        if (activeTweeters == null) {
  16.141 -            return false;
  16.142 -        }
  16.143 -        return !tw.getUserNames().equals(activeTweeters);
  16.144 -    }
  16.145 -    
  16.146 -    @ComputedProperty
  16.147 -    static int activeTweetersCount(List<String> activeTweeters) {
  16.148 -        return activeTweeters.size();
  16.149 -    }
  16.150 -    
  16.151 -    @ComputedProperty
  16.152 -    static boolean userNameToAddIsValid(
  16.153 -        String userNameToAdd, String activeTweetersName, List<Tweeters> savedLists, List<String> activeTweeters
  16.154 -    ) {
  16.155 -        return userNameToAdd != null && 
  16.156 -            userNameToAdd.matches("[a-zA-Z0-9_]{1,15}") &&
  16.157 -            !activeTweeters.contains(userNameToAdd);
  16.158 -    }
  16.159 -    
  16.160 -    @Function
  16.161 -    static void deleteList(TwitterModel model) {
  16.162 -        final List<Tweeters> sl = model.getSavedLists();
  16.163 -        sl.remove(findByName(sl, model.getActiveTweetersName()));
  16.164 -        if (sl.isEmpty()) {
  16.165 -            final Tweeters t = new Tweeters();
  16.166 -            t.setName("New");
  16.167 -            sl.add(t);
  16.168 -        }
  16.169 -        model.setActiveTweetersName(sl.get(0).getName());
  16.170 -    }
  16.171 -    
  16.172 -    @Function
  16.173 -    static void saveChanges(TwitterModel model) {
  16.174 -        Tweeters t = findByName(model.getSavedLists(), model.getActiveTweetersName());
  16.175 -        int indx = model.getSavedLists().indexOf(t);
  16.176 -        if (indx != -1) {
  16.177 -            t.setName(model.getActiveTweetersName());
  16.178 -            t.getUserNames().clear();
  16.179 -            t.getUserNames().addAll(model.getActiveTweeters());
  16.180 -        }
  16.181 -    }
  16.182 -    
  16.183 -    @Function
  16.184 -    static void addUser(TwitterModel model) {
  16.185 -        String n = model.getUserNameToAdd();
  16.186 -        model.getActiveTweeters().add(n);
  16.187 -    }
  16.188 -    @Function
  16.189 -    static void removeUser(String data, TwitterModel model) {
  16.190 -        model.getActiveTweeters().remove(data);
  16.191 -    }
  16.192 -    
  16.193 -    private static Tweeters findByName(List<Tweeters> list, String name) {
  16.194 -        for (Tweeters l : list) {
  16.195 -            if (l.getName() != null && l.getName().equals(name)) {
  16.196 -                return l;
  16.197 -            }
  16.198 -        }
  16.199 -        return list.isEmpty() ? new Tweeters() : list.get(0);
  16.200 -    }
  16.201 -    
  16.202 -    private static Tweeters newTweeters(String listName, String... userNames) {
  16.203 -        Tweeters t = new Tweeters();
  16.204 -        t.setName(listName);
  16.205 -        t.getUserNames().addAll(Arrays.asList(userNames));
  16.206 -        return t;
  16.207 -    }
  16.208 -}
    17.1 --- a/twitter/src/main/java/org/apidesign/html/demo/twitter/TwitterMain.java	Fri Dec 20 08:24:57 2013 +0100
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,47 +0,0 @@
    17.4 -/**
    17.5 - * The MIT License (MIT)
    17.6 - *
    17.7 - * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
    17.8 - *
    17.9 - * Permission is hereby granted, free of charge, to any person obtaining a copy
   17.10 - * of this software and associated documentation files (the "Software"), to deal
   17.11 - * in the Software without restriction, including without limitation the rights
   17.12 - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   17.13 - * copies of the Software, and to permit persons to whom the Software is
   17.14 - * furnished to do so, subject to the following conditions:
   17.15 - *
   17.16 - * The above copyright notice and this permission notice shall be included in
   17.17 - * all copies or substantial portions of the Software.
   17.18 - *
   17.19 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   17.20 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   17.21 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   17.22 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   17.23 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   17.24 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   17.25 - * THE SOFTWARE.
   17.26 - */
   17.27 -package org.apidesign.html.demo.twitter;
   17.28 -
   17.29 -import net.java.html.boot.BrowserBuilder;
   17.30 -
   17.31 -/** Boots browser and then performs initialization when the HTML page
   17.32 - * is ready.
   17.33 - *
   17.34 - * @author Jaroslav Tulach <jtulach@netbeans.org>
   17.35 - */
   17.36 -public class TwitterMain {
   17.37 -    private TwitterMain() {
   17.38 -    }
   17.39 -    
   17.40 -    public static void main(String... args) {
   17.41 -        BrowserBuilder.newBrowser().loadPage("pages/index.html")
   17.42 -            .invoke("onPageLoad", args).loadClass(TwitterMain.class)
   17.43 -            .showAndWait();
   17.44 -        System.exit(0);
   17.45 -    }
   17.46 -    
   17.47 -    public static void onPageLoad(String... args) {
   17.48 -        TwitterClient.init();
   17.49 -    }
   17.50 -}
    18.1 --- a/twitter/src/main/webapp/pages/index.html	Fri Dec 20 08:24:57 2013 +0100
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,97 +0,0 @@
    18.4 -<?xml version="1.0" encoding="UTF-8"?>
    18.5 -<!--
    18.6 -
    18.7 -    The MIT License (MIT)
    18.8 -
    18.9 -    Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
   18.10 -
   18.11 -    Permission is hereby granted, free of charge, to any person obtaining a copy
   18.12 -    of this software and associated documentation files (the "Software"), to deal
   18.13 -    in the Software without restriction, including without limitation the rights
   18.14 -    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   18.15 -    copies of the Software, and to permit persons to whom the Software is
   18.16 -    furnished to do so, subject to the following conditions:
   18.17 -
   18.18 -    The above copyright notice and this permission notice shall be included in
   18.19 -    all copies or substantial portions of the Software.
   18.20 -
   18.21 -    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   18.22 -    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   18.23 -    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   18.24 -    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   18.25 -    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   18.26 -    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   18.27 -    THE SOFTWARE.
   18.28 -
   18.29 --->
   18.30 -
   18.31 -<!--
   18.32 -    Copied from knockout.js Twitter example:
   18.33 -    http://knockoutjs.com/examples/twitter.html
   18.34 --->
   18.35 -
   18.36 -<!DOCTYPE html>
   18.37 -<html xmlns="http://www.w3.org/1999/xhtml">
   18.38 -    <head>
   18.39 -        <title>Html and Java Twitter</title>
   18.40 -    </head>
   18.41 -    <body>
   18.42 -        <link href='twitterExample.css' rel='Stylesheet' ></link>
   18.43 -        
   18.44 -        <style type='text/css'>
   18.45 -           .liveExample select { height: 1.7em; }
   18.46 -           .liveExample button { height: 2em; }
   18.47 -        </style>
   18.48 -        
   18.49 -        
   18.50 -        <h2>Bck2Brwsr's Twitter</h2>
   18.51 -        
   18.52 -        <p>
   18.53 -        This code is based on original <a href="http://knockoutjs.com/examples/twitter.html">knockout.js Twitter example</a> and
   18.54 -        uses almost unmodified HTML page. It just changes the model. It 
   18.55 -        is written in Java language and it is executed using the HotSpot
   18.56 -        virtual machine. The Java source code has about 190 lines and is available 
   18.57 -        <a href="http://source.apidesign.org/hg/bck2brwsr/file/7fc6b7e9c982/javaquery/demo-twitter/src/main/java/org/apidesign/bck2brwsr/demo/twitter/TwitterClient.java">here</a>
   18.58 -        - in fact it may even be more dense than the original JavaScript model.
   18.59 -        </p>
   18.60 -        
   18.61 -        <div class='liveExample'>
   18.62 -            <div class='configuration'>
   18.63 -                <div class='listChooser'>
   18.64 -                    <button data-bind='click: deleteList, enable: activeTweetersName'>Delete</button>
   18.65 -                    <button data-bind='click: saveChanges, enable: hasUnsavedChanges'>Save</button> 
   18.66 -                    <select data-bind='options: savedLists, optionsValue: "name", value: activeTweetersName'> </select>
   18.67 -                </div>
   18.68 -
   18.69 -                <p>Currently viewing <span data-bind='text: activeTweetersCount'> </span> user(s):</p>
   18.70 -                <div class='currentUsers' >
   18.71 -                    <ul data-bind='foreach: activeTweeters'>
   18.72 -                        <li>
   18.73 -                            <button data-bind='click: $root.removeUser'>Remove</button>
   18.74 -                            <div data-bind='text: $data'> </div>
   18.75 -                        </li>
   18.76 -                    </ul>
   18.77 -                </div>
   18.78 -
   18.79 -                <form data-bind='submit: addUser'>
   18.80 -                    <label>Add user:</label>
   18.81 -                    <input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: !userNameToAddIsValid() }' />
   18.82 -                    <button data-bind='enable: userNameToAddIsValid' type='submit'>Add</button>
   18.83 -                </form>
   18.84 -            </div>
   18.85 -            <div class='tweets'>
   18.86 -                <div class='loadingIndicator' data-bind="visible: loading">Loading...</div>
   18.87 -                <table data-bind='foreach: currentTweets' width='100%'>
   18.88 -                    <tr>
   18.89 -                        <td><img data-bind='attr: { src: profile_image_url }' /></td>
   18.90 -                        <td>
   18.91 -                            <a class='twitterUser' data-bind='attr: { href: userUrl }, text: from_user'> </a>
   18.92 -                            <span data-bind='html: html'> </span>
   18.93 -                            <div class='tweetInfo' data-bind='text: created_at'> </div>
   18.94 -                        </td>
   18.95 -                    </tr>
   18.96 -                </table>
   18.97 -            </div>
   18.98 -        </div>
   18.99 -    </body>
  18.100 -</html>
    19.1 --- a/twitter/src/main/webapp/pages/twitterExample.css	Fri Dec 20 08:24:57 2013 +0100
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,58 +0,0 @@
    19.4 -/**
    19.5 - * The MIT License (MIT)
    19.6 - *
    19.7 - * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
    19.8 - *
    19.9 - * Permission is hereby granted, free of charge, to any person obtaining a copy
   19.10 - * of this software and associated documentation files (the "Software"), to deal
   19.11 - * in the Software without restriction, including without limitation the rights
   19.12 - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   19.13 - * copies of the Software, and to permit persons to whom the Software is
   19.14 - * furnished to do so, subject to the following conditions:
   19.15 - *
   19.16 - * The above copyright notice and this permission notice shall be included in
   19.17 - * all copies or substantial portions of the Software.
   19.18 - *
   19.19 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   19.20 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   19.21 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   19.22 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   19.23 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   19.24 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   19.25 - * THE SOFTWARE.
   19.26 - */
   19.27 -
   19.28 -
   19.29 -
   19.30 -/*
   19.31 -    Copied from knockout.js Twitter example:
   19.32 -    http://knockoutjs.com/examples/twitter.html
   19.33 -*/
   19.34 -
   19.35 -.configuration, .tweets, .tweets td { font-family: Verdana; font-size: 13px; }
   19.36 -.configuration { background-color: #DEDEDE; border: 2px solid gray; float:left; height: 40em; width: 40%; padding: 0.5em; border-right-width:0; }
   19.37 -.tweets { width: 55%; border: 2px solid gray; height: 40em; overflow: scroll; overflow-x: hidden; background-color: Black; color: White; padding: 0.5em; position: relative; }
   19.38 -.tweets table { border-width: 0;}
   19.39 -.tweets tr { vertical-align: top; }
   19.40 -.tweets td { padding: 0.4em 0.3em 1em 0.4em; border-width: 0; }
   19.41 -.tweets img { width: 4em; }
   19.42 -.tweetInfo { color: Gray; font-size: 0.9em; }
   19.43 -.twitterUser { color: #77AAFF; text-decoration: none; font-size: 1.1em; font-weight: bold; }
   19.44 -input.invalid { border: 1px solid red !important; background-color: #FFAAAA !important; }
   19.45 -
   19.46 -.listChooser select, .listChooser button { vertical-align:top; }
   19.47 -.listChooser select { width: 60%; font-size:1.2em; height:1.4em; }
   19.48 -.listChooser button { width: 19%; height:1.68em; float:right; }
   19.49 -
   19.50 -.currentUsers { height: 28em; overflow-y: auto; overflow-x: hidden; }
   19.51 -.currentUsers button { float: right; height: 2.5em; margin: 0.1em; padding-left: 1em; padding-right: 1em; }
   19.52 -.currentUsers ul, .configuration li { list-style: none; margin: 0; padding: 0 }
   19.53 -.currentUsers li { height: 2.4em; font-size: 1.2em; background-color: #A7D0E3; border: 1px solid gray; margin-bottom: 0.3em; -webkit-border-radius: 5px; -moz-border-radius: 5px; -webkit-box-shadow: 0 0.2em 0.5em gray; -moz-box-shadow: 0 0.2em 0.5em gray; }
   19.54 -.currentUsers li div { padding: 0.6em; }
   19.55 -.currentUsers li:hover { background-color: #EEC; }
   19.56 -
   19.57 -.configuration form label { width: 25%; display: inline-block; text-align:right; overflow: hidden; }
   19.58 -.configuration form input { width:40%; font-size: 1.3em; border:1px solid silver; background-color: White; padding: 0.1em; }
   19.59 -.configuration form button { width: 20%; margin-left: 0.3em; height: 2em; }
   19.60 -
   19.61 -.loadingIndicator { position: absolute; top: 0.1em; left: 0.1em; font: 0.8em Arial; background-color: #229; color: White; padding: 0.2em 0.5em 0.2em 0.5em; }
    20.1 --- a/twitter/src/test/java/org/apidesign/html/demo/twitter/TwitterClientTest.java	Fri Dec 20 08:24:57 2013 +0100
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,73 +0,0 @@
    20.4 -/**
    20.5 - * The MIT License (MIT)
    20.6 - *
    20.7 - * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
    20.8 - *
    20.9 - * Permission is hereby granted, free of charge, to any person obtaining a copy
   20.10 - * of this software and associated documentation files (the "Software"), to deal
   20.11 - * in the Software without restriction, including without limitation the rights
   20.12 - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   20.13 - * copies of the Software, and to permit persons to whom the Software is
   20.14 - * furnished to do so, subject to the following conditions:
   20.15 - *
   20.16 - * The above copyright notice and this permission notice shall be included in
   20.17 - * all copies or substantial portions of the Software.
   20.18 - *
   20.19 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   20.20 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   20.21 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   20.22 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   20.23 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   20.24 - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   20.25 - * THE SOFTWARE.
   20.26 - */
   20.27 -package org.apidesign.html.demo.twitter;
   20.28 -
   20.29 -import java.util.List;
   20.30 -import static org.testng.Assert.*;
   20.31 -import org.testng.annotations.BeforeMethod;
   20.32 -import org.testng.annotations.Test;
   20.33 -
   20.34 -/** We can unit test the TwitterModel smoothly.
   20.35 - *
   20.36 - * @author Jaroslav Tulach <jtulach@netbeans.org>
   20.37 - */
   20.38 -public class TwitterClientTest {
   20.39 -    private TwitterModel model;
   20.40 -    
   20.41 -
   20.42 -    @BeforeMethod
   20.43 -    public void initModel() {
   20.44 -        model = new TwitterModel();
   20.45 -    }
   20.46 -
   20.47 -    @Test public void testIsValidToAdd() {
   20.48 -        model.setUserNameToAdd("Joe");
   20.49 -        Tweeters t = new Tweeters();
   20.50 -        t.setName("test");
   20.51 -        model.getSavedLists().add(t);
   20.52 -        model.setActiveTweetersName("test");
   20.53 -        
   20.54 -        assertTrue(model.isUserNameToAddIsValid(), "Joe is OK");
   20.55 -        TwitterClient.addUser(model);
   20.56 -        assertFalse(model.isUserNameToAddIsValid(), "Can't add Joe for the 2nd time");
   20.57 -        assertEquals(t.getUserNames().size(), 0, "Original tweeters list remains empty");
   20.58 -        
   20.59 -        List<String> mod = model.getActiveTweeters();
   20.60 -        assertTrue(model.isHasUnsavedChanges(), "We have modifications");
   20.61 -        assertEquals(mod.size(), 1, "One element in the list");
   20.62 -        assertEquals(mod.get(0), "Joe", "Its name is Joe");
   20.63 -        
   20.64 -        assertSame(model.getActiveTweeters(), mod, "Editing list is the modified one");
   20.65 -        
   20.66 -        TwitterClient.saveChanges(model);
   20.67 -        assertFalse(model.isHasUnsavedChanges(), "Does not have anything to save");
   20.68 -        
   20.69 -        assertSame(model.getActiveTweeters(), mod, "Still editing the old modified one");
   20.70 -    }
   20.71 -    
   20.72 -    @Test public void httpAtTheEnd() {
   20.73 -        String res = TwitterClient.Twt.html("Ahoj http://kuk");
   20.74 -        assertEquals(res, "Ahoj <a href='http://kuk'>http://kuk</a>");
   20.75 -    }
   20.76 -}
    21.1 --- a/words/pom.xml	Fri Dec 20 08:24:57 2013 +0100
    21.2 +++ b/words/pom.xml	Sun Jan 12 23:25:42 2014 +0100
    21.3 @@ -26,7 +26,7 @@
    21.4  
    21.5    <properties>
    21.6      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    21.7 -    <net.java.html.version>0.6</net.java.html.version>
    21.8 +    <net.java.html.version>0.7-SNAPSHOT</net.java.html.version>
    21.9      <project.mainclass>org.apidesign.demo.words.Main</project.mainclass>
   21.10      <netbeans.compile.on.save>none</netbeans.compile.on.save>
   21.11    </properties>
   21.12 @@ -91,24 +91,24 @@
   21.13    </build>
   21.14    <dependencies>
   21.15      <dependency>
   21.16 -        <groupId>org.apidesign.html</groupId>
   21.17 +        <groupId>org.netbeans.html</groupId>
   21.18          <artifactId>net.java.html.json</artifactId>
   21.19          <version>${net.java.html.version}</version>
   21.20      </dependency>
   21.21      <dependency>
   21.22 -        <groupId>org.apidesign.html</groupId>
   21.23 +        <groupId>org.netbeans.html</groupId>
   21.24          <artifactId>net.java.html.boot</artifactId>
   21.25          <version>${net.java.html.version}</version>
   21.26      </dependency>
   21.27      <dependency>
   21.28 -        <groupId>org.apidesign.html</groupId>
   21.29 -        <artifactId>ko-fx</artifactId>
   21.30 +        <groupId>org.netbeans.html</groupId>
   21.31 +        <artifactId>ko4j</artifactId>
   21.32          <version>${net.java.html.version}</version>
   21.33          <scope>runtime</scope>
   21.34      </dependency>
   21.35      <dependency>
   21.36 -        <groupId>org.apidesign.html</groupId>
   21.37 -        <artifactId>boot-fx</artifactId>
   21.38 +        <groupId>org.netbeans.html</groupId>
   21.39 +        <artifactId>net.java.html.boot.fx</artifactId>
   21.40          <version>${net.java.html.version}</version>
   21.41          <scope>runtime</scope>
   21.42      </dependency>