public class DefaultSelectorSectionRenderer extends AbstractNavigationAreaSectionRenderer
LabelService for rendering values.
The internal renderer for rendering selector items used by this section renderer can easily be replaced. However, in order for
the general selector functionality to work correctly, you need to set the value of the Listitem passed to the
ListitemRenderer#render(Listitem, Object) method to the corresponding TypedObject, just as in the example
below.
Example: Custom list item renderer
public void render(final Listitem li, final Object value) throws Exception
{
if (value instanceof TypedObject)
{
li.setValue(value);
...
final Listcell cell = new Listcell(someText);
li.appendChild(cell);
cell.setSclass("cockpitSelectorItem");
}
else
{
LOG.warn("Can not render item since it is not a TypedObject");
}
}
setListRenderer(ListitemRenderer)| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
EMPTY_MESSAGE |
protected SelectorSection |
lastSection |
static java.lang.String |
SELECTOR_ACTIVE_ITEM_SCLASS
An additional style class used for selector items.
|
static java.lang.String |
SELECTOR_ITEM_SCLASS
The normal style class used for selector items.
|
static java.lang.String |
SELECTOR_SCLASS
Style class of the cockpit selector component.
|
| Constructor and Description |
|---|
DefaultSelectorSectionRenderer() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<TypedObject> |
extractSelectedItems(java.util.Set<java.lang.Object> listValues)
Extracts the selected
TypedObjects corresponding to the selector's current selection. |
ListitemRenderer |
getListRenderer()
Returns the list renderer used for rendering the list items displayed in the selector.
|
protected SelectorSection |
getSection()
Returns the last section which this renderer rendered.
|
void |
render(SectionPanel panel,
Component parent,
Component captionComponent,
Section section) |
void |
setListRenderer(ListitemRenderer listRenderer)
Sets the list item renderer to be used when rendering list items to
listRenderer. |
createBrowserItemTooltip, createList, getNavigationArea, getSectionPanelModel, setNavigationAreaprotected static final java.lang.String EMPTY_MESSAGE
protected SelectorSection lastSection
public static final java.lang.String SELECTOR_SCLASS
public static final java.lang.String SELECTOR_ITEM_SCLASS
public static final java.lang.String SELECTOR_ACTIVE_ITEM_SCLASS
SELECTOR_ITEM_SCLASS,
SELECTOR_SCLASS,
Constant Field Valuespublic void render(SectionPanel panel, Component parent, Component captionComponent, Section section)
render in interface SectionRendererrender in class AbstractNavigationAreaSectionRendererpublic void setListRenderer(ListitemRenderer listRenderer)
listRenderer.
Note: Calling this method with a null argument, will cause the default fallback renderer to be used when
rendering.listRenderer - the renderer to use or null if the fallback renderer should be usedpublic ListitemRenderer getListRenderer()
protected java.util.List<TypedObject> extractSelectedItems(java.util.Set<java.lang.Object> listValues)
TypedObjects corresponding to the selector's current selection.listValues - the selected ZK items e.g. Listitemsprotected SelectorSection getSection()
Copyright © 2018 SAP SE. All Rights Reserved.