public class RichToolbar
extends org.apache.myfaces.trinidad.component.UIXPanel
implements javax.faces.component.behavior.ClientBehaviorHolder
A toolbar is a single row container designed to hold buttons and other simple components. Toolbars are not rendered on printable pages.
<section name="Allowed_Children">While a toolbar was designed to hold buttons, it can also contain other simple components. But you should be aware that this could cause undesirable changes to its visual appearance. For example, if you include a tall component, the toolbar will be taller to compensate, and other items on the toolbar may no longer align nicely. If you include an overly wide component, it may look weird when that component is forced into overflow. A toolbar can also dynamically add children using a facetRef, iterator, or switcher child.
Please note that you should not nest toolbars, menuBars, or other container-type components inside a toolbar. This is incompatible with overflow and is not supported. If you would like to display multiple toolbars or menuBars in a single row, you should instead use a toolbox group.
</section> <section name="Grouping_Items_in_a_Toolbar">If you use an <af:group>
to group items inside a toolbar, the toolbar will by default include separators around the group. You should also note that the group has an effect on certain items. For example, buttons with type of radio that are grouped together are automatically considered part of the same radio group.
By default visual group separators always appear. If you want a group but do not want the group separator to appear, you can set the group's startBoundary or endBoundary attributes to 'hide' to request that the corresponding boundary be hidden. Note that when a first group's endBoundary and a second group's startBoundary are both set, the separator will only be hidden if both values are set to 'hide' or one value is 'hide' while the other value is 'dontCare'.
</section> <section name="Toolbar_Layout">Toolbars were designed to be used inside an <af:toolbox>
. A toolbox allows highly customizable display of toolbars, by utilizing their flex values and allowing multiple toolbars and menuBars per row.
You may use a toolbar outside of a toolbox, though doing so will cause the toolbar to lose the geometry management functionality that the toolbox provides. Without a toolbox, you cannot have multiple toolbars per row or benefit from flex values.
Because toolbars and toolboxes are overflow components, they do not have a set width size. A toolbar or toolbox should be placed in a section of the page where it can horizontally stretch to the available size for proper rendering. Putting a toolbar or toolbox inside a section of the page where it is horizontally constrained to a minimum size (like a panelStretchLayout end facet) will be error-prone, due to the fact that the width of the toolbar varies with its current overflow state.
</section> <section name="Keyboard_Access">Toolbars are designed to use arrow keys to move focus between toolbar items. When buttons and other simple widgets are included on a toolbar, they are no longer individual tabstops. Instead, the toolbar is a single tabstop with the left and right arrow keys being used to access the items on the toolbar. For items in overflow, the up and down arrow keys also work to move focus.
Some widgets (especially input components) are already using arrow keys for other purposes. For example, inputText uses arrow keys to move cursor inside the input. That makes these components incompatible with the default keyboard paradigm described above. If a toolbar detects that it has children like this, or contains content that it does not recognize, then all children will remain as default tabstops so they can still be accessed by a keyboard only user. Even though we handle this situation, it is less than ideal.
Components that are already responding to arrow keys should either not be placed on a toolbar or be placed on a toolbar by themselves.
</section> <section name="Right_Justifying_Toolbar_Items">By default toolbars are left (start side) justified. In order to make some or all of the toolbar items right (end side) justified, you can use the stretchId attibute. StretchId is usually set to the id of an af:spacer on the toolbar that you want to stretch to take up any available extra horizontal space. The component that you specify must be present on the client. Therefore, if using a component that may not be present on the client (like af:spacer), you should set the child component's clientComponent attribute to 'true'.
<af:toolbox id="tbx1"> <af:toolbar flex="1" stretchid="stretch1" id="tb1"> <af:group id="g1"> <af:button text="Forward" icon="/images/fwdarrow_gray.gif" disabled="true" id="b1"/> <af:button icon="/images/uplevel.gif" id="b2"/> </af:group> <af:button text="Search" icon="/images/search.gif" id="b3"/> <af:button text="Folders" icon="/images/folders.gif" id="b4"/> <!-- Insert a stretched spacer to push subsequent buttons to the right --> <af:spacer id="stretch1" clientComponent="true"/> <af:button text="Reports" id="b5"/> <af:button text="Refresh:OFF" id="b6"/> </af:toolbar> </af:toolbox></section> <section name="Assigning_Percent_Width_to_a_Toolbar_in_a_Row">
When used inside a toolbox row, you can use a flex value on a toolbar to control what percentage of the available horizontal space that toolbar should receive. For example, if your toolbox row has 3 toolbars, each with a flex value of "1", then they receive their flex value (1) of the total space available (3). This means that each of the three toolbars would be given one third of the available horizontal space.
</section> <section name="Updating_through_PartialTriggers">Note that if a toolbar child component is going to be updated through partial page rendering, you need to update the toolbar as well. You do this by adding the child components id to the toolbar's partialTriggers attribute. This way the toolbar can appropriately manage its children in respect to sizing and placement in overflow. Also note that many input components also update themselves through partial page rendering. If you include an input component (or quickQuery) on a toolbar, you should include that child's id in the toolbar's partialTriggers attribute so that the toolbar also updates when the input component is replaced. Because this partialTrigger will cause overflow to close during the toolbar ppr, toolbar child components that update themselves via ppr outside of a submit (like InputComboboxLOV) will work better when not in overflow.
</section> <section name="Geometry_Management"> <html:ul> <html:li>This component can be stretched by a parent layout component that stretches its children, e.g. panelStretchLayout, panelSplitter.</html:li> <html:li>This component accepts buttons and other simple components as children, including spacers and images. Children are not by default stretched. This component also has a stretchId attribute. When this attribute is set to the id of one of its children, that child is stretched.</html:li> </html:ul> </section> <section name="Overflow"> <html:p>Toolbar is an overflow component. When a toolbar does not have enough space to display all items, the children are put into overflow and an overflow button is displayed. When a toolbar in a toolbox row has a flex value, the flex value is strictly followed, even in regards to overflow. When toolbars (or menuBars) in a toolbox row do not have flex values, then the right most (end side) toolbar would be forced into overflow before left side toolbars. Spacer and image children on toolbars are not put into overflow.</html:p> <html:p>Overflow components must be part of a supported layout in order to work properly on the page.</html:p> <html:p>An overflow component requires that it is either:</html:p> <html:ul> <html:li>in a container that stretches its children, or</html:li> <html:li>in a container that has a set width.</html:li> </html:ul> <html:p>Under these circumstances, when the overflow component is larger than the parent container, the overflow component will display an overflow button. Selecting the overflow button will show a popup containing the items that didn't fit on the page.</html:p> <html:p>Setting up an overflow component with the following layouts is not supported. If you use one of these layouts, you may have unexpected and inconsistent results:</html:p> <html:ul> <html:li>in a container that does not stretch its children.</html:li> <html:li>in a container that displays multiple children horizontally without explicit sizes for each child. For example, a panelGroupLayout with layout='horizontal' would be invalid, but panelSplitter is OK because it has an explicitly set splitter position.</html:li> <html:li>setting the overflow component with a styleClass or inlineStyle that assigns a percentage width value. Note that this includes assigning styleClass='AFStretchWidth' on an overflow component.</html:li> </html:ul> </section>Type | Phases | Description |
---|---|---|
org.apache.myfaces.trinidad.event.AttributeChangeEvent |
Invoke Application Apply Request Values |
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing. |
Modifier and Type | Field and Description |
---|---|
static org.apache.myfaces.trinidad.bean.PropertyKey |
CLIENT_ATTRIBUTES_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
CLIENT_COMPONENT_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
CLIENT_LISTENERS_KEY |
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
static org.apache.myfaces.trinidad.bean.PropertyKey |
CUSTOMIZATION_ID_KEY
Deprecated.
|
static org.apache.myfaces.trinidad.bean.PropertyKey |
FLEX_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
INLINE_STYLE_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
PARTIAL_TRIGGERS_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
SHORT_DESC_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
STRETCH_ID_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
STYLE_CLASS_KEY |
static org.apache.myfaces.trinidad.bean.FacesBean.Type |
TYPE |
static org.apache.myfaces.trinidad.bean.PropertyKey |
UNSECURE_KEY |
static org.apache.myfaces.trinidad.bean.PropertyKey |
VISIBLE_KEY |
Modifier | Constructor and Description |
---|---|
|
RichToolbar()
Construct an instance of the RichToolbar.
|
protected |
RichToolbar(String rendererType)
Construct an instance of the RichToolbar.
|
Modifier and Type | Method and Description |
---|---|
void |
addClientBehavior(String eventName, javax.faces.component.behavior.ClientBehavior behavior) |
protected org.apache.myfaces.trinidad.bean.FacesBean.Type |
getBeanType() |
Set |
getClientAttributes()
Gets a set of client attribute names.
|
Map<String,List<javax.faces.component.behavior.ClientBehavior>> |
getClientBehaviors() |
ClientListenerSet |
getClientListeners()
Gets a set of client listeners.
|
String |
getCustomizationId()
Deprecated.
This attribute is deprecated. This attribute will be removed in the next release. Use the 'id' attribute instead.
|
String |
getDefaultEventName() |
Collection<String> |
getEventNames() |
String |
getFamily() |
int |
getFlex()
Gets a non-negative integer that indicates the flexibility of this component in its containing toolbox.
|
String |
getInlineStyle()
Gets the CSS styles to use for this component.
|
String[] |
getPartialTriggers()
Gets the IDs of the components that should trigger a partial update.
|
String |
getShortDesc()
Gets the short description of the component.
|
String |
getStretchId()
Gets the id of a child component that will be given all of the available space left in the toolbar if the contents of the toolbar do not use all of the space that the toolbar has available.
|
String |
getStyleClass()
Gets a CSS style class to use for this component.
|
Set<String> |
getUnsecure()
Gets A whitespace separated list of attributes whose values ordinarily can be set only on the server, but need to be settable on the client.
|
boolean |
isClientComponent()
Gets whether a client-side component will be generated.
|
boolean |
isVisible()
Gets the visibility of the component.
|
void |
setClientAttributes(Set clientAttributes)
Sets a set of client attribute names.
|
void |
setClientComponent(boolean clientComponent)
Sets whether a client-side component will be generated.
|
void |
setClientListeners(ClientListenerSet clientListeners)
Sets a set of client listeners.
|
void |
setCustomizationId(String customizationId)
Deprecated.
This attribute is deprecated. This attribute will be removed in the next release. Use the 'id' attribute instead.
|
void |
setFlex(int flex)
Sets a non-negative integer that indicates the flexibility of this component in its containing toolbox.
|
void |
setInlineStyle(String inlineStyle)
Sets the CSS styles to use for this component.
|
void |
setPartialTriggers(String[] partialTriggers)
Sets the IDs of the components that should trigger a partial update.
|
void |
setShortDesc(String shortDesc)
Sets the short description of the component.
|
void |
setStretchId(String stretchId)
Sets the id of a child component that will be given all of the available space left in the toolbar if the contents of the toolbar do not use all of the space that the toolbar has available.
|
void |
setStyleClass(String styleClass)
Sets a CSS style class to use for this component.
|
void |
setUnsecure(Set<String> unsecure)
Sets A whitespace separated list of attributes whose values ordinarily can be set only on the server, but need to be settable on the client.
|
void |
setVisible(boolean visible)
Sets the visibility of the component.
|
adaptMethodBinding, addAttributeChange, addAttributeChangeListener, addComponentChange, addComponentChange, addComponentChangeFilter, addFacesListener, broadcast, broadcastToMethodBinding, broadcastToMethodExpression, clearCachedClientIds, clearInitialState, createFacesBean, decode, decodeChildren, decodeChildrenImpl, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientId, getComponentChangeFilters, getContainerClientId, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getId, getIntProperty, getLifecycleRenderer, getListenersForEventClass, getParent, getProperty, getPropertyKey, getRenderedFacetsAndChildren, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, initialStateMarked, invokeOnChildrenComponents, invokeOnComponent, invokeOnNamingContainerComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeAttributeChangeListener, removeComponentChangeFilter, removeFacesListener, restoreState, satisfiesPartialTrigger, saveState, setAttributeChangeListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setupFlattenedChildrenContext, setupFlattenedContext, setValueBinding, setValueExpression, subscribeToEvent, tearDownFlattenedChildrenContext, tearDownFlattenedContext, toString, unsubscribeFromEvent, updateChildren, updateChildrenImpl, validateChildren, validateChildrenImpl
addPartialTarget, broadcastInContext, clearCachedClientIds, defaultGetRenderedFacetsAndChildren, encodeFlattenedChild, encodeFlattenedChildren, getLogicalParent, getLogicalParent, getStateHelper, getStateHelper, isVisitable, partialEncodeVisit, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, setPartialTarget, setupChildrenEncodingContext, setupChildrenVisitingContext, setupEncodingContext, setUpEncodingContext, setupVisitingContext, tearDownChildrenEncodingContext, tearDownChildrenVisitingContext, tearDownEncodingContext, tearDownVisitingContext, visitAllChildren, visitChildren, visitChildren, visitTree, visitTree
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getPassThroughAttributes, getResourceBundleMap, getTransientStateHelper, getTransientStateHelper, isCompositeComponent, isInView, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView
public static final org.apache.myfaces.trinidad.bean.FacesBean.Type TYPE
public static final org.apache.myfaces.trinidad.bean.PropertyKey INLINE_STYLE_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey STYLE_CLASS_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey SHORT_DESC_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey UNSECURE_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey VISIBLE_KEY
@Deprecated public static final org.apache.myfaces.trinidad.bean.PropertyKey CUSTOMIZATION_ID_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey CLIENT_COMPONENT_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey CLIENT_ATTRIBUTES_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey PARTIAL_TRIGGERS_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey CLIENT_LISTENERS_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey FLEX_KEY
public static final org.apache.myfaces.trinidad.bean.PropertyKey STRETCH_ID_KEY
public static final String COMPONENT_FAMILY
public static final String COMPONENT_TYPE
public RichToolbar()
protected RichToolbar(String rendererType)
public final String getInlineStyle()
public final void setInlineStyle(String inlineStyle)
inlineStyle
- the new inlineStyle valuepublic final String getStyleClass()
public final void setStyleClass(String styleClass)
styleClass
- the new styleClass valuepublic final String getShortDesc()
For components with images, the shortDesc is often used to render an HTML alt attribute for the image. Please see the accessibility guidelines section for correct alt text usage of the shortDesc attribute.
shortDesc is also commonly used to render an HTML title attribute, which is used by user agents to display tooltip help text. In this case the behavior for the tooltip is controlled by the user agent, e.g. Firefox 2 truncates long tooltips. For form components, the shortDesc is displayed in a note window. For components that support the helpTopicId attribute and are not using the shortDesc as image alt text, it is recommended that helpTopicId is used instead of shortDesc as it is more flexible and provides more accessible descriptive text than the use of the title attribute.
public final void setShortDesc(String shortDesc)
For components with images, the shortDesc is often used to render an HTML alt attribute for the image. Please see the accessibility guidelines section for correct alt text usage of the shortDesc attribute.
shortDesc is also commonly used to render an HTML title attribute, which is used by user agents to display tooltip help text. In this case the behavior for the tooltip is controlled by the user agent, e.g. Firefox 2 truncates long tooltips. For form components, the shortDesc is displayed in a note window. For components that support the helpTopicId attribute and are not using the shortDesc as image alt text, it is recommended that helpTopicId is used instead of shortDesc as it is more flexible and provides more accessible descriptive text than the use of the title attribute.
shortDesc
- the new shortDesc valuepublic final Set<String> getUnsecure()
public final void setUnsecure(Set<String> unsecure)
unsecure
- the new unsecure valuepublic final boolean isVisible()
public final void setVisible(boolean visible)
visible
- the new visible value@Deprecated public final String getCustomizationId()
@Deprecated public final void setCustomizationId(String customizationId)
customizationId
- the new customizationId valuepublic final boolean isClientComponent()
public final void setClientComponent(boolean clientComponent)
clientComponent
- the new clientComponent valuepublic final Set getClientAttributes()
public final void setClientAttributes(Set clientAttributes)
clientAttributes
- the new clientAttributes valuepublic final String[] getPartialTriggers()
public final void setPartialTriggers(String[] partialTriggers)
partialTriggers
- the new partialTriggers valuepublic final ClientListenerSet getClientListeners()
public final void setClientListeners(ClientListenerSet clientListeners)
clientListeners
- the new clientListeners valuepublic final int getFlex()
public final void setFlex(int flex)
flex
- the new flex valuepublic final String getStretchId()
public final void setStretchId(String stretchId)
stretchId
- the new stretchId valuepublic String getDefaultEventName()
getDefaultEventName
in interface javax.faces.component.behavior.ClientBehaviorHolder
getDefaultEventName
in class org.apache.myfaces.trinidad.component.UIXComponentBase
public Collection<String> getEventNames()
getEventNames
in interface javax.faces.component.behavior.ClientBehaviorHolder
public Map<String,List<javax.faces.component.behavior.ClientBehavior>> getClientBehaviors()
getClientBehaviors
in interface javax.faces.component.behavior.ClientBehaviorHolder
getClientBehaviors
in class org.apache.myfaces.trinidad.component.UIXComponentBase
public void addClientBehavior(String eventName, javax.faces.component.behavior.ClientBehavior behavior)
addClientBehavior
in interface javax.faces.component.behavior.ClientBehaviorHolder
addClientBehavior
in class org.apache.myfaces.trinidad.component.UIXComponentBase
public String getFamily()
getFamily
in class org.apache.myfaces.trinidad.component.UIXPanel
protected org.apache.myfaces.trinidad.bean.FacesBean.Type getBeanType()
getBeanType
in class org.apache.myfaces.trinidad.component.UIXPanel