Class DefaultCollectionBrowserContext
- java.lang.Object
-
- com.hybris.cockpitng.widgets.collectionbrowser.mold.DefaultCollectionBrowserContext
-
- All Implemented Interfaces:
CollectionBrowserMoldContext
public class DefaultCollectionBrowserContext extends java.lang.Object implements CollectionBrowserMoldContext
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionBrowserControllercontroller
-
Constructor Summary
Constructors Constructor Description DefaultCollectionBrowserContext(CollectionBrowserController controller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareHyperlinksSupported()Informs if collection browser supports hyperlinks.SinglePagegetCurrentPage()DataTypegetCurrentType()Gets data type that is currently being displayedjava.lang.StringgetCurrentTypeCode()Gets data type code that is currently being displayedDragAndDropStrategygetDragAndDropStrategy()<E> EgetFocusedItem()Gets currently focused item ornullif no item is focused<E> java.util.Collection<E>getSelectedItems()Gets all currently selected itemsWidgetInstanceManagergetWidgetInstanceManager()Returns the widget instance manager of current controller.booleanisDragEnabled()booleanisDropEnabled()booleanisMultiSelectEnabled()Allows to determine if the collection browser allows for multi-selectionbooleanisSortable(java.lang.String attributeQualifier)Checks whether provided attribute is sortablevoidnotifyHyperlinkClicked(java.lang.Object value)Notifies that an user has clicked on element hyperlink.voidnotifyItemClicked(java.lang.Object item)Notifies that an user has clicked on element, but did not select it.voidnotifyItemsSelected(java.util.Collection<?> items)Notifies that multiple items have been selected.voidsort(SortData sortData)Reads data sorted with provided parameters
-
-
-
Field Detail
-
controller
protected final CollectionBrowserController controller
-
-
Constructor Detail
-
DefaultCollectionBrowserContext
public DefaultCollectionBrowserContext(CollectionBrowserController controller)
-
-
Method Detail
-
getSelectedItems
public <E> java.util.Collection<E> getSelectedItems()
Description copied from interface:CollectionBrowserMoldContextGets all currently selected items- Specified by:
getSelectedItemsin interfaceCollectionBrowserMoldContext- Type Parameters:
E- type of expected items- Returns:
- collection of all selected items
-
getFocusedItem
public <E> E getFocusedItem()
Description copied from interface:CollectionBrowserMoldContextGets currently focused item ornullif no item is focused- Specified by:
getFocusedItemin interfaceCollectionBrowserMoldContext- Type Parameters:
E- type of expected item- Returns:
- focused item
-
notifyItemsSelected
public void notifyItemsSelected(java.util.Collection<?> items)
Description copied from interface:CollectionBrowserMoldContextNotifies that multiple items have been selected.
Method should be called when selection is changed passing a full collection of selected items (even if a single element is added to selection, whole selection should be passed).
- Specified by:
notifyItemsSelectedin interfaceCollectionBrowserMoldContext- Parameters:
items- all items that are selected
-
areHyperlinksSupported
public boolean areHyperlinksSupported()
Description copied from interface:CollectionBrowserMoldContextInforms if collection browser supports hyperlinks.
Values in collection browser may be rendered in the way, that some
- Specified by:
areHyperlinksSupportedin interfaceCollectionBrowserMoldContext- Returns:
-
notifyHyperlinkClicked
public void notifyHyperlinkClicked(java.lang.Object value)
Description copied from interface:CollectionBrowserMoldContextNotifies that an user has clicked on element hyperlink.
Call will be ignored, if hyperlinks are not supported
- Specified by:
notifyHyperlinkClickedin interfaceCollectionBrowserMoldContext- Parameters:
value- hyperlink's value- See Also:
CollectionBrowserMoldContext.areHyperlinksSupported()
-
notifyItemClicked
public void notifyItemClicked(java.lang.Object item)
Description copied from interface:CollectionBrowserMoldContextNotifies that an user has clicked on element, but did not select it.
- Specified by:
notifyItemClickedin interfaceCollectionBrowserMoldContext- Parameters:
item- item that is represented by clicked element- See Also:
CollectionBrowserMoldContext.notifyItemsSelected(Collection)
-
getWidgetInstanceManager
public WidgetInstanceManager getWidgetInstanceManager()
Description copied from interface:CollectionBrowserMoldContextReturns the widget instance manager of current controller.- Specified by:
getWidgetInstanceManagerin interfaceCollectionBrowserMoldContext- Returns:
- widget instance manager
-
isSortable
public boolean isSortable(java.lang.String attributeQualifier)
Description copied from interface:CollectionBrowserMoldContextChecks whether provided attribute is sortable- Specified by:
isSortablein interfaceCollectionBrowserMoldContext- Parameters:
attributeQualifier- attributes qualifier- Returns:
trueif attribute is sortable
-
getCurrentPage
public SinglePage getCurrentPage()
- Specified by:
getCurrentPagein interfaceCollectionBrowserMoldContext- Returns:
- currently loaded data page
-
sort
public void sort(SortData sortData)
Description copied from interface:CollectionBrowserMoldContextReads data sorted with provided parameters- Specified by:
sortin interfaceCollectionBrowserMoldContext- Parameters:
sortData- sorting parameters
-
getCurrentType
public DataType getCurrentType()
Description copied from interface:CollectionBrowserMoldContextGets data type that is currently being displayed- Specified by:
getCurrentTypein interfaceCollectionBrowserMoldContext- Returns:
- currently selected data type or
nullif selected type code does not match any of types - See Also:
CollectionBrowserMoldContext.getCurrentTypeCode()
-
getCurrentTypeCode
public java.lang.String getCurrentTypeCode()
Description copied from interface:CollectionBrowserMoldContextGets data type code that is currently being displayed- Specified by:
getCurrentTypeCodein interfaceCollectionBrowserMoldContext- Returns:
- currently selected data type code
- See Also:
CollectionBrowserMoldContext.getCurrentType()
-
isMultiSelectEnabled
public boolean isMultiSelectEnabled()
Description copied from interface:CollectionBrowserMoldContextAllows to determine if the collection browser allows for multi-selection- Specified by:
isMultiSelectEnabledin interfaceCollectionBrowserMoldContext- Returns:
- true if the collection browser allows for multi-selection
-
getDragAndDropStrategy
public DragAndDropStrategy getDragAndDropStrategy()
- Specified by:
getDragAndDropStrategyin interfaceCollectionBrowserMoldContext
-
isDragEnabled
public boolean isDragEnabled()
- Specified by:
isDragEnabledin interfaceCollectionBrowserMoldContext
-
isDropEnabled
public boolean isDropEnabled()
- Specified by:
isDropEnabledin interfaceCollectionBrowserMoldContext
-
-