public interface UIComponentWriter extends UIBodyWriter, UIJavaScriptWriter, UIResourceLocator, UIDependencyRegisterer, UISessionContext
Modifier and Type | Method and Description |
---|---|
UIComponentWriter |
addButtonHelp(String aURL)
Displays a button with the help icon.
|
UIComponentWriter |
addButtonJavaScript(UIButtonSpecJSAction aJavaScriptButtonSpec)
Adds a button for a JavaScript command.
|
UIComponentWriter |
addButtonJavaScriptToggle(UIButtonSpecJSActionToggle aJavaScriptToggleButtonSpec)
Adds a toggle button for two JavaScript commands (toggle ON and toggle OFF).
|
void |
addUILabel(UIFormLabelSpec aLabelSpec)
Adds the specified label.
|
void |
addUserAvatar(UserReference aUserReference)
Displays the standard user avatar (a circle of 26px diameter with initials or image).
|
UIButtonSpecJSAction |
buildButtonPreview(String aURL)
Builds a preview button, using the standard "preview" label.
|
UIButtonSpecJSAction |
buildButtonPreview(String aURL,
UserMessage aLabel)
Builds a preview button with the specified label.
|
UIButtonSpecJSAction |
buildButtonPreview(UIHttpManagerComponent aWebComponent)
Builds a preview button using the standard "preview" label.
|
void |
endBorder()
Ends the border previously started by a
startBorder . |
void |
endExpandCollapseBlock()
Ends the expand/collapse block started by
startExpandCollapseBlock(UserMessage, boolean)
or startExpandCollapseBlock(UIExpandCollapseBlock) . |
void |
endFormGroup()
Ends the form group previously started and stops the indentation.
|
void |
endFormRow()
Ends the form row previously started.
|
void |
endTableFormRow()
Ends a table of form rows and form groups previously started.
|
UIExpandCollapseBlock |
newExpandCollapseBlock()
Returns a new expand/collapse block specification which, by default,
would be rendered collapsed with an empty label.
|
UIFormGroup |
newFormGroup(UIFormLabelSpec aLabelSpec)
Returns a new form group with the specified label.
|
UIFormRow |
newFormRow()
Returns a new form row, set with an empty icon and an empty label.
|
void |
startBorder(boolean isColored)
Starts a border.
|
void |
startBorder(boolean isColored,
UIFormLabelSpec aLabelSpec)
Starts a border with a caption.
|
void |
startBorder(boolean isColored,
UserMessage aCaption)
Starts a border with a caption.
|
String |
startExpandCollapseBlock(UIExpandCollapseBlock aBlock)
Starts an expand/collapse block from the given specification.
|
String |
startExpandCollapseBlock(UserMessage aCaption,
boolean collapsed)
Starts an expand/collapse block with a caption.
|
void |
startFormGroup(UIFormGroup aFormGroup)
Starts a form group by writing its label according to
the specified argument, an expand/collapse button,
and a form indentation.
|
void |
startFormGroup(UIFormLabelSpec aLabelSpec)
Starts a form group by writing its specified label,
an expand/collapse button, and a form indentation.
|
void |
startFormRow(UIFormLabelSpec aLabelSpec)
Starts a form row containing a label and some plain HTML content.
|
void |
startFormRow(UIFormLabelSpec aLabelSpec,
String anIconURL)
Starts a form row containing an icon, a label and some plain HTML content.
|
void |
startFormRow(UIFormLabelSpec aLabelSpec,
UIFormRowIcon aFormRowIcon)
Starts a form row containing an icon, a label and some plain HTML content.
|
void |
startFormRow(UIFormRow aFormRow)
Starts a form row by writing its icon and label according to
the specified argument.
|
void |
startTableFormRow()
Starts a table layout of form rows and form groups.
|
add_cr, add_cr, add, add, add, addSafeAttribute, addSafeAttribute, addSafeInnerHTML, addSafeInnerHTML
addJS_addResizeWorkspaceListener, addJS_cr, addJS_cr, addJS_openPreviewImage, addJS_openPreviewImageFromVar, addJS_setButtonDisabled, addJS_setExpandCollapseBlockExpanded, addJS_setStateToToggleButton, addJS_switchToPerspective, addJS_switchToPerspectiveAction, addJS
createWebComponentForRootSession, createWebComponentForSubSession, getURLForAjaxComponent, getURLForAjaxComponent, getURLForPerspectiveSelection, getURLForPerspectiveSelection, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForRest, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForViewSelection
addJavaScriptDependency
getLocale, getSession
UIComponentWriter addButtonHelp(String aURL)
Clicking on the button displays a help pop-up that opens the target URL.
In a user service, the context-sensitive help button can be enabled using
ServiceContext.setContextSensitiveHelpURL(String)
.
aURL
- the URL for the content of the pop-up.UIComponentWriter addButtonJavaScript(UIButtonSpecJSAction aJavaScriptButtonSpec)
aJavaScriptButtonSpec
- a JavaScript button specification.UIComponentWriter addButtonJavaScriptToggle(UIButtonSpecJSActionToggle aJavaScriptToggleButtonSpec)
aJavaScriptToggleButtonSpec
- a JavaScript toggle button specification.void addUILabel(UIFormLabelSpec aLabelSpec)
void addUserAvatar(UserReference aUserReference)
Directory.getUserAvatarURI(UserReference)
UIButtonSpecJSAction buildButtonPreview(String aURL)
aURL
- the URL for the content of the inner pop-up.buildButtonPreview(String, UserMessage)
UIButtonSpecJSAction buildButtonPreview(String aURL, UserMessage aLabel)
Clicking on the button opens the standard modal inner pop-up with the specified URL.
The returned object can be modified and added to the page
using the method addButtonJavaScript(UIButtonSpecJSAction)
.
The button can be modified in different ways,
such as setting the button to display only an icon using
UIButtonSpec#setButtonLayout
(UIButtonLayout.ICON_ONLY
).
Recommendations concerning the specified URL:
getURLForSelection
from the UIResourceLocator
should not be used, because the returned URLs change the state of the current session.
They must be invoked in the current window only, not in pop-ups.aURL
- the URL of the inner pop-up content.aLabel
- the label of the button.buildButtonPreview(UIHttpManagerComponent)
UIButtonSpecJSAction buildButtonPreview(UIHttpManagerComponent aWebComponent)
Clicking the button opens the standard modal inner pop-up with the specified
Web component
.
The returned object can be modified and added to the page
using the method addButtonJavaScript(UIButtonSpecJSAction)
.
The button can be modified in different ways,
such as setting the button to display only an icon using
UIButtonSpec#setButtonLayout
(UIButtonLayout.ICON_ONLY
).
If the UIHttpManagerComponent
has no
CloseButtonSpec
defined, it will be set as default to UIHttpManagerComponent.CloseButtonSpec.CROSS
.
If the UIHttpManagerComponent
has no
RedirectionURI
,
the preview pop-up will close when the user click on the close/logout button.
aWebComponent
- the web component
of the inner pop-up content.void startBorder(boolean isColored)
<fieldset>
.
Note: The border must be terminated using endBorder().
isColored
- true
to have a colored border,
false
to have a grey border.void startBorder(boolean isColored, UIFormLabelSpec aLabelSpec)
<fieldset>
with a <legend>
.
Note: The border must be terminated using endBorder().
isColored
- true
to have a colored border,
false
to have a grey border.aLabelSpec
- the border label.void startBorder(boolean isColored, UserMessage aCaption)
<fieldset>
with a <legend>
.
Note: The border must be terminated using endBorder().
isColored
- true
to have a colored border,
false
to have a gray border.aCaption
- a UserMessage
to enable caption.void endBorder()
startBorder
.UIExpandCollapseBlock newExpandCollapseBlock()
After having fully configured it, write it into a form thanks to
startExpandCollapseBlock(UIExpandCollapseBlock)
.
When components ordering is dynamic over pages refresh
(that is, their order depends on the record state, or any other parameter),
it is recommended to set a stable identifier with UIExpandCollapseBlock.setId(String)
to ensure the block state remains the same if the page
is redisplayed after a page submit.
String startExpandCollapseBlock(UIExpandCollapseBlock aBlock)
Note: The expand/collapse block must be terminated using endExpandCollapseBlock().
The returned id
is the one previously set
by UIExpandCollapseBlock.setId(String)
, or a randomly generated one.
This id can be used with
UIJavaScriptWriter.addJS_setExpandCollapseBlockExpanded(String, String)
.
aBlock
- the expand/collapse block specificationString startExpandCollapseBlock(UserMessage aCaption, boolean collapsed)
Note: The expand/collapse block must be terminated using endExpandCollapseBlock().
When components ordering is dynamic over pages refresh
(that is, their order depends on the record state, or any other parameter),
please prefer startExpandCollapseBlock(UIExpandCollapseBlock)
and set a stable identifier with UIExpandCollapseBlock.setId(String)
to ensure the block state remains the same if the page
is redisplayed after a page submit.
aCaption
- the caption of the block (always displayed).collapsed
- true
to have the block initially collapsed,
false
to have the block initially expanded.UIJavaScriptWriter.addJS_setExpandCollapseBlockExpanded(String, String)
.void endExpandCollapseBlock()
startExpandCollapseBlock(UserMessage, boolean)
or startExpandCollapseBlock(UIExpandCollapseBlock)
.UIFormRow newFormRow()
UIFormWriter.newFormRow(Path)
void startFormRow(UIFormLabelSpec aLabelSpec)
It is strongly recommended to surround form rows with
startTableFormRow()
and
endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form row must be ended with endFormRow() after creating its HTML content.
aLabelSpec
- the row label.startFormRow(UIFormRow)
,
UIResponseContext.startFormRow(Path)
,
UIFormWriter.startFormRow(Path)
void startFormRow(UIFormLabelSpec aLabelSpec, String anIconURL)
It is strongly recommended to surround form rows with
startTableFormRow()
and
endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form row must be ended with endFormRow() after creating its HTML content.
aLabelSpec
- the row label.anIconURL
- a custom icon URL.void startFormRow(UIFormLabelSpec aLabelSpec, UIFormRowIcon aFormRowIcon)
It is strongly recommended to surround form rows with
startTableFormRow()
and
endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form row must be ended with endFormRow() after creating its HTML content.
aLabelSpec
- the row label.aFormRowIcon
- a form row icon.void startFormRow(UIFormRow aFormRow)
It is strongly recommended to surround form rows with
startTableFormRow()
and
endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form row must be ended with endFormRow() after creating its HTML content.
aFormRow
- the form row to be started.PathAccessException
- if the specified row is based on an incorrect path.newFormRow()
,
startFormRow(UIFormLabelSpec)
,
UIResponseContext.startFormRow(Path)
,
UIFormWriter.startFormRow(Path)
void endFormRow()
UIFormGroup newFormGroup(UIFormLabelSpec aLabelSpec)
aLabelSpec
- the group labelstartFormGroup(UIFormGroup)
,
UIFormWriter.newFormGroup(Path)
,
UIResponseContext.newFormGroup(Path)
void startFormGroup(UIFormLabelSpec aLabelSpec)
The next form rows or form groups will be indented, until endFormGroup() is not called. The indentation is stackable. The maximum depth is 5.
It is mandatory to surround a form group with
startTableFormRow()
and
endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form group must be ended with endFormGroup() to stop the indentation.
aLabelSpec
- the group label.IllegalStateException
- if startTableFormRow()
was not called before.startFormGroup(UIFormGroup)
,
UIResponseContext.startFormGroup(Path)
,
UIFormWriter.startFormGroup(Path)
void startFormGroup(UIFormGroup aFormGroup)
The next form rows or form groups will be indented, until endFormGroup() is not called. The indentation is stackable. The maximum depth is 5.
It is mandatory to surround a form group with
startTableFormRow()
and
endTableFormRow()
to have an
automatic width for labels and benefit from the latest rendering innovations.
Note: The form group must be ended with endFormGroup() to stop the indentation.
aFormGroup
- the form group to be started.IllegalStateException
- if startTableFormRow()
was not called before.PathAccessException
- if the specified group is based on an incorrect path.newFormGroup(UIFormLabelSpec)
,
startFormGroup(UIFormLabelSpec)
,
UIResponseContext.startFormGroup(Path)
,
UIFormWriter.startFormGroup(Path)
void endFormGroup()
startFormGroup(UIFormLabelSpec)
,
startFormGroup(UIFormGroup)
void startTableFormRow()
A table layout of form rows and groups contains only form rows
and form groups added with startFormRow(...)
,
startFormGroup(...)
and addFormRow(...)
in some subtype APIs.
Adding anything else to the table can break the whole UI,
and is thus not permitted.
Note: The table must be ended with endTableFormRow() after adding the form rows and groups.
startFormRow(UIFormLabelSpec)
,
startFormRow(UIFormRow)
,
startFormGroup(UIFormLabelSpec)
,
startFormGroup(UIFormGroup)
void endTableFormRow()
startTableFormRow()