|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Component
All classes of the UIF that are used as a rendering element implement the component interface. This interface defines basic properties and methods that all such classes much implement. All components within the framework have the following structure:
View
, Group
Field
Widget
Container
,
Field
,
Widget
Field Summary |
---|
Fields inherited from interface org.kuali.rice.krad.uif.core.Ordered |
---|
INITIAL_ORDER_VALUE |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Method Summary | |
---|---|
void |
addStyleClass(String styleClass)
Adds a single style to the list of styles on this component |
void |
appendToStyle(String itemStyle)
TODO: javadoc |
String |
getBaseId()
The original generated id. |
int |
getColSpan()
Number of places the component should take up horizontally in the container |
List<ComponentModifier> |
getComponentModifiers()
ComponentModifier instances that should be invoked to
initialize the component |
Map<String,String> |
getComponentOptions()
Options that are passed through to the Component renderer. |
String |
getComponentTypeName()
The name for the component type |
String |
getConditionalReadOnly()
Expression language string for conditionally setting the readOnly property |
String |
getConditionalRefresh()
|
String |
getConditionalRefreshConditionJs()
|
List<String> |
getConditionalRefreshControlNames()
|
String |
getConditionalRender()
Expression language string for conditionally setting the render property |
Map<String,Object> |
getContext()
Context map for the component |
List<Object> |
getFinalizeMethodAdditionalArguments()
List of Object instances that should be passed as arguments to the finalize method |
MethodInvokerConfig |
getFinalizeMethodInvoker()
MethodInvokerConfig instance for the method that should be invoked
for finalizing the component configuration |
String |
getFinalizeMethodToCall()
Name of the method that should be invoked for finalizing the component configuration (full method name, without parameters or return type) |
String |
getId()
The unique id (within a given tree) for the component |
List<Component> |
getNestedComponents()
List of components that are contained within the component |
int |
getOrder()
Can be used to order a component within a List of other components, lower numbers are placed higher up in the list, while higher numbers are placed lower in the list |
String |
getProgressiveDisclosureConditionJs()
|
List<String> |
getProgressiveDisclosureControlNames()
|
String |
getProgressiveRender()
|
Set<String> |
getPropertiesForReferenceCopy()
Used by the copy process to determine for which properties only the value reference should be copied (not a new copy instance). |
List<PropertyReplacer> |
getPropertyReplacers()
List of PropertyReplacer instances that will be evaluated
during the view lifecycle to conditional set properties on the
Component based on expression evaluations |
String |
getRefreshWhenChanged()
Specifies a property by name that when it value changes will automatically perform a refresh on this component. |
List<String> |
getRefreshWhenChangedControlNames()
Control names which will refresh this component when they are changed, added internally |
String |
getRenderOutput()
Rendering output for the component that will be sent as part of the response (can contain static text and HTML) |
Boolean |
getRequired()
Indicates whether the component is required |
int |
getRowSpan()
Number of places the component should take up vertically in the container |
String |
getStyle()
CSS style string to be applied to the component |
List<String> |
getStyleClasses()
CSS style class(s) to be applied to the component |
String |
getTemplate()
The path to the JSP file that should be called to render the component |
String |
getTitle()
A title for the component. |
boolean |
isHidden()
Indicates whether the component should be hidden in the UI |
boolean |
isProgressiveRenderAndRefresh()
If true, when the progressiveRender condition is satisfied, the component will always be retrieved from the server and shown(as opposed to being stored on the client, but hidden, after the first retrieval as is the case with the progressiveRenderViaAJAX option). |
boolean |
isProgressiveRenderViaAJAX()
|
boolean |
isReadOnly()
Indicates whether the component can be edited |
boolean |
isRefresh()
Result of the conditionalRefresh expression, true if satisfied, otherwise false. |
boolean |
isRender()
Indicates whether the component should be rendered in the UI |
boolean |
isSelfRendered()
Indicates whether the component contains its own render output (through the renderOutput property) |
void |
performApplyModel(View view,
Object model,
Component parent)
Called after the initialize phase to perform conditional logic based on the model data |
void |
performFinalize(View view,
Object model,
Component parent)
The last phase before the view is rendered. |
void |
performInitialization(View view)
Should be called to initialize the component |
void |
pushObjectToContext(String objectName,
Object object)
Places the given object into the context Map for the component with the given name |
void |
setBaseId(String baseId)
|
void |
setColSpan(int colSpan)
Setter for the components column span |
void |
setComponentModifiers(List<ComponentModifier> componentModifiers)
Setter for the components List of ComponentModifier
instances |
void |
setComponentOptions(Map<String,String> componentOptions)
Setter for the widget's options |
void |
setConditionalReadOnly(String conditionalReadOnly)
Setter for the conditional readOnly string |
void |
setConditionalRefresh(String conditionalRefresh)
|
void |
setConditionalRender(String conditionalRender)
Setter for the conditional render string |
void |
setContext(Map<String,Object> context)
Setter for the context Map |
void |
setHidden(boolean hidden)
Setter for the hidden indicator |
void |
setId(String id)
Sets the unique id (within a given tree) for the component |
void |
setOrder(int order)
Setter for the component's order |
void |
setProgressiveRender(String progressiveRender)
|
void |
setProgressiveRenderAndRefresh(boolean progressiveRenderAndRefresh)
|
void |
setProgressiveRenderViaAJAX(boolean progressiveRenderViaAJAX)
|
void |
setPropertyReplacers(List<PropertyReplacer> propertyReplacers)
Setter for the components property substitutions |
void |
setReadOnly(boolean readOnly)
Setter for the read only indicator |
void |
setRefresh(boolean refresh)
|
void |
setRefreshWhenChanged(String refreshWhenChanged)
|
void |
setRender(boolean render)
Setter for the components render indicator |
void |
setRenderOutput(String renderOutput)
Setter for the component's render output |
void |
setRequired(Boolean required)
Setter for the required indicator |
void |
setRowSpan(int rowSpan)
Setter for the component row span |
void |
setSelfRendered(boolean selfRendered)
Setter for the self render indicator |
void |
setStyle(String style)
Setter for the components style |
void |
setStyleClasses(List<String> styleClasses)
Setter for the components style classes |
void |
setTemplate(String template)
Setter for the components template |
void |
setTitle(String title)
Setter for the components title |
Method Detail |
---|
String getId()
The id will be used by renderers to set the HTML element id. This gives a way to find various elements for scripting. If the id is not given, a default will be generated by the framework
void setId(String id)
id
- - string to set as the component idString getComponentTypeName()
This is used within the rendering layer to pass the component instance into the template. The component instance is exported under the name given by this method.
String getTemplate()
The path should be relative to the web root. An attribute will be
available to the component to use under the name given by the method
getComponentTypeName
. Based on the component type,
additional attributes could be available for use. See the component
documentation for more information on such attributes.
e.g. '/krad/WEB-INF/jsp/tiles/component.jsp'
void setTemplate(String template)
template
- String getTitle()
void setTitle(String title)
title
- void performInitialization(View view)
Where components can set defaults and setup other necessary state. The initialize method should only be called once per component lifecycle and is invoked within the initialize phase of the view lifecylce.
view
- - view instance in which the component belongsViewHelperService#initializeComponent
void performApplyModel(View view, Object model, Component parent)
Where components can perform conditional logic such as dynamically generating new fields or setting field state based on the given data
view
- - view instance to which the component belongsmodel
- - Top level object containing the data (could be the form or a
top level business object, dto)void performFinalize(View view, Object model, Component parent)
view
- - view instance that should be finalized for renderingmodel
- - top level object containing the dataparent
- - parent componentList<Component> getNestedComponents()
Used by ViewHelperService
for the various lifecycle
callbacks
List<ComponentModifier> getComponentModifiers()
ComponentModifier
instances that should be invoked to
initialize the component
These provide dynamic initialization behavior for the component and are configured through the components definition. Each initializer will get invoked by the initialize method.
ViewHelperService#initializeComponent
void setComponentModifiers(List<ComponentModifier> componentModifiers)
ComponentModifier
instances
componentModifiers
- Set<String> getPropertiesForReferenceCopy()
org.kuali.rice.krad.uif.util.ComponentUtils.copy(T)
boolean isRender()
If set to false, the corresponding component template will not be invoked (therefore nothing will be rendered to the UI).
void setRender(boolean render)
render
- String getConditionalRender()
void setConditionalRender(String conditionalRender)
conditionalRender
- boolean isHidden()
How the hidden data is maintained depends on the views persistence mode. If the mode is request, the corresponding data will be rendered to the UI but not visible. If the mode is session, the data will not be rendered to the UI but maintained server side.
For a Container
component, the hidden setting will apply to
all contained components (making a section hidden makes all fields within
the section hidden)
void setHidden(boolean hidden)
hidden
- boolean isReadOnly()
When readOnly the controls and widgets of Field
components
will not be rendered. If the Field has an underlying value it will be
displayed readOnly to the user.
For a Container
component, the readOnly setting will apply
to all contained components (making a section readOnly makes all fields
within the section readOnly)
void setReadOnly(boolean readOnly)
readOnly
- String getConditionalReadOnly()
void setConditionalReadOnly(String conditionalReadOnly)
conditionalReadOnly
- Boolean getRequired()
At the general component level required means there is some action the user needs to take within the component. For example, within a section it might mean the fields within the section should be completed. At a field level, it means the field should be completed. This provides the ability for the renderers to indicate the required action.
void setRequired(Boolean required)
required
- String getStyle()
Any style override or additions can be specified with this attribute. This is used by the renderer to set the style attribute on the corresponding element.
e.g. 'color: #000000;text-decoration: underline;'
void setStyle(String style)
style
- List<String> getStyleClasses()
Declares style classes for the component. Multiple classes are specified with a space delimiter. This is used by the renderer to set the class attribute on the corresponding element. The class(s) declared must be available in the common style sheets or the style sheets specified for the view
e.g. 'header left'
void setStyleClasses(List<String> styleClasses)
styleClass
- void addStyleClass(String styleClass)
style
- void appendToStyle(String itemStyle)
itemStyle
- int getColSpan()
All components belong to a Container
and are placed using a
LayoutManager
. This property specifies how many places
horizontally the component should take up within the container. This is
only applicable for table based layout managers. Default is 1
void setColSpan(int colSpan)
colSpan
- int getRowSpan()
All components belong to a Container
and are placed using a
LayoutManager
. This property specifies how many places
vertically the component should take up within the container. This is
only applicable for table based layout managers. Default is 1
void setRowSpan(int rowSpan)
rowSpan
- Map<String,Object> getContext()
Any el statements configured for the components properties (e.g.
title="@{foo.property}") are evaluated using the el context map. This map
will get populated with default objects like the model, view, and request
from the ViewHelperService
. Other components can push
further objects into the context so that they are available for use with
that component. For example, Field
instances that are part
of a collection line as receive the current line instance
Context map also provides objects to methods that are invoked for
GeneratedField
instances
The Map key gives the name of the variable that can be used within expressions, and the Map value gives the object instance for which expressions containing the variable should evaluate against
void setContext(Map<String,Object> context)
context
- void pushObjectToContext(String objectName, Object object)
objectName
- - name the object should be exposed under in the context mapobject
- - object instance to place into contextList<PropertyReplacer> getPropertyReplacers()
PropertyReplacer
instances that will be evaluated
during the view lifecycle to conditional set properties on the
Component
based on expression evaluations
void setPropertyReplacers(List<PropertyReplacer> propertyReplacers)
propertyReplacers
- Map<String,String> getComponentOptions()
void setComponentOptions(Map<String,String> componentOptions)
widgetOptions
- int getOrder()
getOrder
in interface org.springframework.core.Ordered
Ordered.getOrder()
void setOrder(int order)
order
- org.springframework.core.Ordered.getOrder()
String getFinalizeMethodToCall()
Note the method can also be set with the finalizeMethodInvoker
targetMethod property. If the method is on the configured
ViewHelperService
, only this property needs to be configured
The model backing the view will be passed as the first argument method and then
the Component
instance as the second argument. If any additional method
arguments are declared with the finalizeMethodAdditionalArguments, they will then
be passed in the order declared in the list
If the component is selfRendered, the finalize method can return a string which will be set as the component's renderOutput. The selfRendered indicator will also be set to true on the component.
List<Object> getFinalizeMethodAdditionalArguments()
These arguments are passed to the finalize method after the standard model and component arguments. They are passed in the order declared in the list
MethodInvokerConfig getFinalizeMethodInvoker()
MethodInvokerConfig
instance for the method that should be invoked
for finalizing the component configuration
MethodInvoker can be configured to specify the class or object the method should be called on. For static method invocations, the targetClass property can be configured. For object invocations, that targetObject property can be configured
If the component is selfRendered, the finalize method can return a string which will be set as the component's renderOutput. The selfRendered indicator will also be set to true on the component.
boolean isSelfRendered()
If self rendered is true, the corresponding template for the component will not be invoked and the renderOutput String will be written to the response as is.
void setSelfRendered(boolean selfRendered)
selfRendered
- String getRenderOutput()
void setRenderOutput(String renderOutput)
renderOutput
- String getProgressiveRender()
void setProgressiveRender(String progressiveRender)
progressiveRender
- the progressiveRender to setString getConditionalRefresh()
void setConditionalRefresh(String conditionalRefresh)
conditionalRefresh
- the conditionalRefresh to setList<String> getProgressiveDisclosureControlNames()
String getProgressiveDisclosureConditionJs()
String getConditionalRefreshConditionJs()
List<String> getConditionalRefreshControlNames()
boolean isProgressiveRenderViaAJAX()
void setProgressiveRenderViaAJAX(boolean progressiveRenderViaAJAX)
progressiveRenderViaAJAX
- the progressiveRenderViaAJAX to setboolean isProgressiveRenderAndRefresh()
void setProgressiveRenderAndRefresh(boolean progressiveRenderAndRefresh)
progressiveRenderAndRefresh
- the progressiveRenderAndRefresh to setString getRefreshWhenChanged()
void setRefreshWhenChanged(String refreshWhenChanged)
refreshWhenChanged
- the refreshWhenChanged to setboolean isRefresh()
void setRefresh(boolean refresh)
refresh
- the refresh to setList<String> getRefreshWhenChangedControlNames()
String getBaseId()
void setBaseId(String baseId)
baseId
- the baseId to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |