|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.middleware.rdf.Resource
org.universAAL.middleware.rdf.FinalizedResource
org.universAAL.middleware.ui.UIRequest
org.universAAL.support.utils.ui.low.SubDialog
public class SubDialog
A helper class that lets you build UIRequests easily so you can send them with your UICaller class. Just create an instance of this for the addressed user and add Simple Form Controls to it. This one specifically creates a SubDialog, which is an interaction unit between applications and users that is started by a pre-existing Dialog. SubDialogs take control of the whole interaction space (e.g. occupy the full screen) until they are dismissed by the application or another Dialog comes in front of them. When a SubDialog is finished, the interaction returns to the Dialog that triggered it. SubDialogs have two groups for Controls: The main Controls group is for any kind of control. The Submits group is only for Submits intended to end the dialog or lead to new dialogs.
Example: Creating a SubDialog for selecting a light from a list and have commands for turning it on and off.
Dialog sd=new Dialog(user,"Light interface",parent.getURI());
Out out=new Out("-","Select one of the following lights");
sd.add(out);
SelectOne list=new SelectOne(LIST_URI, "Lights");
list.setOptions(new String[]{"ligth1","light2","light3"});
sd.add(list);
SubmitCmd s1=new SubmitCmd(SUBMIT_ON,"Turn On");
sd.addSubmit(s1);
SubmitCmd s2=new SubmitCmd(SUBMIT_OFF,"Turn Off");
sd.addSubmit(s2);
caller.sendUIRequest(sd);
Notice that Simple Form Controls will be rendered in the same order as they
are added. Once they are added they can no longer be modified, so set all
their properties before adding them to the Dialog. Take into account however
that Simple Group controls need to be added to the Dialog BEFORE other
controls can be added to those Groups.
This is not necessarily faster nor better than the usual way of doing it with
Form and UIRequest. It's just an alternative way that might help those less
familiarized with universAAL.
Field Summary |
---|
Fields inherited from class org.universAAL.middleware.ui.UIRequest |
---|
MY_URI, PROP_ADDRESSED_USER, PROP_DIALOG_FORM, PROP_DIALOG_LANGUAGE, PROP_DIALOG_PRIORITY, PROP_DIALOG_PRIVACY_LEVEL, PROP_HAS_ACCESS_IMPAIRMENT, PROP_HAS_PREFERENCE, PROP_PRESENTATION_LOCATION, PROP_PRESENTATION_MODALITY, PROP_PRESENTATION_MODALITY_ALT, uAAL_UI_NAMESPACE |
Fields inherited from class org.universAAL.middleware.rdf.Resource |
---|
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, ns_delim_index, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, PROP_uAAL_INVOLVED_HUMAN_USER, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uAAL_NAMESPACE_PREFIX, uAAL_SERVICE_NAMESPACE, uAAL_VOCABULARY_NAMESPACE, uri |
Constructor Summary | |
---|---|
SubDialog(User user,
String title,
String parentDialogURI)
Use this helper class to create a UIRequest that is easy to use. |
|
SubDialog(User user,
String title,
String parentDialogURI,
LevelRating priority,
PrivacyLevel privacy)
Use this helper class to create a UIRequest that is easy to use. |
Method Summary | |
---|---|
String[] |
add(Control ctrl)
Add the given Simple Control UI element to this container. |
void |
addExtra(String property,
Object extra)
Add an extra property to the form used in this UI request. |
void |
addHidden(String ref,
Object hidden)
Add a hidden object so it is sent within the UI request, but not shown to the user. |
String |
addSubmit(SubmitCmd ctrl)
Add a Submit Form Control to the Submit group of the SubDialog. |
Methods inherited from class org.universAAL.middleware.ui.UIRequest |
---|
getAddressedUser, getAltPresentationModality, getDialogForm, getDialogID, getDialogLanguage, getDialogPriority, getDialogPrivacyLevel, getDialogType, getImpairments, getPreferences, getPresentationLocation, getPropSerializationType, matches, setAltPresentationModality, setCollectedInput, setImpairments, setPreferences, setPresentationLocation, setPresentationModality |
Methods inherited from class org.universAAL.middleware.rdf.FinalizedResource |
---|
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties |
Methods inherited from class org.universAAL.middleware.rdf.Resource |
---|
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, isWellFormed, literal, representsQualifiedURI, serializesAsXMLLiteral, setProperty, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SubDialog(User user, String title, String parentDialogURI)
user
- The user to which the request is addressed.title
- The title of the Dialog.parentDialogURI
- The URI of the Dialog that triggered this SubDialog.public SubDialog(User user, String title, String parentDialogURI, LevelRating priority, PrivacyLevel privacy)
user
- The user to which the request is addressed.title
- The title of the Dialog.parentDialogURI
- The URI of the Dialog that triggered this SubDialog.priority
- Set a custom priority for the SubDialog.privacy
- Set the required privacy level for the SubDialog.Method Detail |
---|
public String[] add(Control ctrl)
IContainer
add
in interface IContainer
ctrl
- The Simple Control UI element to be added.
public String addSubmit(SubmitCmd ctrl)
ctrl
- The Submit to add
public void addHidden(String ref, Object hidden)
uiresponse.getUserInput(new String[]{ref});
, being
ref
the one you used in this method.
ref
- The reference you will use to access the hidden object later
from the responsehidden
- The object you want to hidepublic void addExtra(String property, Object extra)
property
- The property of a Form that a certain Handler will inspect for
its own purposes.extra
- The value to be set into the property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |