org.universAAL.support.utils.ui
Class SubmitCmd

Package class diagram package SubmitCmd
java.lang.Object
  extended by org.universAAL.support.utils.ui.Control
      extended by org.universAAL.support.utils.ui.SubmitCmd
Direct Known Subclasses:
TriggerCmd

public class SubmitCmd
extends Control

Class representing a Submit UI element. Submits are commands that can be issued by the user, whether it's a button, spoken command or any other way, depending on the UI renderer.

Example render:

 [Label]
 

Author:
alfiva

Field Summary
protected  String confirmMessage
          Confirmation message for submit.
protected  int confirmType
          Type of confirmation message.
protected  Object h
          Hidden object associated with the submit
static String HIDDENREF
          Auxiliary property URI for the path to reach the hidden object.
protected  List l
          List of required mandatory inputs.
 
Fields inherited from class org.universAAL.support.utils.ui.Control
help, hint, label, MY_NAMESPACE, ref
 
Constructor Summary
SubmitCmd()
          Generic empty constructor.
SubmitCmd(String ref)
          Constructor with the reference of the submit to be used in request and response.
SubmitCmd(String ref, String label)
          Constructor with the reference of the submit to be used in request and response.
 
Method Summary
 void addMandatoryInput(InputControl input)
          Indicates that the InputControl passed as parameter must be filled with a value by the user before this Submit is pressed.
 String[] create(Group group)
          This method is for internal use of utils only.
 String getConfirmMessage()
          Get the confirmation message that will appear when this Submit is selected by the user.
 int getConfirmType()
          Get the type of confirmation message.
 void setConfirmMessage(String confirmMessage)
          Set the confirmation message that will appear when this Submit is selected by the user.
 void setConfirmMessage(String confirmMessage, int confirmType)
          Set the confirmation message that will appear when this Submit is selected by the user.
 void setConfirmType(int confirmType)
          Set the type of confirmation message.
 void setHiddenObject(Object hidden)
          Associate an object to a submit so it is sent within the UI request, but not shown to the user.
 
Methods inherited from class org.universAAL.support.utils.ui.Control
getHelp, getHint, getLabel, getReference, setHelp, setHint, setLabel, setReference, setReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

confirmMessage

protected String confirmMessage
Confirmation message for submit.


confirmType

protected int confirmType
Type of confirmation message.


l

protected List l
List of required mandatory inputs.


h

protected Object h
Hidden object associated with the submit


HIDDENREF

public static final String HIDDENREF
Auxiliary property URI for the path to reach the hidden object.

See Also:
Constant Field Values
Constructor Detail

SubmitCmd

public SubmitCmd()
Generic empty constructor. The Submit will be generated with default values (empty).


SubmitCmd

public SubmitCmd(String ref)
Constructor with the reference of the submit to be used in request and response. The reference is a single ID String. All other properties of the input are set to defaults (empty).

Parameters:
ref - The simple reference identifying the input. Set to null to auto-generate.

SubmitCmd

public SubmitCmd(String ref,
                 String label)
Constructor with the reference of the submit to be used in request and response. The reference is a single ID String.

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.
Method Detail

create

public String[] create(Group group)
Description copied from class: Control
This method is for internal use of utils only. It creates the actual official uaal control configured with the properties defined by this class. Once it is created it cannot be modified.

Specified by:
create in class Control
Parameters:
group - The UI group to which the control is being added.
Returns:
An array of Strings representing the property path used to identify the control in the response. This is only of interest for Input Controls. Submits and Triggers have only one String value. If the path has not been set manually by the time this method is called, an automatic one must be generated.

addMandatoryInput

public void addMandatoryInput(InputControl input)
Indicates that the InputControl passed as parameter must be filled with a value by the user before this Submit is pressed.

Parameters:
input - The InputControl to make mandatory for this Submit.

setHiddenObject

public void setHiddenObject(Object hidden)
Associate an object to a submit so it is sent within the UI request, but not shown to the user. When the UI response is being handled by the UI caller, this hidden input can be retrieved by calling uiresponse.getUserInput( new String[] { REFSUBMIT, SubmitCmd.HIDDENREF });

This is useful when you are building a list of items in a form, each of which has a Submit associated to them. You can use this method to know, later when handling the response, which item of the list had its Submit pressed. Tip: to do this it's useful that all the references of these listed submits start with the same string, so you can detect any of them when handling the response, and then get the exact submission ID for use as REFSUBMIT in the example above.

Parameters:
hidden - The InputControl to make mandatory for this Submit.

getConfirmMessage

public String getConfirmMessage()
Get the confirmation message that will appear when this Submit is selected by the user. Confirmation is for avoiding accidental selection of important Submits.

Returns:
The confirmation message.

setConfirmMessage

public void setConfirmMessage(String confirmMessage)
Set the confirmation message that will appear when this Submit is selected by the user. Confirmation is for avoiding accidental selection of important Submits.

Parameters:
confirmMessage - The confirmation message.

setConfirmMessage

public void setConfirmMessage(String confirmMessage,
                              int confirmType)
Set the confirmation message that will appear when this Submit is selected by the user. Confirmation is for avoiding accidental selection of important Submits.

Parameters:
confirmMessage - The confirmation message.
confirmType - The type of confirmation. One of org.universAAL.middleware.ui.rdf .Submit.CONFIRMATION_TYPE_OK_CANCEL (0) or org.universAAL.middleware .ui.rdf.Submit.CONFIRMATION_TYPE_YES_NO (1)

getConfirmType

public int getConfirmType()
Get the type of confirmation message.

Returns:
The type of confirmation. One of org.universAAL.middleware.ui.rdf .Submit.CONFIRMATION_TYPE_OK_CANCEL (0) or org.universAAL.middleware .ui.rdf.Submit.CONFIRMATION_TYPE_YES_NO (1)

setConfirmType

public void setConfirmType(int confirmType)
Set the type of confirmation message.

Parameters:
confirmType - The type of confirmation. One of org.universAAL.middleware.ui.rdf .Submit.CONFIRMATION_TYPE_OK_CANCEL (0) or org.universAAL.middleware .ui.rdf.Submit.CONFIRMATION_TYPE_YES_NO (1)


Copyright © 2014 universAAL Consortium. All Rights Reserved.