public class Dialog extends UIRequest implements IContainer
Dialog d=new Dialog(user,"Light interface");
Out out=new Out("-","Select one of the following lights");
d.add(out);
SelectOne list=new SelectOne(LIST_URI, "Lights");
list.setOptions(new String[]{"ligth1","light2","light3"});
d.add(list);
SubmitCmd s1=new SubmitCmd(SUBMIT_ON,"Turn On");
d.addSubmit(s1);
SubmitCmd s2=new SubmitCmd(SUBMIT_OFF,"Turn Off");
d.addSubmit(s2);
caller.sendUIRequest(d);
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.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, UI_NAMESPACE
ONLY_LOCAL_SCOPE, PROP_ORIG_SCOPE, PROP_SCOPES
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, NAMESPACE_PREFIX, ns_delim_index, PROP_INVOLVED_HUMAN_USER, 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, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, SERVICE_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uri, VOCABULARY_NAMESPACE
Constructor and Description |
---|
Dialog(User user,
String title)
Use this helper class to create a UIRequest that is easy to use.
|
Dialog(User user,
String title,
LevelRating priority,
PrivacyLevel privacy)
Use this helper class to create a UIRequest that is easy to use.
|
Dialog(User user,
String title,
Resource root)
Use this helper class to create a UIRequest that is easy to use.
|
Dialog(User user,
String title,
Resource root,
LevelRating priority,
PrivacyLevel privacy)
Use this helper class to create a UIRequest that is easy to use.
|
Modifier and Type | Method and Description |
---|---|
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 Dialog.
|
getAddressedUser, getAltPresentationModality, getDialogForm, getDialogID, getDialogLanguage, getDialogPriority, getDialogPrivacyLevel, getDialogType, getImpairments, getPreferences, getPresentationLocation, getPropSerializationType, matches, setAltPresentationModality, setCollectedInput, setImpairments, setPreferences, setPresentationLocation, setPresentationModality
addScope, clearScopes, getOriginScope, getScopes, isScoped, isSerializableTo, setOriginScope, setScope
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getOrConstructLabel, getResource, getResourceComment, getResourceLabel, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, isWellFormed, literal, representsQualifiedURI, serializesAsXMLLiteral, setProperty, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
public Dialog(User user, String title)
user
- The user to which the request is addressed.title
- The title of the Dialog.public Dialog(User user, String title, Resource root)
user
- The user to which the request is addressed.title
- The title of the Dialog.root
- The Resource to use as root for the contained Form Controls.public Dialog(User user, String title, LevelRating priority, PrivacyLevel privacy)
user
- The user to which the request is addressed.title
- The title of the Dialog.priority
- Set a custom priority for the Dialog.privacy
- Set the required privacy level for the Dialog.public Dialog(User user, String title, Resource root, LevelRating priority, PrivacyLevel privacy)
user
- The user to which the request is addressed.title
- The title of the Dialog.root
- The Resource to use as root for the contained Form Controls.priority
- Set a custom priority for the Dialog.privacy
- Set the required privacy level for the Dialog.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 addpublic 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.Copyright © 2018 universAAL Consortium. All rights reserved.