Class AbstractSelectorSection
- java.lang.Object
-
- de.hybris.platform.cockpit.components.navigationarea.NavigationPanelSection
-
- de.hybris.platform.cockpit.components.navigationarea.AbstractSelectorSection
-
- All Implemented Interfaces:
SelectorSection
,Section
,CockpitEventAcceptor
- Direct Known Subclasses:
DefaultSectionSelectorSection
public abstract class AbstractSelectorSection extends NavigationPanelSection implements SelectorSection, CockpitEventAcceptor
Abstract class to be used byselector sections
implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<TypedObject>
selectedItems
-
Constructor Summary
Constructors Constructor Description AbstractSelectorSection()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.List<TypedObject>
getItems()
Returns this selector's (root) items.AbstractNavigationAreaModel
getNavigationAreaModel()
Returns the navigation area model to which this section belongs.SectionRenderer
getRenderer()
TypedObject
getSelectedItem()
Returns the currently selected item.java.util.List<TypedObject>
getSelectedItems()
Returns the selector's currently selected items.boolean
isInitiallySelected()
Returns whether initial selection is enabled or not.boolean
isItemActive(TypedObject item)
Please seeSelectorSection.isItemActive(TypedObject)
.boolean
isMultiple()
Returns whether this selector supports multiple selection or not.void
onCockpitEvent(CockpitEvent event)
abstract void
selectionChanged()
Called whenever this selector's selection has changed.void
setInitiallySelected(boolean initSelection)
Sets whether the first item should be initially selected or not.void
setItems(java.util.List<TypedObject> items)
Sets the (root) items which this selector should render.void
setMultiple(boolean multi)
Sets whether this selector supports multiple selection or not.void
setNavigationAreaModel(AbstractNavigationAreaModel navAreaModel)
Sets the model of the navigation area to which this selector belongs.void
setSelectedItem(TypedObject selectedItem)
Sets the selector's selected item toselectedItem
void
setSelectedItems(java.util.List<TypedObject> selectedItems)
Sets the selector's selected items toselectedItems
.void
setSelectedItemsDirectly(java.util.List<TypedObject> selectedItems)
Does the same thing asSelectorSection.setSelectedItems(List)
with the exception that no event is fired.static java.util.List<TypedObject>
wrapItems(java.util.Collection<? extends ItemModel> itemModels)
Deprecated.since 6.3, will become obsolete when the cockpit's type service has support for service layer models-
Methods inherited from class de.hybris.platform.cockpit.components.navigationarea.NavigationPanelSection
getAttribute, getLabel, getLocalizedLabel, isInitialOpen, isOpen, isTabbed, isVisible, setAttribute, setLabel, setLocalizedLabel, setOpen, setRenderer, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.cockpit.components.sectionpanel.Section
getLabel, getLocalizedLabel, isInitialOpen, isOpen, isTabbed, isVisible, setOpen
-
-
-
-
Field Detail
-
selectedItems
protected final java.util.List<TypedObject> selectedItems
-
-
Method Detail
-
getItems
public java.util.List<TypedObject> getItems()
Description copied from interface:SelectorSection
Returns this selector's (root) items.- Specified by:
getItems
in interfaceSelectorSection
- Returns:
- the root items of this selector
-
isMultiple
public boolean isMultiple()
Description copied from interface:SelectorSection
Returns whether this selector supports multiple selection or not.- Specified by:
isMultiple
in interfaceSelectorSection
- Returns:
true
if multiple selection is allowed,false
otherwise
-
setItems
public void setItems(java.util.List<TypedObject> items)
Description copied from interface:SelectorSection
Sets the (root) items which this selector should render.- Specified by:
setItems
in interfaceSelectorSection
- Parameters:
items
- this selector's new items
-
setMultiple
public void setMultiple(boolean multi)
Description copied from interface:SelectorSection
Sets whether this selector supports multiple selection or not.- Specified by:
setMultiple
in interfaceSelectorSection
- Parameters:
multi
- whether multiple selection should be allowed or not
-
setSelectedItem
public void setSelectedItem(TypedObject selectedItem)
Description copied from interface:SelectorSection
Sets the selector's selected item toselectedItem
- Specified by:
setSelectedItem
in interfaceSelectorSection
- Parameters:
selectedItem
- the selected item
-
setSelectedItems
public void setSelectedItems(java.util.List<TypedObject> selectedItems)
Description copied from interface:SelectorSection
Sets the selector's selected items toselectedItems
.- Specified by:
setSelectedItems
in interfaceSelectorSection
- Parameters:
selectedItems
- the new selection of the selector- See Also:
SelectorSection.setSelectedItemsDirectly(List)
-
setSelectedItemsDirectly
public void setSelectedItemsDirectly(java.util.List<TypedObject> selectedItems)
Description copied from interface:SelectorSection
Does the same thing asSelectorSection.setSelectedItems(List)
with the exception that no event is fired.- Specified by:
setSelectedItemsDirectly
in interfaceSelectorSection
- Parameters:
selectedItems
- the selected items- See Also:
SelectorSection.setSelectedItems(List)
-
getSelectedItems
public java.util.List<TypedObject> getSelectedItems()
Description copied from interface:SelectorSection
Returns the selector's currently selected items.- Specified by:
getSelectedItems
in interfaceSelectorSection
- Returns:
- the selector's selected items
-
getSelectedItem
public TypedObject getSelectedItem()
Returns the currently selected item. If there are multiple selected items, the first one is returned.- Specified by:
getSelectedItem
in interfaceSelectorSection
- Returns:
- the selected item or
null
if no items have been selected - See Also:
SelectorSection.getSelectedItem()
-
setNavigationAreaModel
public void setNavigationAreaModel(AbstractNavigationAreaModel navAreaModel)
Sets the model of the navigation area to which this selector belongs.- Parameters:
navAreaModel
- the navigation area model
-
getNavigationAreaModel
public AbstractNavigationAreaModel getNavigationAreaModel()
Returns the navigation area model to which this section belongs.- Returns:
- the navigation area model
-
getRenderer
public SectionRenderer getRenderer()
- Overrides:
getRenderer
in classNavigationPanelSection
-
selectionChanged
public abstract void selectionChanged()
Description copied from interface:SelectorSection
Called whenever this selector's selection has changed.- Specified by:
selectionChanged
in interfaceSelectorSection
-
isItemActive
public boolean isItemActive(TypedObject item)
Please seeSelectorSection.isItemActive(TypedObject)
. Note: This implementation always returnsfalse
.- Specified by:
isItemActive
in interfaceSelectorSection
- Parameters:
item
- the item- Returns:
true
ifitem
is active,false
otherwise
-
wrapItems
@Deprecated public static java.util.List<TypedObject> wrapItems(java.util.Collection<? extends ItemModel> itemModels)
Deprecated.since 6.3, will become obsolete when the cockpit's type service has support for service layer modelsWraps the items. Note: This method should be removed when the cockpit'stype service
supports Service layermodels
.- Parameters:
itemModels
- items to wrap- Returns:
- the wrapped items
-
setInitiallySelected
public void setInitiallySelected(boolean initSelection)
Description copied from interface:SelectorSection
Sets whether the first item should be initially selected or not.- Specified by:
setInitiallySelected
in interfaceSelectorSection
- Parameters:
initSelection
-true
if inital selection should be enabled,false
otherwise
-
isInitiallySelected
public boolean isInitiallySelected()
Description copied from interface:SelectorSection
Returns whether initial selection is enabled or not.- Specified by:
isInitiallySelected
in interfaceSelectorSection
- Returns:
true
if initial selection is enabled,false
otherwise
-
onCockpitEvent
public void onCockpitEvent(CockpitEvent event)
- Specified by:
onCockpitEvent
in interfaceCockpitEventAcceptor
-
-