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:
CmsCatalogSelectorSection,CmsSiteSelectorSection,DefaultSectionSelectorSection
public abstract class AbstractSelectorSection extends NavigationPanelSection implements SelectorSection, CockpitEventAcceptor
Abstract class to be used byselector sectionsimplementations.
-
-
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.AbstractNavigationAreaModelgetNavigationAreaModel()Returns the navigation area model to which this section belongs.SectionRenderergetRenderer()TypedObjectgetSelectedItem()Returns the currently selected item.java.util.List<TypedObject>getSelectedItems()Returns the selector's currently selected items.booleanisInitiallySelected()Returns whether initial selection is enabled or not.booleanisItemActive(TypedObject item)Please seeSelectorSection.isItemActive(TypedObject).booleanisMultiple()Returns whether this selector supports multiple selection or not.voidonCockpitEvent(CockpitEvent event)abstract voidselectionChanged()Called whenever this selector's selection has changed.voidsetInitiallySelected(boolean initSelection)Sets whether the first item should be initially selected or not.voidsetItems(java.util.List<TypedObject> items)Sets the (root) items which this selector should render.voidsetMultiple(boolean multi)Sets whether this selector supports multiple selection or not.voidsetNavigationAreaModel(AbstractNavigationAreaModel navAreaModel)Sets the model of the navigation area to which this selector belongs.voidsetSelectedItem(TypedObject selectedItem)Sets the selector's selected item toselectedItemvoidsetSelectedItems(java.util.List<TypedObject> selectedItems)Sets the selector's selected items toselectedItems.voidsetSelectedItemsDirectly(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:SelectorSectionReturns this selector's (root) items.- Specified by:
getItemsin interfaceSelectorSection- Returns:
- the root items of this selector
-
isMultiple
public boolean isMultiple()
Description copied from interface:SelectorSectionReturns whether this selector supports multiple selection or not.- Specified by:
isMultiplein interfaceSelectorSection- Returns:
trueif multiple selection is allowed,falseotherwise
-
setItems
public void setItems(java.util.List<TypedObject> items)
Description copied from interface:SelectorSectionSets the (root) items which this selector should render.- Specified by:
setItemsin interfaceSelectorSection- Parameters:
items- this selector's new items
-
setMultiple
public void setMultiple(boolean multi)
Description copied from interface:SelectorSectionSets whether this selector supports multiple selection or not.- Specified by:
setMultiplein interfaceSelectorSection- Parameters:
multi- whether multiple selection should be allowed or not
-
setSelectedItem
public void setSelectedItem(TypedObject selectedItem)
Description copied from interface:SelectorSectionSets the selector's selected item toselectedItem- Specified by:
setSelectedItemin interfaceSelectorSection- Parameters:
selectedItem- the selected item
-
setSelectedItems
public void setSelectedItems(java.util.List<TypedObject> selectedItems)
Description copied from interface:SelectorSectionSets the selector's selected items toselectedItems.- Specified by:
setSelectedItemsin 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:SelectorSectionDoes the same thing asSelectorSection.setSelectedItems(List)with the exception that no event is fired.- Specified by:
setSelectedItemsDirectlyin interfaceSelectorSection- Parameters:
selectedItems- the selected items- See Also:
SelectorSection.setSelectedItems(List)
-
getSelectedItems
public java.util.List<TypedObject> getSelectedItems()
Description copied from interface:SelectorSectionReturns the selector's currently selected items.- Specified by:
getSelectedItemsin 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:
getSelectedItemin interfaceSelectorSection- Returns:
- the selected item or
nullif 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:
getRendererin classNavigationPanelSection
-
selectionChanged
public abstract void selectionChanged()
Description copied from interface:SelectorSectionCalled whenever this selector's selection has changed.- Specified by:
selectionChangedin interfaceSelectorSection
-
isItemActive
public boolean isItemActive(TypedObject item)
Please seeSelectorSection.isItemActive(TypedObject). Note: This implementation always returnsfalse.- Specified by:
isItemActivein interfaceSelectorSection- Parameters:
item- the item- Returns:
trueifitemis active,falseotherwise
-
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 servicesupports Service layermodels.- Parameters:
itemModels- items to wrap- Returns:
- the wrapped items
-
setInitiallySelected
public void setInitiallySelected(boolean initSelection)
Description copied from interface:SelectorSectionSets whether the first item should be initially selected or not.- Specified by:
setInitiallySelectedin interfaceSelectorSection- Parameters:
initSelection-trueif inital selection should be enabled,falseotherwise
-
isInitiallySelected
public boolean isInitiallySelected()
Description copied from interface:SelectorSectionReturns whether initial selection is enabled or not.- Specified by:
isInitiallySelectedin interfaceSelectorSection- Returns:
trueif initial selection is enabled,falseotherwise
-
onCockpitEvent
public void onCockpitEvent(CockpitEvent event)
- Specified by:
onCockpitEventin interfaceCockpitEventAcceptor
-
-