org.universAAL.support.utils.ui
Class Forms

Package class diagram package Forms
java.lang.Object
  extended by org.universAAL.support.utils.ui.Forms

public class Forms
extends Object

Helper shortcut class with static methods to generate all kinds of SimpleControls UI elements more quickly, directly usable from the add methods of the Simple UI Requests.

Example: Creating a dialog for selecting a light from a list and have commands for turning it on and off.

Dialog d=new Dialog(user,"Light interface");

d.add(Forms.out("-","Select one of the following lights"));

d.add(Forms.one(LIST_URI, "Lights",new String[]{"ligth1","light2","light3"}));

d.addSubmit(Forms.submit(SUBMIT_ON,"Turn On"));

d.addSubmit(Forms.submit(SUBMIT_OFF,"Turn Off"));

caller.sendUIRequest(d);

Author:
alfiva

Method Summary
static Area area(String ref, String label)
          Create a Area control.
static Check check(String ref, String label)
          Create a Area control.
static Media media(String label, String url)
          Create a Media control.
static SelectMulti multi(String ref, String label, String[] initialOptions)
          Create a SelectMulti control.
static SelectOne one(String ref, String label, String[] initialOptions)
          Create a SelectOne control.
static Out out(String label, String value)
          Create a Out control.
static SelectRange range(String ref, String label, int min, int max)
          Create a SelectRange control.
static SubmitCmd submit(String ref, String label)
          Create a SubmitCmd control.
static Text text(String ref, String label)
          Create a Text control.
static TriggerCmd trigger(String ref, String label)
          Create a TriggerCmd control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

area

public static Area area(String ref,
                        String label)
Create a Area control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.
Returns:
The Area

check

public static Check check(String ref,
                          String label)
Create a Area control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.
Returns:
The Area

media

public static Media media(String label,
                          String url)
Create a Media control.

Parameters:
label - The label text that identifies the output to the user.
url - The URL to the value to be displayed, from the Resource server.
Returns:
The Media

out

public static Out out(String label,
                      String value)
Create a Out control.

Parameters:
label - The label text that identifies the output to the user.
value - The output value to be displayed.
Returns:
The Out

range

public static SelectRange range(String ref,
                                String label,
                                int min,
                                int max)
Create a SelectRange control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.
min - The low end of the range that the value can get (inclusive)
max - The high end of the range that the value can get (inclusive)
Returns:
The SelectRange

multi

public static SelectMulti multi(String ref,
                                String label,
                                String[] initialOptions)
Create a SelectMulti control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.
initialOptions - An array of Strings that represent the different possible options to select.
Returns:
The SelectMulti

one

public static SelectOne one(String ref,
                            String label,
                            String[] initialOptions)
Create a SelectOne control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.
initialOptions - An array of Strings that represent the different possible options to select.
Returns:
The SelectOne

submit

public static SubmitCmd submit(String ref,
                               String label)
Create a SubmitCmd control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the submit to the user.
Returns:
The SubmitCmd

text

public static Text text(String ref,
                        String label)
Create a Text control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the input to the user.
Returns:
The Text

trigger

public static TriggerCmd trigger(String ref,
                                 String label)
Create a TriggerCmd control.

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.
label - The label text that identifies the submit to the user.
Returns:
The TriggerCmd


Copyright © 2014 universAAL Consortium. All Rights Reserved.