diff options
Diffstat (limited to 'web-gui/hello-world/source/class')
7 files changed, 244 insertions, 0 deletions
diff --git a/web-gui/hello-world/source/class/hello_world/Application.js b/web-gui/hello-world/source/class/hello_world/Application.js new file mode 100644 index 0000000..a8369bd --- /dev/null +++ b/web-gui/hello-world/source/class/hello_world/Application.js @@ -0,0 +1,96 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/* ************************************************************************ + +#asset(hello_world/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "hello_world" + */ +qx.Class.define("hello_world.Application", +{ + extend : qx.application.Standalone, + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + * + * @lint ignoreDeprecated(alert) + */ + main : function() + { + // Call super class + this.base(arguments); + + // Enable logging in debug variant + if (qx.core.Variant.isSet("qx.debug", "on")) + { + // support native logging capabilities, e.g. Firebug for Firefox + qx.log.appender.Native; + // support additional cross-browser console. Press F7 to toggle visibility + qx.log.appender.Console; + } + + /* + ------------------------------------------------------------------------- + Below is your actual application code... + ------------------------------------------------------------------------- + */ + + // Document is the application root + var doc = this.getRoot(); + + var helloLabel = new qx.ui.basic.Label("<waiting for hello>"); + doc.add(helloLabel, {left: 100, top: 50}); + + var echoEdit = new qx.ui.form.TextField(); + doc.add(echoEdit, {left: 100, top: 100, right: 300}); + + var echoButton = new new qx.ui.form.Button("Echo"); + doc.add(echoButton, {left: 320, top: 100}); + + var rpc = new qx.io.remote.Rpc("http://localhost:8080/", "com.pengutronix.jdb.Hello|/"); + + rpc.callAsync(function(result, error) { + if (error == null) { + helloLabel.setText(result); + } + else { + helloLabel.setText("Error: " + error); + } + }, "com.pengutronix.jdb.Hello.HelloWorld"); + + // Add an event listener + echoButton.addListener("execute", function(e) { + rpc.callAsync(function(result, error) { + if (error == null) { + echoLabel.setText(result); + } + else { + echoLabel.setText("Error: " + error); + } + }, "com.pengutronix.jdb.Hello.Echo", echoEdit.getValue()); + }); + } + } +}); diff --git a/web-gui/hello-world/source/class/hello_world/test/DemoTest.js b/web-gui/hello-world/source/class/hello_world/test/DemoTest.js new file mode 100644 index 0000000..2333e41 --- /dev/null +++ b/web-gui/hello-world/source/class/hello_world/test/DemoTest.js @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute <code>generate.py test</code> to generate a testrunner application + * and open it from <tt>test/index.html</tt> + * + * The methods that contain the tests are instance methods with a + * <code>test</code> prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * <tt>test</tt> folder. + */ +qx.Class.define("hello_world.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); diff --git a/web-gui/hello-world/source/class/hello_world/theme/Appearance.js b/web-gui/hello-world/source/class/hello_world/theme/Appearance.js new file mode 100644 index 0000000..ee5a135 --- /dev/null +++ b/web-gui/hello-world/source/class/hello_world/theme/Appearance.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("hello_world.theme.Appearance", +{ + extend : qx.theme.modern.Appearance, + + appearances : + { + } +});
\ No newline at end of file diff --git a/web-gui/hello-world/source/class/hello_world/theme/Color.js b/web-gui/hello-world/source/class/hello_world/theme/Color.js new file mode 100644 index 0000000..1cd7692 --- /dev/null +++ b/web-gui/hello-world/source/class/hello_world/theme/Color.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("hello_world.theme.Color", +{ + extend : qx.theme.modern.Color, + + colors : + { + } +});
\ No newline at end of file diff --git a/web-gui/hello-world/source/class/hello_world/theme/Decoration.js b/web-gui/hello-world/source/class/hello_world/theme/Decoration.js new file mode 100644 index 0000000..9dc79bc --- /dev/null +++ b/web-gui/hello-world/source/class/hello_world/theme/Decoration.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("hello_world.theme.Decoration", +{ + extend : qx.theme.modern.Decoration, + + decorations : + { + } +});
\ No newline at end of file diff --git a/web-gui/hello-world/source/class/hello_world/theme/Font.js b/web-gui/hello-world/source/class/hello_world/theme/Font.js new file mode 100644 index 0000000..957646d --- /dev/null +++ b/web-gui/hello-world/source/class/hello_world/theme/Font.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("hello_world.theme.Font", +{ + extend : qx.theme.modern.Font, + + fonts : + { + } +});
\ No newline at end of file diff --git a/web-gui/hello-world/source/class/hello_world/theme/Theme.js b/web-gui/hello-world/source/class/hello_world/theme/Theme.js new file mode 100644 index 0000000..3c07b4c --- /dev/null +++ b/web-gui/hello-world/source/class/hello_world/theme/Theme.js @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("hello_world.theme.Theme", +{ + meta : + { + color : hello_world.theme.Color, + decoration : hello_world.theme.Decoration, + font : hello_world.theme.Font, + icon : qx.theme.icon.Tango, + appearance : hello_world.theme.Appearance + } +});
\ No newline at end of file |