[tuxdroid-svn] r1352 - in software_suite_v2/software: . gadgets gadgets/HelloWorldGadget gadgets/He
Status: Beta
Brought to you by:
ks156
From: jerome <c2m...@c2...> - 2008-07-25 14:39:26
|
Author: jerome Date: 2008-07-25 16:39:18 +0200 (Fri, 25 Jul 2008) New Revision: 1352 Added: software_suite_v2/software/gadgets/ software_suite_v2/software/gadgets/HelloWorldGadget/ software_suite_v2/software/gadgets/HelloWorldGadget/branches/ software_suite_v2/software/gadgets/HelloWorldGadget/tags/ software_suite_v2/software/gadgets/HelloWorldGadget/tags/MyHelloWorldGadget.V-0.0.1.tgf software_suite_v2/software/gadgets/HelloWorldGadget/trunk/ software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.classpath software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.project software_suite_v2/software/gadgets/HelloWorldGadget/trunk/src/ software_suite_v2/software/gadgets/HelloWorldGadget/trunk/src/helloWorld.java Log: First complete gadget demo, included bidirectionnal parameters (you have to update gadgets framework). Added: software_suite_v2/software/gadgets/HelloWorldGadget/tags/MyHelloWorldGadget.V-0.0.1.tgf =================================================================== (Binary files differ) Property changes on: software_suite_v2/software/gadgets/HelloWorldGadget/tags/MyHelloWorldGadget.V-0.0.1.tgf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.classpath =================================================================== --- software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.classpath (rev 0) +++ software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.classpath 2008-07-25 14:39:18 UTC (rev 1352) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry combineaccessrules="false" kind="src" path="/tuxdroid-gadget-framework"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.project =================================================================== --- software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.project (rev 0) +++ software_suite_v2/software/gadgets/HelloWorldGadget/trunk/.project 2008-07-25 14:39:18 UTC (rev 1352) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>helloWorld</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: software_suite_v2/software/gadgets/HelloWorldGadget/trunk/src/helloWorld.java =================================================================== --- software_suite_v2/software/gadgets/HelloWorldGadget/trunk/src/helloWorld.java (rev 0) +++ software_suite_v2/software/gadgets/HelloWorldGadget/trunk/src/helloWorld.java 2008-07-25 14:39:18 UTC (rev 1352) @@ -0,0 +1,43 @@ + +import java.io.IOException; + +import com.kysoh.tuxdroid.gadget.framework.gadget.SimpleGadget; +import com.kysoh.tuxdroid.gadget.framework.gadget.SimpleGadgetConfiguration; + + +public class helloWorld extends SimpleGadget<helloWorld.HelloWorldConfiguration>{ + + //public class that manage a simple configuration. + public static class HelloWorldConfiguration extends SimpleGadgetConfiguration{ + + //Number of time that hello world will be sent. + private int counter = 1; //default value. + + //Allow to set how much time notification will be sent. + public void setCounter(int counter){ + this.counter = counter; + } + + //Send actual counter value. + public int getCounter(){ + return this.counter; + } + } + + //Configuration object. + + @Override + public void start() throws Exception { //gadget run part. + for(int i=0; i < this.configuration().getCounter(); i++){ + //Send something to say through gadget framework. + throwMessageNotification("Hello world"); + } + System.exit(0); + } + + public static void main(String[] args) throws InterruptedException, IOException { + //Stand alone behavior. + new helloWorld().boot(new HelloWorldConfiguration()); + } + +} |