This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.favorite; | |
import net.java.html.json.*; | |
/** Generates class Projects with getter and setter for | |
* string property "name" and another for an array/a list | |
* of strings. | |
*/ | |
@Model(className="Projects", properties={ | |
@Property(name="name",type=String.class), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.lowlevel; | |
import net.java.html.js.JavaScriptBody; | |
final class Java2JsAndBack implements Runnable { | |
private int cnt = 0; | |
@Override public void run() { | |
String msg = "I was pressed"; | |
if (++cnt > 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.gists; | |
import java.util.Arrays; | |
import net.java.html.json.*; | |
@Model(className="UI", properties={ | |
@Property(name="user",type=String.class), | |
@Property(name="current",type=String.class), | |
@Property(name="names", type=String.class, array = true), | |
@Property(name="gists",type=Gist.class, array = true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.exception; | |
class ThrowException { | |
static { | |
if (true) throw new IllegalStateException("Hello World!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.ko4j; | |
import net.java.html.json.*; | |
@Model(className="Hello", properties={ | |
@Property(name="say", type=String.class) | |
}) | |
class HelloViaKO { | |
static { | |
Hello model = new Hello("Hello World!"); | |
model.applyBindings(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.duke2brwsr; | |
import net.java.html.json.*; | |
@Model(className = "Data", properties = { | |
@Property(name = "image", type = String.class), | |
@Property(name = "buttonText", type =String.class), | |
@Property(name = "on", type = boolean.class) | |
}) | |
class Duke2Brwsr { | |
static { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.muldiv; | |
import java.util.Random; | |
import net.java.html.json.ComputedProperty; | |
import net.java.html.json.Function; | |
import net.java.html.json.Model; | |
import net.java.html.json.Property; | |
/** Represents a computational quiz. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.factorial; | |
import java.math.BigInteger; | |
import net.java.html.json.*; | |
@Model(targetId="", className="UI", properties={ | |
/** n is the number we want to compute factorial | |
* when the Compute! button is pressed | |
*/ | |
@Property(name="n", type=int.class), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.histogram; | |
import java.util.ArrayList; | |
import java.util.List; | |
import net.java.html.json.ComputedProperty; | |
import net.java.html.json.Model; | |
import net.java.html.json.Property; | |
/** Model annotation generates class Data with | |
* one property for list of of numbers and read-only property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dew.demo.prime; | |
import net.java.html.json.Model; | |
import net.java.html.json.ComputedProperty; | |
import net.java.html.json.Property; | |
@Model(className="PrimeUI", properties={ | |
@Property(name="number", type=int.class), | |
}) | |
class PrimeDemo { |
OlderNewer