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.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.namesmodel; | |
import net.java.html.json.Model; | |
import net.java.html.json.Property; | |
import net.java.html.json.ComputedProperty; | |
@Model(targetId="", className="GreatDiv", properties={ | |
@Property(name = "a", type=int.class), | |
@Property(name = "b", 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.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.todos; | |
import net.java.html.json.*; | |
import java.util.List; | |
import java.util.ArrayList; | |
@Model(className="TodoUI", properties={ | |
@Property(name="todos", type=Todo.class, array=true), | |
@Property(name="todoText", 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.quiz; | |
import net.java.html.json.*; | |
@Model(className="UI", properties={ | |
@Property(name="all", type=boolean.class), | |
@Property(name="results", type=Task.class, array=true) | |
}) | |
class UICntrl { | |
static { | |
UI ui = new UI(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.namesmodel; | |
import net.java.html.json.Model; | |
import net.java.html.json.Property; | |
import net.java.html.json.Function; | |
@Model(className="Names", properties={ | |
@Property(name = "selectedName", type=String.class), | |
@Property(name = "names", type=String.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.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.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 { |
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 |
NewerOlder